Fixed Add Server Overlay

This commit is contained in:
JacobTech 2024-04-11 19:57:45 -04:00
parent a11bc8d89b
commit 3c0a1cfe62
3 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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();
}

View File

@ -396,7 +396,7 @@ public class MainScreenWindow : Window
Controls.Add(aso);
TryDraw();
OnResize(new(Size));
OnResize(new(CS));
return Task.CompletedTask;
}