From 3c0a1cfe628b2920317f165ffcaa595abda1913a Mon Sep 17 00:00:00 2001 From: JacobTech Date: Thu, 11 Apr 2024 19:57:45 -0400 Subject: [PATCH] Fixed Add Server Overlay --- Luski/GUI/MainScreen/UI/AccountButton.cs | 1 + Luski/GUI/MainScreen/UI/AddServerOverlay.cs | 11 ++++++----- Luski/GUI/MainScreenWindow.cs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Luski/GUI/MainScreen/UI/AccountButton.cs b/Luski/GUI/MainScreen/UI/AccountButton.cs index 1723302..934917e 100644 --- a/Luski/GUI/MainScreen/UI/AccountButton.cs +++ b/Luski/GUI/MainScreen/UI/AccountButton.cs @@ -82,6 +82,7 @@ public class AccountButton : UserControl SM.Selected = this; SM.page.Controls.Clear(); OnPageLoad.Invoke(); + Globals.ms.ForceUpdate(new(Globals.ms.CS)); } BlockDraw = false; diff --git a/Luski/GUI/MainScreen/UI/AddServerOverlay.cs b/Luski/GUI/MainScreen/UI/AddServerOverlay.cs index 05967f3..869effb 100644 --- a/Luski/GUI/MainScreen/UI/AddServerOverlay.cs +++ b/Luski/GUI/MainScreen/UI/AddServerOverlay.cs @@ -27,10 +27,8 @@ public class AddServerOverlay : UserControl, IServerOverlay public AddServerOverlay() { base.Size = Globals.ms.ClientSize; - BackgroundColor = new(0, 0, 0, 130); + base.BackgroundColor = new(0, 0, 0, 130); Anchor = ObjectAnchor.All; - - Form = new(Globals.ms.TextureManager.GetTextureResource("RoundedRectangle.png")) { @@ -337,7 +335,6 @@ public class AddServerOverlay : UserControl, IServerOverlay DisplayName.Textures[0] = UserName.Textures[0]; rec.ForceDistanceUpdate(page); Globals.ms.TryDraw(); - Globals.ms.ForceUpdate(new(Size)); } }; ca.Size = new((Form.Size.X - tb.Location.X - tb.Location.X - (tb.Location.X / 2)) / 2, ca.Size.Y); @@ -396,6 +393,7 @@ public class AddServerOverlay : UserControl, IServerOverlay return Task.CompletedTask; }; + UserName.Size = UserName.Size; page.Controls.Add(Password = new() { @@ -443,8 +441,12 @@ public class AddServerOverlay : UserControl, IServerOverlay return Task.CompletedTask; }; + Password.Size = Password.Size; + Password.ForceDistanceUpdate(page); DisplayName = null!; rec = null!; + Globals.ms.ForceUpdate(new(Globals.ms.CS)); + TryDraw(); } }; lo.Size = ca.Size; @@ -554,7 +556,6 @@ public class AddServerOverlay : UserControl, IServerOverlay Globals.ms.ser.Controls.Insert(Globals.ms.ser.Controls.Length - 1, ss); await ss.LoadServer(); Globals.ms.Controls.Remove(this); - Globals.ms.ForceUpdate(new(Size)); Globals.ms.TryDraw(); } diff --git a/Luski/GUI/MainScreenWindow.cs b/Luski/GUI/MainScreenWindow.cs index 3fa297b..1fa5ac4 100644 --- a/Luski/GUI/MainScreenWindow.cs +++ b/Luski/GUI/MainScreenWindow.cs @@ -396,7 +396,7 @@ public class MainScreenWindow : Window Controls.Add(aso); TryDraw(); - OnResize(new(Size)); + OnResize(new(CS)); return Task.CompletedTask; }