From 108cfbd828d7b44140dd5320080097861eddf132 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 11 Nov 2023 21:09:17 +0100 Subject: [PATCH] Add option to open window at game start instead of coupling it with debug mode. --- Glamourer/Configuration.cs | 1 + Glamourer/Gui/MainWindow.cs | 2 +- Glamourer/Gui/Tabs/SettingsTab.cs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Glamourer/Configuration.cs b/Glamourer/Configuration.cs index ff4eb45..4490fa0 100644 --- a/Glamourer/Configuration.cs +++ b/Glamourer/Configuration.cs @@ -39,6 +39,7 @@ public class Configuration : IPluginConfiguration, ISavable public bool LockDesignQuickBar { get; set; } = false; public bool ShowQuickBarInTabs { get; set; } = true; public bool LockMainWindow { get; set; } = false; + public bool OpenWindowAtStart { get; set; } = false; public ModifiableHotkey ToggleQuickDesignBar { get; set; } = new(VirtualKey.NO_KEY); public MainWindow.TabType SelectedTab { get; set; } = MainWindow.TabType.Settings; diff --git a/Glamourer/Gui/MainWindow.cs b/Glamourer/Gui/MainWindow.cs index 3cd6d79..e26ea50 100644 --- a/Glamourer/Gui/MainWindow.cs +++ b/Glamourer/Gui/MainWindow.cs @@ -76,7 +76,7 @@ public class MainWindow : Window, IDisposable debugTab, }; _event.Subscribe(OnTabSelected, TabSelected.Priority.MainWindow); - IsOpen = _config.DebugMode; + IsOpen = _config.OpenWindowAtStart; } public override void PreDraw() diff --git a/Glamourer/Gui/Tabs/SettingsTab.cs b/Glamourer/Gui/Tabs/SettingsTab.cs index 7b86912..d690a42 100644 --- a/Glamourer/Gui/Tabs/SettingsTab.cs +++ b/Glamourer/Gui/Tabs/SettingsTab.cs @@ -136,7 +136,8 @@ public class SettingsTab : ITab }); Checkbox("Lock Main Window", "Prevent the main window from being moved and lock it in place.", _config.LockMainWindow, v => _config.LockMainWindow = v); - + Checkbox("Open Main Window at Game Start", "Whether the main Glamourer window should be open or closed after launching the game.", + _config.OpenWindowAtStart, v => _config.OpenWindowAtStart = v); ImGui.Dummy(Vector2.Zero); ImGui.Separator(); ImGui.Dummy(Vector2.Zero);