From 6858c646a231369ac7bca18438f55248ee77a3dd Mon Sep 17 00:00:00 2001 From: goaaats Date: Mon, 14 Apr 2025 21:06:38 +0200 Subject: [PATCH] Fix conds in Window --- Dalamud.CorePlugin/PluginWindow.cs | 2 +- .../Internal/UiDebug2/Popout.Addon.cs | 4 +-- .../Internal/UiDebug2/Popout.Node.cs | 4 +-- .../Internal/Windows/ChangelogWindow.cs | 2 +- .../Internal/Windows/ColorDemoWindow.cs | 2 +- .../Internal/Windows/ComponentDemoWindow.cs | 2 +- .../Internal/Windows/ConsoleWindow.cs | 2 +- .../Internal/Windows/Data/DataWindow.cs | 2 +- .../Windows/GamepadModeNotifierWindow.cs | 2 +- .../PluginInstaller/PluginInstallerWindow.cs | 2 +- .../Internal/Windows/PluginStatWindow.cs | 2 +- .../Windows/SelfTest/SelfTestWindow.cs | 2 +- .../Windows/Settings/SettingsWindow.cs | 2 +- .../Internal/Windows/TitleScreenMenuWindow.cs | 2 +- Dalamud/Interface/Windowing/Window.cs | 28 ++++++++++++++++--- 15 files changed, 40 insertions(+), 20 deletions(-) diff --git a/Dalamud.CorePlugin/PluginWindow.cs b/Dalamud.CorePlugin/PluginWindow.cs index 3a17ea065..6766232fb 100644 --- a/Dalamud.CorePlugin/PluginWindow.cs +++ b/Dalamud.CorePlugin/PluginWindow.cs @@ -20,7 +20,7 @@ namespace Dalamud.CorePlugin this.IsOpen = true; this.Size = new Vector2(810, 520); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; } /// diff --git a/Dalamud/Interface/Internal/UiDebug2/Popout.Addon.cs b/Dalamud/Interface/Internal/UiDebug2/Popout.Addon.cs index 4684caa60..dd5c80d36 100644 --- a/Dalamud/Interface/Internal/UiDebug2/Popout.Addon.cs +++ b/Dalamud/Interface/Internal/UiDebug2/Popout.Addon.cs @@ -23,14 +23,14 @@ internal class AddonPopoutWindow : Window, IDisposable : base(name) { this.addonTree = tree; - this.PositionCondition = ImGuiCond.Once; + this.PositionConditionNew = ImGuiCond.Once; var pos = ImGui.GetMousePos() + new Vector2(50, -50); var workSize = ImGui.GetMainViewport().WorkSize; var pos2 = new Vector2(Math.Min(workSize.X - 750, pos.X), Math.Min(workSize.Y - 250, pos.Y)); this.Position = pos2; - this.SizeCondition = ImGuiCond.Once; + this.SizeConditionNew = ImGuiCond.Once; this.Size = new(700, 200); this.IsOpen = true; this.SizeConstraints = new() { MinimumSize = new(100, 100) }; diff --git a/Dalamud/Interface/Internal/UiDebug2/Popout.Node.cs b/Dalamud/Interface/Internal/UiDebug2/Popout.Node.cs index da4b95256..651eeb861 100644 --- a/Dalamud/Interface/Internal/UiDebug2/Popout.Node.cs +++ b/Dalamud/Interface/Internal/UiDebug2/Popout.Node.cs @@ -35,8 +35,8 @@ internal unsafe class NodePopoutWindow : Window, IDisposable this.Position = pos2; this.IsOpen = true; - this.PositionCondition = ImGuiCond.Once; - this.SizeCondition = ImGuiCond.Once; + this.PositionConditionNew = ImGuiCond.Once; + this.SizeConditionNew = ImGuiCond.Once; this.Size = new(700, 200); this.SizeConstraints = new() { MinimumSize = new(100, 100) }; } diff --git a/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs b/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs index bb53779c7..b5d96e53b 100644 --- a/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs @@ -216,7 +216,7 @@ internal sealed class ChangelogWindow : Window, IDisposable ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f)); this.Size = new Vector2(900, 400); - this.SizeCondition = ImGuiCond.Always; + this.SizeConditionNew = ImGuiCond.Always; // Center the window on the main viewport var viewportPos = ImGuiHelpers.MainViewport.Pos; diff --git a/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs b/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs index 5e8ce1f12..704a74695 100644 --- a/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs @@ -23,7 +23,7 @@ internal sealed class ColorDemoWindow : Window : base("Dalamud Colors Demo") { this.Size = new Vector2(600, 500); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.colors = new List<(string Name, Vector4 Color)>() { diff --git a/Dalamud/Interface/Internal/Windows/ComponentDemoWindow.cs b/Dalamud/Interface/Internal/Windows/ComponentDemoWindow.cs index 1d9f2f9e3..6ce52233b 100644 --- a/Dalamud/Interface/Internal/Windows/ComponentDemoWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ComponentDemoWindow.cs @@ -38,7 +38,7 @@ internal sealed class ComponentDemoWindow : Window : base("Dalamud Components Demo") { this.Size = new Vector2(600, 500); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.RespectCloseHotkey = false; diff --git a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs index c0a50ddc9..d28086cbd 100644 --- a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs @@ -100,7 +100,7 @@ internal class ConsoleWindow : Window, IDisposable cm.AddAlias("clear", "cls"); this.Size = new Vector2(500, 400); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.RespectCloseHotkey = false; diff --git a/Dalamud/Interface/Internal/Windows/Data/DataWindow.cs b/Dalamud/Interface/Internal/Windows/Data/DataWindow.cs index f37fee404..d69a0d1c2 100644 --- a/Dalamud/Interface/Internal/Windows/Data/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/Data/DataWindow.cs @@ -78,7 +78,7 @@ internal class DataWindow : Window, IDisposable : base("Dalamud Data", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse) { this.Size = new Vector2(400, 300); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.RespectCloseHotkey = false; this.orderedModules = this.modules.OrderBy(module => module.DisplayName); diff --git a/Dalamud/Interface/Internal/Windows/GamepadModeNotifierWindow.cs b/Dalamud/Interface/Internal/Windows/GamepadModeNotifierWindow.cs index 91f7f02d9..e98bc6057 100644 --- a/Dalamud/Interface/Internal/Windows/GamepadModeNotifierWindow.cs +++ b/Dalamud/Interface/Internal/Windows/GamepadModeNotifierWindow.cs @@ -24,7 +24,7 @@ internal class GamepadModeNotifierWindow : Window true) { this.Size = Vector2.Zero; - this.SizeCondition = ImGuiCond.Always; + this.SizeConditionNew = ImGuiCond.Always; this.IsOpen = false; this.RespectCloseHotkey = false; diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index 20e7c564c..08d46aece 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -152,7 +152,7 @@ internal class PluginInstallerWindow : Window, IDisposable this.imageCache = imageCache; this.Size = new Vector2(830, 570); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.SizeConstraints = new WindowSizeConstraints { diff --git a/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs b/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs index 0d24cb971..946bdc1a6 100644 --- a/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginStatWindow.cs @@ -36,7 +36,7 @@ internal class PluginStatWindow : Window this.RespectCloseHotkey = false; this.Size = new Vector2(810, 520); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; } /// diff --git a/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs b/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs index 4ddb775e4..4ca5df003 100644 --- a/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SelfTest/SelfTestWindow.cs @@ -71,7 +71,7 @@ internal class SelfTestWindow : Window : base("Dalamud Self-Test", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse) { this.Size = new Vector2(800, 800); - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.RespectCloseHotkey = false; } diff --git a/Dalamud/Interface/Internal/Windows/Settings/SettingsWindow.cs b/Dalamud/Interface/Internal/Windows/Settings/SettingsWindow.cs index 30aa62136..c40b43b7a 100644 --- a/Dalamud/Interface/Internal/Windows/Settings/SettingsWindow.cs +++ b/Dalamud/Interface/Internal/Windows/Settings/SettingsWindow.cs @@ -39,7 +39,7 @@ internal class SettingsWindow : Window MaximumSize = new Vector2(1780, 940), }; - this.SizeCondition = ImGuiCond.FirstUseEver; + this.SizeConditionNew = ImGuiCond.FirstUseEver; this.tabs = [ diff --git a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs index 0f7b354bc..a872d4a8d 100644 --- a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs +++ b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs @@ -100,7 +100,7 @@ internal class TitleScreenMenuWindow : Window, IDisposable this.ForceMainWindow = true; this.Position = new Vector2(0, 200); - this.PositionCondition = ImGuiCond.Always; + this.PositionConditionNew = ImGuiCond.Always; this.RespectCloseHotkey = false; this.shadeTexture = new(() => dalamudAssetManager.GetDalamudTextureWrap(DalamudAsset.TitleScreenMenuShade)); diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 2ba1e9925..a89f50014 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -158,7 +158,17 @@ public abstract class Window /// /// Gets or sets the condition that defines when the position of this window is set. /// - public ImGuiCond PositionCondition { get; set; } + public ImGuiCond PositionConditionNew + { + get => (ImGuiCond)this.PositionCondition; + set => this.PositionCondition = (ImGuiNET.ImGuiCond)value; + } + + /// + /// Gets or sets the condition that defines when the position of this window is set. + /// + [ImGuiBindingsToDo("Remove. Rename New.")] + public ImGuiNET.ImGuiCond PositionCondition { get; set; } /// /// Gets or sets the size of the window. The size provided will be scaled by the global scale. @@ -168,7 +178,17 @@ public abstract class Window /// /// Gets or sets the condition that defines when the size of this window is set. /// - public ImGuiCond SizeCondition { get; set; } + public ImGuiCond SizeConditionNew + { + get => (ImGuiCond)this.SizeCondition; + set => this.SizeCondition = (ImGuiNET.ImGuiCond)value; + } + + /// + /// Gets or sets the condition that defines when the size of this window is set. + /// + [ImGuiBindingsToDo("Remove. Rename New.")] + public ImGuiNET.ImGuiCond SizeCondition { get; set; } /// /// Gets or sets the size constraints of the window. The size constraints provided will be scaled by the global scale. @@ -588,12 +608,12 @@ public abstract class Window if (this.ForceMainWindow) pos += ImGuiHelpers.MainViewport.Pos; - ImGui.SetNextWindowPos(pos, this.PositionCondition); + ImGui.SetNextWindowPos(pos, this.PositionConditionNew); } if (this.Size.HasValue) { - ImGui.SetNextWindowSize(this.Size.Value * ImGuiHelpers.GlobalScale, this.SizeCondition); + ImGui.SetNextWindowSize(this.Size.Value * ImGuiHelpers.GlobalScale, this.SizeConditionNew); } if (this.Collapsed.HasValue)