diff --git a/Glamourer/Configuration.cs b/Glamourer/Configuration.cs index 5ae955f..4e895c1 100644 --- a/Glamourer/Configuration.cs +++ b/Glamourer/Configuration.cs @@ -27,8 +27,9 @@ public class Configuration : IPluginConfiguration, ISavable public bool HideApplyCheckmarks { get; set; } = false; public bool SmallEquip { get; set; } = false; public bool UnlockedItemMode { get; set; } = false; - public byte DisableFestivals { get; set; } = 1; + public byte DisableFestivals { get; set; } = 1; public bool EnableGameContextMenu { get; set; } = true; + public bool HideWindowInCutscene { get; set; } = false; public MainWindow.TabType SelectedTab { get; set; } = MainWindow.TabType.Settings; public DoubleModifier DeleteDesignModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift); diff --git a/Glamourer/Gui/GlamourerWindowSystem.cs b/Glamourer/Gui/GlamourerWindowSystem.cs index da0422f..e8c86f0 100644 --- a/Glamourer/Gui/GlamourerWindowSystem.cs +++ b/Glamourer/Gui/GlamourerWindowSystem.cs @@ -1,6 +1,7 @@ using System; using Dalamud.Interface; using Dalamud.Interface.Windowing; +using Glamourer.Gui.Tabs.UnlocksTab; namespace Glamourer.Gui; @@ -11,15 +12,18 @@ public class GlamourerWindowSystem : IDisposable private readonly MainWindow _ui; private readonly PenumbraChangedItemTooltip _penumbraTooltip; - public GlamourerWindowSystem(UiBuilder uiBuilder, MainWindow ui, GenericPopupWindow popups, PenumbraChangedItemTooltip penumbraTooltip) + public GlamourerWindowSystem(UiBuilder uiBuilder, MainWindow ui, GenericPopupWindow popups, PenumbraChangedItemTooltip penumbraTooltip, + Configuration config, UnlocksTab unlocksTab) { _uiBuilder = uiBuilder; _ui = ui; _penumbraTooltip = penumbraTooltip; _windowSystem.AddWindow(ui); _windowSystem.AddWindow(popups); - _uiBuilder.Draw += _windowSystem.Draw; - _uiBuilder.OpenConfigUi += _ui.Toggle; + _windowSystem.AddWindow(unlocksTab); + _uiBuilder.Draw += _windowSystem.Draw; + _uiBuilder.OpenConfigUi += _ui.Toggle; + _uiBuilder.DisableCutsceneUiHide = !config.HideWindowInCutscene; } public void Dispose() @@ -27,4 +31,4 @@ public class GlamourerWindowSystem : IDisposable _uiBuilder.Draw -= _windowSystem.Draw; _uiBuilder.OpenConfigUi -= _ui.Toggle; } -} \ No newline at end of file +} diff --git a/Glamourer/Gui/Tabs/SettingsTab.cs b/Glamourer/Gui/Tabs/SettingsTab.cs index d2e3709..a01fd1d 100644 --- a/Glamourer/Gui/Tabs/SettingsTab.cs +++ b/Glamourer/Gui/Tabs/SettingsTab.cs @@ -22,9 +22,10 @@ public class SettingsTab : ITab private readonly CodeService _codeService; private readonly PenumbraAutoRedraw _autoRedraw; private readonly ContextMenuService _contextMenuService; + private readonly UiBuilder _uiBuilder; public SettingsTab(Configuration config, DesignFileSystemSelector selector, StateListener stateListener, - CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService) + CodeService codeService, PenumbraAutoRedraw autoRedraw, ContextMenuService contextMenuService, UiBuilder uiBuilder) { _config = config; _selector = selector; @@ -32,6 +33,7 @@ public class SettingsTab : ITab _codeService = codeService; _autoRedraw = autoRedraw; _contextMenuService = contextMenuService; + _uiBuilder = uiBuilder; } public ReadOnlySpan Label @@ -75,6 +77,13 @@ public class SettingsTab : ITab else _contextMenuService.Disable(); }); + Checkbox("Hide Window in Cutscenes", "Whether the main Glamourer window should automatically be hidden when entering cutscenes or not.", + _config.HideWindowInCutscene, + v => + { + _config.HideWindowInCutscene = v; + _uiBuilder.DisableCutsceneUiHide = !v; + }); if (Widget.DoubleModifierSelector("Design Deletion Modifier", "A modifier you need to hold while clicking the Delete Design button for it to take effect.", 100 * ImGuiHelpers.GlobalScale, _config.DeleteDesignModifier, v => _config.DeleteDesignModifier = v)) diff --git a/Glamourer/Gui/Tabs/UnlocksTab/UnlocksTab.cs b/Glamourer/Gui/Tabs/UnlocksTab/UnlocksTab.cs index c2bba60..75f180f 100644 --- a/Glamourer/Gui/Tabs/UnlocksTab/UnlocksTab.cs +++ b/Glamourer/Gui/Tabs/UnlocksTab/UnlocksTab.cs @@ -1,6 +1,7 @@ using System; using System.Numerics; using Dalamud.Interface; +using Dalamud.Interface.Windowing; using ImGuiNET; using OtterGui.Raii; using OtterGui; @@ -8,17 +9,25 @@ using OtterGui.Widgets; namespace Glamourer.Gui.Tabs.UnlocksTab; -public class UnlocksTab : ITab +public class UnlocksTab : Window, ITab { private readonly Configuration _config; private readonly UnlockOverview _overview; private readonly UnlockTable _table; public UnlocksTab(Configuration config, UnlockOverview overview, UnlockTable table) + : base("Unlocked Equipment") { _config = config; _overview = overview; _table = table; + + IsOpen = false; + SizeConstraints = new WindowSizeConstraints() + { + MinimumSize = new Vector2(700, 675), + MaximumSize = ImGui.GetIO().DisplaySize, + }; } private bool DetailMode @@ -43,11 +52,18 @@ public class UnlocksTab : ITab _overview.Draw(); } + public override void Draw() + { + DrawContent(); + } + private void DrawTypeSelection() { using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero) .Push(ImGuiStyleVar.FrameRounding, 0); var buttonSize = new Vector2(ImGui.GetContentRegionAvail().X / 2, ImGui.GetFrameHeight()); + if (!IsOpen) + buttonSize.X -= ImGui.GetFrameHeight() / 2; if (ImGuiUtil.DrawDisabledButton("Overview Mode", buttonSize, "Show tinted icons of sets of unlocks.", !DetailMode)) DetailMode = false; @@ -56,5 +72,12 @@ public class UnlocksTab : ITab if (ImGuiUtil.DrawDisabledButton("Detailed Mode", buttonSize, "Show all unlockable data as a combined filterable and sortable table.", DetailMode)) DetailMode = true; + if (!IsOpen) + { + ImGui.SameLine(); + if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SquareArrowUpRight.ToIconString(), new Vector2(ImGui.GetFrameHeight()), + "Pop the unlocks tab out into its own window.", false, true)) + IsOpen = true; + } } }