From dccf24e98cc39612448f05d7457b45d5a24b5a57 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 26 Sep 2023 15:36:41 +0200 Subject: [PATCH] Add 1.0.0.0 Changelog. --- Glamourer/Configuration.cs | 4 ++ Glamourer/Gui/GlamourerChangelog.cs | 98 ++++++++++++++++++++++++++ Glamourer/Gui/GlamourerWindowSystem.cs | 3 +- Glamourer/Gui/MainWindow.cs | 29 ++++---- Glamourer/Gui/Tabs/SettingsTab.cs | 20 ++++-- Glamourer/Services/ServiceManager.cs | 3 +- OtterGui | 2 +- Penumbra.String | 2 +- 8 files changed, 137 insertions(+), 24 deletions(-) create mode 100644 Glamourer/Gui/GlamourerChangelog.cs diff --git a/Glamourer/Configuration.cs b/Glamourer/Configuration.cs index 4e895c1..59c2fe5 100644 --- a/Glamourer/Configuration.cs +++ b/Glamourer/Configuration.cs @@ -11,6 +11,7 @@ using Newtonsoft.Json; using OtterGui; using OtterGui.Classes; using OtterGui.Filesystem; +using OtterGui.Widgets; using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; namespace Glamourer; @@ -33,6 +34,9 @@ public class Configuration : IPluginConfiguration, ISavable public MainWindow.TabType SelectedTab { get; set; } = MainWindow.TabType.Settings; public DoubleModifier DeleteDesignModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift); + public int LastSeenVersion { get; set; } = GlamourerChangelog.LastChangelogVersion; + public ChangeLogDisplayType ChangeLogDisplayType { get; set; } = ChangeLogDisplayType.New; + [JsonConverter(typeof(SortModeConverter))] [JsonProperty(Order = int.MaxValue)] public ISortMode SortMode { get; set; } = ISortMode.FoldersFirst; diff --git a/Glamourer/Gui/GlamourerChangelog.cs b/Glamourer/Gui/GlamourerChangelog.cs new file mode 100644 index 0000000..ddbf208 --- /dev/null +++ b/Glamourer/Gui/GlamourerChangelog.cs @@ -0,0 +1,98 @@ +using OtterGui.Widgets; + +namespace Glamourer.Gui; + +public class GlamourerChangelog +{ + public const int LastChangelogVersion = 0; + private readonly Configuration _config; + public readonly Changelog Changelog; + + public GlamourerChangelog(Configuration config) + { + _config = config; + Changelog = new Changelog("Glamourer Changelog", ConfigData, Save); + + Add1_0_0_0(Changelog); + } + + private (int, ChangeLogDisplayType) ConfigData() + => (_config.LastSeenVersion, _config.ChangeLogDisplayType); + + private void Save(int version, ChangeLogDisplayType type) + { + _config.LastSeenVersion = version; + _config.ChangeLogDisplayType = type; + _config.Save(); + } + + private static void Add1_0_0_0(Changelog log) + => log.NextVersion("Version 1.0.0.0 (Full Rework)") + .RegisterHighlight( + "Glamourer has been reworked entirely. Basically everything has been written anew from the ground up, even though some things may look the same.") + .RegisterEntry( + "The new version has been tested for quite a while, but there still may be bugs, unintended changes or other issues that slipped through, given the limited amount of testers.", + 1) + .RegisterEntry( + "Migration of configuration and existing designs should mostly work, though some fixed designs may not migrate correctly.", 1) + .RegisterEntry("All your data should be backed up before being changed, so restauration should always be possible in some way.", 1) + .RegisterImportant( + "If you encounter any problems, please report them on the discord. If you encounter data loss, please do so immediately.", 1) + .RegisterHighlight("Major Changes") + .RegisterEntry( + "Redrawing characters is mostly gone. All equipment changes, and all customization changes except race, gender or face, can be applied instantaneously without redrawing.", + 1) + .RegisterEntry( + "As a side effect, Glamourer should no longer be dangerous to use with the aesthetician, since the games data of your character is no longer manipulated, only its visualization.", + 2) + .RegisterEntry("Things like the Lalafell/Dwarf cave in Kholusia also no longer send invalid data to the server.", 2) + .RegisterEntry("Portraits should also be entirely safe.", 2) + .RegisterEntry( + "As another side effect, any changes you apply in any way will be kept across zone changes or character switches until they are actively overwritten by something or you restart the entire game, even without automation.", + 2) + .RegisterImportant( + "Compatibility with Anamnesis is questionable. Anamnesis will not be able to detect Glamourers changes, and changes in Anamnesis may confuse Glamourer.", + 2) + .RegisterHighlight("Mare Synchronos compatibility is retained.", 2) + .RegisterEntry("Reverting changes made works far more dependably.", 1) + .RegisterEntry( + "You can enable auto-reloading of gear, which will cause your equipment to be reloaded whenever you make changes to the mod collection affecting your character. Great for immediate comparisons of mod options!", + 1) + .RegisterEntry("Customizations can be toggled to apply or not apply individually instead of as a group for each design.", 1) + .RegisterImportant("Replacing your weapons was slightly restricted.", 1) + .RegisterEntry( + "Outside of GPose, you can only replace weapons with other weapons of the same type. In GPose, you should still be able to change across types.", + 2) + .RegisterEntry( + "This restriction is because changing some weapon types can lead to game freezes, crashes, soft- and hard locks of your character, and can transmit invalid data to the server.", + 2) + .RegisterEntry( + "Designs now can carry more information, like tags, their creation or last update date, a description, and associated mods.", 1) + .RegisterEntry( + "Fixed Designs are now called Automated Designs and can be found in the Automation tab. This tab has a help button in the selector.", + 1) + .RegisterEntry("Automated designs use Penumbras way of identifying characters, thus they do not apply by pure name anymore.", 2) + .RegisterImportant( + "Please look through them after the migration, because not all names in fixed designs could necessarily be migrated.", 2) + .RegisterEntry( + "Glamourer can now keep track of which items and customizations have been seen on any of your characters on this installation, so you can have a Glamour log. " + + "This log can optionally be used to restrict your own automated designs only to things you actually have unlocked, and can otherwise be used for browsing existing items.", + 1) + .RegisterHighlight("Notable Minor Changes") + .RegisterEntry("Hrothgar faces should be fixed.", 1) + .RegisterEntry("Alpha value is gone. It may be brought back later on, but generally should not be, and was not often used, so eh.", + 1) + .RegisterEntry( + "Glamourer now can optionally protect you from gender- or race-restricted gear not appearing when you switch, by automatically using an appropriate replacement.", + 1) + .RegisterEntry( + "Glamourer has some fun optional easter eggs and cheat codes, like You've got to think for yourselves! You're all individuals!", + 1) + .RegisterEntry("You can enable game context menus so you can equip linked items via Glamourer.", 1) + .RegisterEntry("A lot of configuration and options was learned from Penumbra and is available, like...", 1) + .RegisterEntry("... configurable color coding for the Glamourer UI.", 2) + .RegisterEntry("... sort modes for your design list.", 2) + .RegisterEntry("... an automated backup system keeping up to 10 backups of your glamourer data.", 2) + .RegisterEntry("... this Changelog!", 2) + .RegisterEntry("... configurable deletion modifiers for fewer misclicks!", 2); +} diff --git a/Glamourer/Gui/GlamourerWindowSystem.cs b/Glamourer/Gui/GlamourerWindowSystem.cs index e8c86f0..8858c9e 100644 --- a/Glamourer/Gui/GlamourerWindowSystem.cs +++ b/Glamourer/Gui/GlamourerWindowSystem.cs @@ -13,7 +13,7 @@ public class GlamourerWindowSystem : IDisposable private readonly PenumbraChangedItemTooltip _penumbraTooltip; public GlamourerWindowSystem(UiBuilder uiBuilder, MainWindow ui, GenericPopupWindow popups, PenumbraChangedItemTooltip penumbraTooltip, - Configuration config, UnlocksTab unlocksTab) + Configuration config, UnlocksTab unlocksTab, GlamourerChangelog changelog) { _uiBuilder = uiBuilder; _ui = ui; @@ -21,6 +21,7 @@ public class GlamourerWindowSystem : IDisposable _windowSystem.AddWindow(ui); _windowSystem.AddWindow(popups); _windowSystem.AddWindow(unlocksTab); + _windowSystem.AddWindow(changelog.Changelog); _uiBuilder.Draw += _windowSystem.Draw; _uiBuilder.OpenConfigUi += _ui.Toggle; _uiBuilder.DisableCutsceneUiHide = !config.HideWindowInCutscene; diff --git a/Glamourer/Gui/MainWindow.cs b/Glamourer/Gui/MainWindow.cs index b191460..33125c7 100644 --- a/Glamourer/Gui/MainWindow.cs +++ b/Glamourer/Gui/MainWindow.cs @@ -28,10 +28,9 @@ public class MainWindow : Window, IDisposable Unlocks = 5, } - private readonly Configuration _config; - private readonly TabSelected _event; - private readonly ITab[] _tabs; - + private readonly Configuration _config; + private readonly TabSelected _event; + private readonly ITab[] _tabs; public readonly SettingsTab Settings; public readonly ActorTab Actors; @@ -52,14 +51,14 @@ public class MainWindow : Window, IDisposable MinimumSize = new Vector2(700, 675), MaximumSize = ImGui.GetIO().DisplaySize, }; - Settings = settings; - Actors = actors; - Designs = designs; - Automation = automation; - Debug = debugTab; - Unlocks = unlocks; - _event = @event; - _config = config; + Settings = settings; + Actors = actors; + Designs = designs; + Automation = automation; + Debug = debugTab; + Unlocks = unlocks; + _event = @event; + _config = config; _tabs = new ITab[] { settings, @@ -113,7 +112,7 @@ public class MainWindow : Window, IDisposable } /// Draw the support button group on the right-hand side of the window. - public static void DrawSupportButtons() + public static void DrawSupportButtons(Changelog changelog) { var width = ImGui.CalcTextSize("Join Discord for Support").X + ImGui.GetStyle().FramePadding.X * 2; var xPos = ImGui.GetWindowWidth() - width; @@ -126,6 +125,10 @@ public class MainWindow : Window, IDisposable ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing())); CustomGui.DrawGuideButton(Glamourer.Chat, width); + + ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing())); + if (ImGui.Button("Show Changelogs", new Vector2(width, 0))) + changelog.ForceOpen = true; } private void OnTabSelected(TabType type, Design? _) diff --git a/Glamourer/Gui/Tabs/SettingsTab.cs b/Glamourer/Gui/Tabs/SettingsTab.cs index 5fdeb1b..e0e64f6 100644 --- a/Glamourer/Gui/Tabs/SettingsTab.cs +++ b/Glamourer/Gui/Tabs/SettingsTab.cs @@ -24,9 +24,11 @@ public class SettingsTab : ITab private readonly PenumbraAutoRedraw _autoRedraw; private readonly ContextMenuService _contextMenuService; private readonly UiBuilder _uiBuilder; + private readonly GlamourerChangelog _changelog; public SettingsTab(Configuration config, DesignFileSystemSelector selector, StateListener stateListener, - CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService, UiBuilder uiBuilder) + CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService, UiBuilder uiBuilder, + GlamourerChangelog changelog) { _config = config; _selector = selector; @@ -35,6 +37,7 @@ public class SettingsTab : ITab _autoRedraw = autoRedraw; _contextMenuService = contextMenuService; _uiBuilder = uiBuilder; + _changelog = changelog; } public ReadOnlySpan Label @@ -52,13 +55,14 @@ public class SettingsTab : ITab Checkbox("Enable Auto Designs", "Enable the application of designs associated to characters to be applied automatically.", _config.EnableAutoDesigns, v => _config.EnableAutoDesigns = v); ImGui.NewLine(); + ImGui.NewLine(); DrawBehaviorSettings(); DrawInterfaceSettings(); DrawColorSettings(); DrawCodes(); - MainWindow.DrawSupportButtons(); + MainWindow.DrawSupportButtons(_changelog.Changelog); } private void DrawBehaviorSettings() @@ -87,12 +91,12 @@ public class SettingsTab : ITab return; Checkbox("Smaller Equip Display", "Use single-line display without icons and small dye buttons instead of double-line display.", - _config.SmallEquip, v => _config.SmallEquip = v); + _config.SmallEquip, v => _config.SmallEquip = v); Checkbox("Show Application Checkboxes", "Show the application checkboxes in the Customization and Equipment panels of the design tab, instead of only showing them under Application Rules.", !_config.HideApplyCheckmarks, v => _config.HideApplyCheckmarks = !v); Checkbox("Enable Game Context Menus", "Whether to show a Try On via Glamourer button on context menus for equippable items.", - _config.EnableGameContextMenu, v => + _config.EnableGameContextMenu, v => { _config.EnableGameContextMenu = v; if (v) @@ -104,7 +108,7 @@ public class SettingsTab : ITab _config.HideWindowInCutscene, v => { - _config.HideWindowInCutscene = v; + _config.HideWindowInCutscene = v; _uiBuilder.DisableCutsceneUiHide = !v; }); if (Widget.DoubleModifierSelector("Design Deletion Modifier", @@ -115,10 +119,11 @@ public class SettingsTab : ITab Checkbox("Auto-Open Design Folders", "Have design folders open or closed as their default state after launching.", _config.OpenFoldersByDefault, v => _config.OpenFoldersByDefault = v); - Checkbox("Debug Mode", "Show the debug tab. Only useful for debugging or advanced use. Not recommended in general.", _config.DebugMode, v => _config.DebugMode = v); + Checkbox("Debug Mode", "Show the debug tab. Only useful for debugging or advanced use. Not recommended in general.", _config.DebugMode, + v => _config.DebugMode = v); ImGui.NewLine(); } - + /// Draw the entire Color subsection. private void DrawColorSettings() { @@ -150,6 +155,7 @@ public class SettingsTab : ITab using var tt = ImRaii.Tooltip(); ImGuiUtil.TextWrapped(tooltip); } + if (!show) return; diff --git a/Glamourer/Services/ServiceManager.cs b/Glamourer/Services/ServiceManager.cs index 9851501..0a7157f 100644 --- a/Glamourer/Services/ServiceManager.cs +++ b/Glamourer/Services/ServiceManager.cs @@ -137,7 +137,8 @@ public static class ServiceManager .AddSingleton() .AddSingleton() .AddSingleton() - .AddSingleton(); + .AddSingleton() + .AddSingleton(); private static IServiceCollection AddApi(this IServiceCollection services) => services.AddSingleton() diff --git a/OtterGui b/OtterGui index 6eb6ab1..05f7fba 160000 --- a/OtterGui +++ b/OtterGui @@ -1 +1 @@ -Subproject commit 6eb6ab156c1bc1cb61700f19768f3fa6c11e1e04 +Subproject commit 05f7fba04156e81c099c87348632ecb03c877730 diff --git a/Penumbra.String b/Penumbra.String index 5d9f36c..620a7ed 160000 --- a/Penumbra.String +++ b/Penumbra.String @@ -1 +1 @@ -Subproject commit 5d9f36c5b57685b07354460e225e65759ef9996e +Subproject commit 620a7edf009b92288257ce7d64fffb8fba44d8b5