diff --git a/Penumbra/Mods/Editor/ModMetaEditor.cs b/Penumbra/Mods/Editor/ModMetaEditor.cs index 829161f5..86d5e02e 100644 --- a/Penumbra/Mods/Editor/ModMetaEditor.cs +++ b/Penumbra/Mods/Editor/ModMetaEditor.cs @@ -1,3 +1,4 @@ +using System.Collections.Frozen; using Penumbra.Meta.Manipulations; using Penumbra.Mods.Manager; using Penumbra.Mods.SubMods; @@ -14,13 +15,19 @@ public class ModMetaEditor(ModManager modManager) private readonly HashSet _rsp = []; private readonly HashSet _globalEqp = []; - public int OtherImcCount { get; private set; } - public int OtherEqpCount { get; private set; } - public int OtherEqdpCount { get; private set; } - public int OtherGmpCount { get; private set; } - public int OtherEstCount { get; private set; } - public int OtherRspCount { get; private set; } - public int OtherGlobalEqpCount { get; private set; } + public sealed class OtherOptionData : List + { + public int TotalCount; + + public new void Clear() + { + TotalCount = 0; + base.Clear(); + } + } + + public readonly FrozenDictionary OtherData = + Enum.GetValues().ToFrozenDictionary(t => t, _ => new OtherOptionData()); public bool Changes { get; private set; } @@ -114,13 +121,9 @@ public class ModMetaEditor(ModManager modManager) public void Load(Mod mod, IModDataContainer currentOption) { - OtherImcCount = 0; - OtherEqpCount = 0; - OtherEqdpCount = 0; - OtherGmpCount = 0; - OtherEstCount = 0; - OtherRspCount = 0; - OtherGlobalEqpCount = 0; + foreach (var type in Enum.GetValues()) + OtherData[type].Clear(); + foreach (var option in mod.AllDataContainers) { if (option == currentOption) @@ -128,30 +131,9 @@ public class ModMetaEditor(ModManager modManager) foreach (var manip in option.Manipulations) { - switch (manip.ManipulationType) - { - case MetaManipulation.Type.Imc: - ++OtherImcCount; - break; - case MetaManipulation.Type.Eqdp: - ++OtherEqdpCount; - break; - case MetaManipulation.Type.Eqp: - ++OtherEqpCount; - break; - case MetaManipulation.Type.Est: - ++OtherEstCount; - break; - case MetaManipulation.Type.Gmp: - ++OtherGmpCount; - break; - case MetaManipulation.Type.Rsp: - ++OtherRspCount; - break; - case MetaManipulation.Type.GlobalEqp: - ++OtherGlobalEqpCount; - break; - } + var data = OtherData[manip.ManipulationType]; + ++data.TotalCount; + data.Add(option.GetFullName()); } } diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Meta.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Meta.cs index 6f542377..a2a6925a 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Meta.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Meta.cs @@ -66,37 +66,45 @@ public partial class ModEditWindow return; DrawEditHeader(_editor.MetaEditor.Eqp, "Equipment Parameter Edits (EQP)###EQP", 5, EqpRow.Draw, EqpRow.DrawNew, - _editor.MetaEditor.OtherEqpCount); + _editor.MetaEditor.OtherData[MetaManipulation.Type.Eqp]); DrawEditHeader(_editor.MetaEditor.Eqdp, "Racial Model Edits (EQDP)###EQDP", 7, EqdpRow.Draw, EqdpRow.DrawNew, - _editor.MetaEditor.OtherEqdpCount); - DrawEditHeader(_editor.MetaEditor.Imc, "Variant Edits (IMC)###IMC", 10, ImcRow.Draw, ImcRow.DrawNew, _editor.MetaEditor.OtherImcCount); + _editor.MetaEditor.OtherData[MetaManipulation.Type.Eqdp]); + DrawEditHeader(_editor.MetaEditor.Imc, "Variant Edits (IMC)###IMC", 10, ImcRow.Draw, ImcRow.DrawNew, + _editor.MetaEditor.OtherData[MetaManipulation.Type.Imc]); DrawEditHeader(_editor.MetaEditor.Est, "Extra Skeleton Parameters (EST)###EST", 7, EstRow.Draw, EstRow.DrawNew, - _editor.MetaEditor.OtherEstCount); + _editor.MetaEditor.OtherData[MetaManipulation.Type.Est]); DrawEditHeader(_editor.MetaEditor.Gmp, "Visor/Gimmick Edits (GMP)###GMP", 7, GmpRow.Draw, GmpRow.DrawNew, - _editor.MetaEditor.OtherGmpCount); + _editor.MetaEditor.OtherData[MetaManipulation.Type.Gmp]); DrawEditHeader(_editor.MetaEditor.Rsp, "Racial Scaling Edits (RSP)###RSP", 5, RspRow.Draw, RspRow.DrawNew, - _editor.MetaEditor.OtherRspCount); + _editor.MetaEditor.OtherData[MetaManipulation.Type.Rsp]); DrawEditHeader(_editor.MetaEditor.GlobalEqp, "Global Equipment Parameter Edits (Global EQP)###GEQP", 4, GlobalEqpRow.Draw, - GlobalEqpRow.DrawNew, _editor.MetaEditor.OtherGlobalEqpCount); + GlobalEqpRow.DrawNew, _editor.MetaEditor.OtherData[MetaManipulation.Type.GlobalEqp]); } /// The headers for the different meta changes all have basically the same structure for different types. private void DrawEditHeader(IReadOnlyCollection items, string label, int numColumns, - Action draw, - Action drawNew, int otherCount) + Action draw, Action drawNew, + ModMetaEditor.OtherOptionData otherOptionData) { const ImGuiTableFlags flags = ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.BordersInnerV; var oldPos = ImGui.GetCursorPosY(); var header = ImGui.CollapsingHeader($"{items.Count} {label}"); var newPos = ImGui.GetCursorPos(); - if (otherCount > 0) + if (otherOptionData.TotalCount > 0) { - var text = $"{otherCount} Edits in other Options"; + var text = $"{otherOptionData.TotalCount} Edits in other Options"; var size = ImGui.CalcTextSize(text).X; ImGui.SetCursorPos(new Vector2(ImGui.GetContentRegionAvail().X - size, oldPos + ImGui.GetStyle().FramePadding.Y)); ImGuiUtil.TextColored(ColorId.RedundantAssignment.Value() | 0xFF000000, text); + if (ImGui.IsItemHovered()) + { + using var tt = ImUtf8.Tooltip(); + foreach (var name in otherOptionData) + ImUtf8.Text(name); + } + ImGui.SetCursorPos(newPos); } diff --git a/Penumbra/UI/Changelog.cs b/Penumbra/UI/Changelog.cs index 2b2cfa99..3f5a446a 100644 --- a/Penumbra/UI/Changelog.cs +++ b/Penumbra/UI/Changelog.cs @@ -47,19 +47,26 @@ public class PenumbraChangelog Add8_2_0(Changelog); Add8_3_0(Changelog); Add1_0_0_0(Changelog); - Add1_0_2_0(Changelog); - Add1_0_3_0(Changelog); + AddDummy(Changelog); + AddDummy(Changelog); + Add1_1_0_0(Changelog); } #region Changelogs - private static void Add1_0_3_0(Changelog log) - => log.NextVersion("Version 1.0.3.0") + private static void Add1_1_0_0(Changelog log) + => log.NextVersion("Version 1.1.0.0") .RegisterImportant( "This update comes, again, with a lot of very heavy backend changes (collections and groups) and thus may introduce new issues.") + .RegisterEntry("Updated to .net8 and XIV 6.58, using some new framework facilities to improve performance and stability.") + .RegisterHighlight( + "Added an experimental crash handler that is supposed to write a Penumbra.log file when the game crashes, containing Penumbra-specific information.") + .RegisterEntry("This is disabled by default. It can be enabled in Advanced Settings.", 1) .RegisterHighlight("Collections now have associated GUIDs as identifiers instead of their names, so they can now be renamed.") .RegisterEntry("Migrating those collections may introduce issues, please let me know as soon as possible if you encounter any.", 1) .RegisterEntry("A permanent (non-rolling) backup should be created before the migration in case of any issues.", 1) + .RegisterHighlight( + "Added predefined tags that can be setup in the Settings tab and can be more easily applied or removed from mods. (by DZD)") .RegisterHighlight( "A total rework of how options and groups are handled internally, and introduction of the first new group type, the IMC Group.") .RegisterEntry( @@ -75,9 +82,14 @@ public class PenumbraChangelog .RegisterEntry( "This can be used if something like a jacket or a stole is put onto an accessory to prevent it from being hidden in general.", 1) + .RegisterEntry( + "The first empty option in a single-select option group imported from a TTMP will now keep its location instead of being moved to the first option.") + .RegisterEntry("Further empty options are still removed.", 1) .RegisterHighlight( "Added a field to rename mods directly from the mod selector context menu, instead of moving them in the filesystem.") .RegisterEntry("You can choose which rename field (none, either one or both) to display in the settings.", 1) + .RegisterEntry("Added the characterglass.shpk shader file to special shader treatment to fix issues when replacing it. (By Ny)") + .RegisterEntry("Made it more obvious if a user has not set their root directory yet.") .RegisterEntry( "You can now paste your current clipboard text into the mod selector filter with a simple right-click as long as it is not focused.") .RegisterHighlight( @@ -88,29 +100,17 @@ public class PenumbraChangelog .RegisterEntry("Removed the auto-generated descriptions for newly created groups in Penumbra.") .RegisterEntry( "Made some improvements to the Advanced Editing window, for example a much better and more performant Hex Viewer for unstructured data was added.") - .RegisterEntry("Made a lot of further improvements on Model import/export (by ackwell).") + .RegisterEntry("Various improvements to model import/export by ackwell (throughout all patches).") + .RegisterEntry("Hovering over meta manipulations in other options in the advanced editing window now shows a list of those options.") .RegisterEntry("Reworked the API and IPC structure heavily.") + .RegisterImportant("This means some plugins interacting with Penumbra may not work correctly until they update.", 1) .RegisterEntry("Worked around the UI IPC possibly displacing all settings when the drawn additions became too big.") + .RegisterEntry("Fixed an issue where reloading a mod did not ensure settings for that mod being correct afterwards.") + .RegisterEntry("Fixed some issues with the file sizes of compressed files.") .RegisterEntry("Fixed an issue with merging and deduplicating mods.") .RegisterEntry("Fixed a crash when scanning for mods without access rights to the folder.") .RegisterEntry( - "Made plugin conform to Dalamud requirements by adding a punchline and another button to open the menu from the installer."); - - private static void Add1_0_2_0(Changelog log) - => log.NextVersion("Version 1.0.2.0") - .RegisterEntry("Updated to .net8 and XIV 6.58, using some new framework facilities to improve performance and stability.") - .RegisterHighlight( - "Added an experimental crash handler that is supposed to write a Penumbra.log file when the game crashes, containing Penumbra-specific information.") - .RegisterEntry("Various improvements to model import/export by ackwell (throughout all patches).") - .RegisterHighlight( - "Added predefined tags that can be setup in the Settings tab and can be more easily applied or removed from mods. (by DZD)") - .RegisterEntry( - "The first empty option in a single-select option group imported from a TTMP will now keep its location instead of being moved to the first option.") - .RegisterEntry("Further empty options are still removed.", 1) - .RegisterEntry("Made it more obvious if a user has not set their root directory yet.") - .RegisterEntry("Added the characterglass.shpk shader file to special shader treatment to fix issues when replacing it. (By Ny)") - .RegisterEntry("Fixed some issues with the file sizes of compressed files.") - .RegisterEntry("Fixed an issue where reloading a mod did not ensure settings for that mod being correct afterwards.") + "Made plugin conform to Dalamud requirements by adding a punchline and another button to open the menu from the installer.") .RegisterEntry("Added an option to automatically redraw the player character when saving files. (1.0.0.8)") .RegisterEntry("Fixed issue with manipulating mods not triggering some events. (1.0.0.7)") .RegisterEntry("Fixed issue with temporary mods not triggering some events. (1.0.0.6)") @@ -762,6 +762,9 @@ public class PenumbraChangelog #endregion + private static void AddDummy(Changelog log) + => log.NextVersion(string.Empty); + private (int, ChangeLogDisplayType) ConfigData() => (_config.Ephemeral.LastSeenVersion, _config.ChangeLogDisplayType);