From 3cd75ff9a52abb7aef02b4be00369a818f7a7030 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 11 Feb 2023 14:07:38 +0100 Subject: [PATCH] Update AgreementWindow to be resizeable/have more word wrapping --- Pal.Client/Pal.Client.csproj | 2 +- Pal.Client/Windows/AgreementWindow.cs | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Pal.Client/Pal.Client.csproj b/Pal.Client/Pal.Client.csproj index 659a9bb..ae15d00 100644 --- a/Pal.Client/Pal.Client.csproj +++ b/Pal.Client/Pal.Client.csproj @@ -3,7 +3,7 @@ net7.0-windows 11.0 - 2.12 + 2.13 enable diff --git a/Pal.Client/Windows/AgreementWindow.cs b/Pal.Client/Windows/AgreementWindow.cs index a11c342..617cc90 100644 --- a/Pal.Client/Windows/AgreementWindow.cs +++ b/Pal.Client/Windows/AgreementWindow.cs @@ -13,11 +13,17 @@ namespace Pal.Client.Windows public AgreementWindow() : base($"{Localization.Palace_Pal}###PalPalaceAgreement") { - Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse; + Flags = ImGuiWindowFlags.NoCollapse; Size = new Vector2(500, 500); - SizeCondition = ImGuiCond.Always; - PositionCondition = ImGuiCond.Always; + SizeCondition = ImGuiCond.FirstUseEver; + PositionCondition = ImGuiCond.FirstUseEver; Position = new Vector2(310, 310); + + SizeConstraints = new WindowSizeConstraints + { + MinimumSize = new Vector2(500, 500), + MaximumSize = new Vector2(2000, 2000), + }; } public override void OnOpen() @@ -42,9 +48,11 @@ namespace Pal.Client.Windows ImGui.Separator(); - ImGui.TextColored(ImGuiColors.DalamudRed, Localization.Agreement_Warning1); - ImGui.TextColored(ImGuiColors.DalamudRed, Localization.Agreement_Warning2); - ImGui.TextColored(ImGuiColors.DalamudRed, Localization.Agreement_Warning3); + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed); + ImGui.TextWrapped(Localization.Agreement_Warning1); + ImGui.TextWrapped(Localization.Agreement_Warning2); + ImGui.TextWrapped(Localization.Agreement_Warning3); + ImGui.PopStyleColor(); ImGui.Separator(); @@ -64,7 +72,7 @@ namespace Pal.Client.Windows ImGui.Separator(); if (ImGui.Button(Localization.Agreement_ViewPluginAndServerSourceCode)) - GenericHelpers.ShellStart("https://github.com/LizaCarvbelli/PalPalace"); + GenericHelpers.ShellStart("https://github.com/carvelli/PalPalace"); } } }