mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Fix conds in Window
This commit is contained in:
parent
47b4a9b502
commit
6858c646a2
15 changed files with 40 additions and 20 deletions
|
|
@ -20,7 +20,7 @@ namespace Dalamud.CorePlugin
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
|
|
||||||
this.Size = new Vector2(810, 520);
|
this.Size = new Vector2(810, 520);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ internal class AddonPopoutWindow : Window, IDisposable
|
||||||
: base(name)
|
: base(name)
|
||||||
{
|
{
|
||||||
this.addonTree = tree;
|
this.addonTree = tree;
|
||||||
this.PositionCondition = ImGuiCond.Once;
|
this.PositionConditionNew = ImGuiCond.Once;
|
||||||
|
|
||||||
var pos = ImGui.GetMousePos() + new Vector2(50, -50);
|
var pos = ImGui.GetMousePos() + new Vector2(50, -50);
|
||||||
var workSize = ImGui.GetMainViewport().WorkSize;
|
var workSize = ImGui.GetMainViewport().WorkSize;
|
||||||
var pos2 = new Vector2(Math.Min(workSize.X - 750, pos.X), Math.Min(workSize.Y - 250, pos.Y));
|
var pos2 = new Vector2(Math.Min(workSize.X - 750, pos.X), Math.Min(workSize.Y - 250, pos.Y));
|
||||||
|
|
||||||
this.Position = pos2;
|
this.Position = pos2;
|
||||||
this.SizeCondition = ImGuiCond.Once;
|
this.SizeConditionNew = ImGuiCond.Once;
|
||||||
this.Size = new(700, 200);
|
this.Size = new(700, 200);
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ internal unsafe class NodePopoutWindow : Window, IDisposable
|
||||||
|
|
||||||
this.Position = pos2;
|
this.Position = pos2;
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
this.PositionCondition = ImGuiCond.Once;
|
this.PositionConditionNew = ImGuiCond.Once;
|
||||||
this.SizeCondition = ImGuiCond.Once;
|
this.SizeConditionNew = ImGuiCond.Once;
|
||||||
this.Size = new(700, 200);
|
this.Size = new(700, 200);
|
||||||
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
this.SizeConstraints = new() { MinimumSize = new(100, 100) };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
||||||
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
|
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
|
||||||
|
|
||||||
this.Size = new Vector2(900, 400);
|
this.Size = new Vector2(900, 400);
|
||||||
this.SizeCondition = ImGuiCond.Always;
|
this.SizeConditionNew = ImGuiCond.Always;
|
||||||
|
|
||||||
// Center the window on the main viewport
|
// Center the window on the main viewport
|
||||||
var viewportPos = ImGuiHelpers.MainViewport.Pos;
|
var viewportPos = ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ internal sealed class ColorDemoWindow : Window
|
||||||
: base("Dalamud Colors Demo")
|
: base("Dalamud Colors Demo")
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(600, 500);
|
this.Size = new Vector2(600, 500);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.colors = new List<(string Name, Vector4 Color)>()
|
this.colors = new List<(string Name, Vector4 Color)>()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ internal sealed class ComponentDemoWindow : Window
|
||||||
: base("Dalamud Components Demo")
|
: base("Dalamud Components Demo")
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(600, 500);
|
this.Size = new Vector2(600, 500);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
cm.AddAlias("clear", "cls");
|
cm.AddAlias("clear", "cls");
|
||||||
|
|
||||||
this.Size = new Vector2(500, 400);
|
this.Size = new Vector2(500, 400);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ internal class DataWindow : Window, IDisposable
|
||||||
: base("Dalamud Data", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
: base("Dalamud Data", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(400, 300);
|
this.Size = new Vector2(400, 300);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
this.orderedModules = this.modules.OrderBy(module => module.DisplayName);
|
this.orderedModules = this.modules.OrderBy(module => module.DisplayName);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ internal class GamepadModeNotifierWindow : Window
|
||||||
true)
|
true)
|
||||||
{
|
{
|
||||||
this.Size = Vector2.Zero;
|
this.Size = Vector2.Zero;
|
||||||
this.SizeCondition = ImGuiCond.Always;
|
this.SizeConditionNew = ImGuiCond.Always;
|
||||||
this.IsOpen = false;
|
this.IsOpen = false;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.imageCache = imageCache;
|
this.imageCache = imageCache;
|
||||||
|
|
||||||
this.Size = new Vector2(830, 570);
|
this.Size = new Vector2(830, 570);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.SizeConstraints = new WindowSizeConstraints
|
this.SizeConstraints = new WindowSizeConstraints
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ internal class PluginStatWindow : Window
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
this.Size = new Vector2(810, 520);
|
this.Size = new Vector2(810, 520);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ internal class SelfTestWindow : Window
|
||||||
: base("Dalamud Self-Test", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
: base("Dalamud Self-Test", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
|
||||||
{
|
{
|
||||||
this.Size = new Vector2(800, 800);
|
this.Size = new Vector2(800, 800);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ internal class SettingsWindow : Window
|
||||||
MaximumSize = new Vector2(1780, 940),
|
MaximumSize = new Vector2(1780, 940),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeConditionNew = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.tabs =
|
this.tabs =
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
||||||
this.ForceMainWindow = true;
|
this.ForceMainWindow = true;
|
||||||
|
|
||||||
this.Position = new Vector2(0, 200);
|
this.Position = new Vector2(0, 200);
|
||||||
this.PositionCondition = ImGuiCond.Always;
|
this.PositionConditionNew = ImGuiCond.Always;
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
this.shadeTexture = new(() => dalamudAssetManager.GetDalamudTextureWrap(DalamudAsset.TitleScreenMenuShade));
|
this.shadeTexture = new(() => dalamudAssetManager.GetDalamudTextureWrap(DalamudAsset.TitleScreenMenuShade));
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,17 @@ public abstract class Window
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the condition that defines when the position of this window is set.
|
/// Gets or sets the condition that defines when the position of this window is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImGuiCond PositionCondition { get; set; }
|
public ImGuiCond PositionConditionNew
|
||||||
|
{
|
||||||
|
get => (ImGuiCond)this.PositionCondition;
|
||||||
|
set => this.PositionCondition = (ImGuiNET.ImGuiCond)value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the condition that defines when the position of this window is set.
|
||||||
|
/// </summary>
|
||||||
|
[ImGuiBindingsToDo("Remove. Rename New.")]
|
||||||
|
public ImGuiNET.ImGuiCond PositionCondition { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size of the window. The size provided will be scaled by the global scale.
|
/// 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
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the condition that defines when the size of this window is set.
|
/// Gets or sets the condition that defines when the size of this window is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImGuiCond SizeCondition { get; set; }
|
public ImGuiCond SizeConditionNew
|
||||||
|
{
|
||||||
|
get => (ImGuiCond)this.SizeCondition;
|
||||||
|
set => this.SizeCondition = (ImGuiNET.ImGuiCond)value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the condition that defines when the size of this window is set.
|
||||||
|
/// </summary>
|
||||||
|
[ImGuiBindingsToDo("Remove. Rename New.")]
|
||||||
|
public ImGuiNET.ImGuiCond SizeCondition { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size constraints of the window. The size constraints provided will be scaled by the global scale.
|
/// 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)
|
if (this.ForceMainWindow)
|
||||||
pos += ImGuiHelpers.MainViewport.Pos;
|
pos += ImGuiHelpers.MainViewport.Pos;
|
||||||
|
|
||||||
ImGui.SetNextWindowPos(pos, this.PositionCondition);
|
ImGui.SetNextWindowPos(pos, this.PositionConditionNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Size.HasValue)
|
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)
|
if (this.Collapsed.HasValue)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue