Some minor fixes, changelog updates, do not include SHPKs in swaps by default.

This commit is contained in:
Ottermandias 2026-02-07 23:00:20 +01:00
parent c6c2b42d9a
commit afa804394f
12 changed files with 77 additions and 46 deletions

View file

@ -73,6 +73,10 @@ public partial class Configuration : IPluginConfiguration, ISavable, IService
public bool EnableAutomaticModImport { get; set; } = false;
public bool PreventExportLoopback { get; set; } = true;
public bool EnableCustomShapes { get; set; } = true;
[ConfigProperty]
private bool _includeShpkInSwap = false;
public PcpSettings PcpSettings = new();
[ConfigProperty]

View file

@ -460,8 +460,11 @@ public static class EquipmentSwap
}
var mtrl = FileSwap.CreateSwap(manager, ResourceType.Mtrl, redirections, pathFrom, pathTo);
var shpk = CreateShader(manager, redirections, ref mtrl.AsMtrl()!.ShaderPackage.Name, ref mtrl.DataWasChanged);
mtrl.ChildSwaps.Add(shpk);
if (manager.Config.IncludeShpkInSwap)
{
var shpk = CreateShader(manager, redirections, ref mtrl.AsMtrl()!.ShaderPackage.Name, ref mtrl.DataWasChanged);
mtrl.ChildSwaps.Add(shpk);
}
foreach (ref var texture in mtrl.AsMtrl()!.Textures.AsSpan())
{

View file

@ -2,11 +2,8 @@ using Dalamud.Interface.ImGuiNotification;
using Lumina.Data.Files;
using Lumina.Extensions;
using Luna;
using Penumbra.GameData.Files.Utility;
using Penumbra.Import.Textures;
using Penumbra.Util;
using SharpCompress.Common;
using SharpCompress.Readers;
using MdlFile = Penumbra.GameData.Files.MdlFile;
using MtrlFile = Penumbra.GameData.Files.MtrlFile;

View file

@ -34,6 +34,7 @@ public enum SwapType
Necklace,
Bracelet,
Ring,
[Name("Between Slots")]
BetweenSlots,
Hair,
@ -44,7 +45,6 @@ public enum SwapType
Glasses,
}
[NamedEnum(Utf16: false)]
public enum BetweenSlotTypes
{
@ -52,8 +52,10 @@ public enum BetweenSlotTypes
Earrings,
Necklace,
Bracelets,
[Name("Right Ring")]
RightRing,
[Name("Left Ring")]
LeftRing,
Glasses,
@ -403,8 +405,7 @@ public class ItemSwapTab : IDisposable, ITab
if (ImEx.Button("Create New Mod"u8, new Vector2(width / 2, 0), tt, !newModAvailable || _newModName.Length is 0))
CreateMod();
Im.Line.Same();
Im.Cursor.X += 20 * Im.Style.GlobalScale;
Im.Line.Same(0, 20 * Im.Style.GlobalScale + Im.Style.ItemSpacing.X);
Im.Checkbox("Use File Swaps"u8, ref _useFileSwaps);
Im.Tooltip.OnHover("Instead of writing every single non-default file to the newly created mod or option,\n"u8
+ "even those available from game files, use File Swaps to default game files where possible."u8);
@ -427,11 +428,21 @@ public class ItemSwapTab : IDisposable, ITab
if (ImEx.Button("Create New Option"u8, new Vector2(width / 2, 0), tt, !newModAvailable || !_subModValid))
CreateOption();
Im.Line.Same();
Im.Cursor.X += 20 * Im.Style.GlobalScale;
Im.Line.Same(0, 20 * Im.Style.GlobalScale + Im.Style.ItemSpacing.X);
_dirty |= Im.Checkbox("Use Entire Collection"u8, ref _useCurrentCollection);
Im.Tooltip.OnHover("Use all applied mods from the Selected Collection with their current settings and respecting the enabled state of mods and inheritance,\n"u8
Im.Tooltip.OnHover(
"Use all applied mods from the Selected Collection with their current settings and respecting the enabled state of mods and inheritance,\n"u8
+ "instead of using only the selected mod with its current settings in the Selected collection or the default settings, ignoring the enabled state and inheritance."u8);
Im.Line.Same(0, 20 * Im.Style.GlobalScale);
if (Im.Checkbox("Include Shader Packs"u8, _config.IncludeShpkInSwap))
{
_config.IncludeShpkInSwap ^= true;
_dirty = true;
}
Im.Tooltip.OnHover(
"Generally you do not want to include shader packs (*.shpk) files in your item swap since they are a much more global object than a single item.\n\nOnly enable this if you are really sure about what you are doing."u8);
}
private void DrawSwapBar()
@ -544,7 +555,7 @@ public class ItemSwapTab : IDisposable, ITab
BetweenSlotTypes.Necklace => RefTuple.Create(SwapType.Necklace, "this"u8, "it"u8),
BetweenSlotTypes.Bracelets => RefTuple.Create(SwapType.Bracelet, "these"u8, "them"u8),
BetweenSlotTypes.RightRing => RefTuple.Create(SwapType.Ring, "this"u8, "it"u8),
BetweenSlotTypes.LeftRing => RefTuple.Create(SwapType.Ring, "this"u8, "it"u8),
BetweenSlotTypes.LeftRing => RefTuple.Create(SwapType.Ring, "this"u8, "it"u8),
BetweenSlotTypes.Glasses => RefTuple.Create(SwapType.Glasses, "these"u8, "them"u8),
_ => RefTuple.Create(SwapType.Ring, "this"u8, "it"u8),
};
@ -562,9 +573,11 @@ public class ItemSwapTab : IDisposable, ITab
using var table = Im.Table.Begin("##settings"u8, 2, TableFlags.SizingFixedFit);
if (!table)
return;
table.DrawFrameColumn(text1);
table.NextColumn();
_dirty |= sourceSelector.Draw("##itemSource"u8, sourceSelector.CurrentSelection.Name, StringU8.Empty, InputWidth * 2 * Im.Style.GlobalScale, out _);
_dirty |= sourceSelector.Draw("##itemSource"u8, sourceSelector.CurrentSelection.Name, StringU8.Empty,
InputWidth * 2 * Im.Style.GlobalScale, out _);
if (type is SwapType.Ring)
{
@ -574,7 +587,8 @@ public class ItemSwapTab : IDisposable, ITab
table.DrawFrameColumn(text2);
table.NextColumn();
_dirty |= targetSelector.Draw("##itemTarget"u8, targetSelector.CurrentSelection.Name, StringU8.Empty, InputWidth * 2 * Im.Style.GlobalScale, out _);
_dirty |= targetSelector.Draw("##itemTarget"u8, targetSelector.CurrentSelection.Name, StringU8.Empty,
InputWidth * 2 * Im.Style.GlobalScale, out _);
if (type is SwapType.Ring)
{
Im.Line.Same();

View file

@ -203,25 +203,25 @@ public class ResourceTreeViewer(
}
}
using (ImStyleSingle.FrameRounding.Push(0))
{
var fieldWidth = (Im.ContentRegion.Available.X - checkSpacing * 2.0f - Im.Style.FrameHeightWithSpacing) / 2.0f;
Im.Item.SetNextWidth(fieldWidth);
var filter = config.Filters.OnScreenCharacterFilter;
if (Im.Input.Text("##TreeNameFilter"u8, ref filter, "Filter by Character/Entity Name..."u8))
{
filterChanged = true;
config.Filters.OnScreenCharacterFilter = filter;
}
Im.Line.Same(0, checkSpacing);
Im.Item.SetNextWidth(fieldWidth);
filter = config.Filters.OnScreenItemFilter;
if (Im.Input.Text("##NodeFilter"u8, ref filter, "Filter by Item/Part Name or Path..."u8))
{
filterChanged = true;
config.Filters.OnScreenItemFilter = filter;
}
using (ImStyleSingle.FrameRounding.Push(0))
{
var fieldWidth = (Im.ContentRegion.Available.X - checkSpacing * 2.0f - Im.Style.FrameHeightWithSpacing) / 2.0f;
Im.Item.SetNextWidth(fieldWidth);
var filter = config.Filters.OnScreenCharacterFilter;
if (Im.Input.Text("##TreeNameFilter"u8, ref filter, "Filter by Character/Entity Name..."u8))
{
filterChanged = true;
config.Filters.OnScreenCharacterFilter = filter;
}
Im.Line.Same(0, checkSpacing);
Im.Item.SetNextWidth(fieldWidth);
filter = config.Filters.OnScreenItemFilter;
if (Im.Input.Text("##NodeFilter"u8, ref filter, "Filter by Item/Part Name or Path..."u8))
{
filterChanged = true;
config.Filters.OnScreenItemFilter = filter;
}
}
Im.Line.Same(0, checkSpacing);

View file

@ -79,7 +79,10 @@ public class PenumbraChangelog : IUiService
.RegisterEntry(
"Dragging mods into the game to install them should no longer need to drop them into the mod selector, or having the Penumbra window open. Dragging into the game window should be enough."u8,
1)
.RegisterEntry("The mod import popup has been relegated to a Dalamud notification. The popup itself only opens when further details are requested on the notification (Thanks Ny!)."u8)
.RegisterEntry("The notification should also gather multiple import activities without creating multiple popups."u8, 1)
.RegisterEntry("Many UI widgets should be more precise and consistent."u8, 1)
.RegisterHighlight("Made it possible to have multiple Advanced Editing windows open at once (Thanks Ny!)."u8)
.RegisterHighlight("A new 'Management' tab was added."u8)
.RegisterEntry("The management tab is supposed to help users get rid of unused mods."u8, 1)
.RegisterEntry(
@ -89,13 +92,13 @@ public class PenumbraChangelog : IUiService
"New IPC was added so that other plugins can register to add notes when inactive mods are queried or mark them as active."u8, 1)
.RegisterEntry("The Duplicate Mods panel checks for multiple mods with the same name."u8, 1)
.RegisterEntry("Cleanup functions have been moved from Advanced Settings to the General Cleanup panel."u8, 1)
.RegisterEntry("The attachment points BLD and BL2 have been identified as Twinblades."u8)
.RegisterHighlight("Add support for other block compression types in the texture compression IPC (1.5.1.12)."u8)
.RegisterHighlight(
"Added IPC to provide Penumbra-related settings of other plugins in the Penumbra Settings tab (Thanks Ny!) (1.5.1.9)."u8)
.RegisterEntry("Fixed multiple issues in the advanced editing tab for materials (Thanks Ny!) (1.5.1.9)."u8)
.RegisterEntry("Added IPC to redraw members of a specific collection (Thanks Karou!) (1.5.1.8)."u8)
.RegisterEntry("Fixed an issue when other plugins set a cutscene index through API (1.5.1.7)."u8)
.RegisterHighlight("Made it possible to have multiple Advanced Editing windows open at once (Thanks Ny!) (1.5.1.7)."u8)
.RegisterHighlight(
"Added a file watcher that automatically tries to install mods when saved into a configured directory (Thanks Stoia!) (1.5.1.7)."u8)
.RegisterEntry(

View file

@ -70,7 +70,7 @@ public class CollectionSelectHeader(
}
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled,
"Toggle the temporary settings mode, where all changes you do create temporary settings first and need to be made permanent if desired."u8);
"Toggle the temporary settings mode, where all changes you do create temporary settings first and need to be made permanent if desired."u8, true);
if (!hold)
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"\nHold {config.IncognitoModifier} while clicking to toggle.");
}
@ -158,8 +158,9 @@ public class CollectionSelectHeader(
{
var (collection, name, tooltip, disabled) = tuple;
using var _ = Im.Id.Push(id);
if (ImEx.Button(name, buttonWidth, tooltip, disabled))
if (ImEx.Button(name, buttonWidth, StringU8.Empty, disabled))
_activeCollections.SetCollection(collection!, CollectionType.Current);
Im.Tooltip.OnHover(ref tooltip, HoveredFlags.AllowWhenDisabled, true);
Im.Line.Same();
}

View file

@ -24,9 +24,10 @@ public sealed class SingleGroupCombo : FilterComboBase<SingleGroupCombo.Test>, I
public void Draw(ModGroupDrawer parent, SingleModGroup group, int groupIndex, Setting currentOption)
{
using var id = Im.Id.Push(groupIndex);
_currentOption = currentOption;
_group.SetTarget(group);
if (base.Draw(group.Name, group.OptionData[currentOption.AsIndex].Name, StringU8.Empty, UiHelpers.InputTextWidth.X * 3 / 4,
if (base.Draw(StringU8.Empty, group.OptionData[currentOption.AsIndex].Name, StringU8.Empty, UiHelpers.InputTextWidth.X * 3 / 4,
out var newOption))
parent.SetModSetting(group, groupIndex, Setting.Single(newOption.OptionIndex));
}
@ -43,7 +44,11 @@ public sealed class SingleGroupCombo : FilterComboBase<SingleGroupCombo.Test>, I
{
var ret = Im.Selectable(item.Name, selected);
if (item.Description.Length > 0)
{
Im.Line.SameInner();
LunaStyle.DrawHelpMarker(item.Description, treatAsHovered: Im.Item.Hovered());
}
return ret;
}

View file

@ -26,7 +26,7 @@ public sealed class ModGroupDrawer(Configuration config, CollectionManager colle
_blockGroupCache.Clear();
_settings = settings;
_tempSettings = tempSettings;
_temporary = tempSettings != null;
_temporary = tempSettings is not null;
_locked = (tempSettings?.Lock ?? 0) > 0;
var useDummy = true;
foreach (var (idx, group) in mod.Groups.Index())

View file

@ -44,9 +44,9 @@ public sealed class ModGroupEditDrawer(
private float _spacing;
private bool _deleteEnabled;
private string? _currentGroupName;
private IModGroup? _currentGroupEdited;
private bool _isGroupNameValid = true;
private string? _currentGroupName;
private IModGroup? _currentGroupEdited;
private bool _isGroupNameValid = true;
private IModGroup? _dragDropGroup;
private IModOption? _dragDropOption;

View file

@ -72,12 +72,16 @@ public class ModPanelEditTab(
if (sharedTagsEnabled)
predefinedTagManager.DrawAddFromSharedTagsAndUpdateTags(_mod.LocalTags, _mod.ModTags, false, _mod);
UiHelpers.DefaultLineSpace();
addGroupDrawer.Draw(_mod, UiHelpers.InputTextWidth.X);
UiHelpers.DefaultLineSpace();
if (Im.Tree.Header("Group Editing"u8))
{
UiHelpers.DefaultLineSpace();
addGroupDrawer.Draw(_mod, UiHelpers.InputTextWidth.X);
UiHelpers.DefaultLineSpace();
groupEditDrawer.Draw(_mod);
}
groupEditDrawer.Draw(_mod);
descriptionPopup.Draw();
}

View file

@ -55,7 +55,7 @@ public sealed class RedrawFooter(
public void Draw(Vector2 size)
{
using var style = Im.Style.PushDefault(ImStyleDouble.FramePadding);
using var style = Im.Style.PushDefault(ImStyleDouble.WindowPadding);
DrawInfo(size with { X = 0 });
DrawTooltip();