From bd5e642045722ea2d80fdfef305701c7bc30fd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Ueti?= <52474532+Mirino97@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:30:12 -0300 Subject: [PATCH] Make CharacterWindow bigger to accomodate traitor objectives (#5850) * Move MinSize to the same place where the window is created * Adds BoxContainer to a ScrollContainer so it can resize in case of more objectives * Slight adjustment to ensure the convention is followed * Changes MinSize to SetSize so it can be resized to lower sizes and to stop it resizing every time you reopen it --- .../CharacterInterface/CharacterInterfaceComponent.cs | 6 +++++- .../CharacterInterface/CharacterInterfaceSystem.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Content.Client/CharacterInterface/CharacterInterfaceComponent.cs b/Content.Client/CharacterInterface/CharacterInterfaceComponent.cs index 5c433b2123..fe22791a62 100644 --- a/Content.Client/CharacterInterface/CharacterInterfaceComponent.cs +++ b/Content.Client/CharacterInterface/CharacterInterfaceComponent.cs @@ -41,7 +41,11 @@ namespace Content.Client.CharacterInterface { Orientation = LayoutOrientation.Vertical }; - Contents.AddChild(contentsVBox); + + var mainScrollContainer = new ScrollContainer { }; + mainScrollContainer.AddChild(contentsVBox); + + Contents.AddChild(mainScrollContainer); windowComponents.Sort((a, b) => ((int) a.Priority).CompareTo((int) b.Priority)); foreach (var element in windowComponents) diff --git a/Content.Client/CharacterInterface/CharacterInterfaceSystem.cs b/Content.Client/CharacterInterface/CharacterInterfaceSystem.cs index b92a2c15fa..0d227bd80a 100644 --- a/Content.Client/CharacterInterface/CharacterInterfaceSystem.cs +++ b/Content.Client/CharacterInterface/CharacterInterfaceSystem.cs @@ -48,7 +48,11 @@ namespace Content.Client.CharacterInterface if (comp.UIComponents.Count == 0) return; - comp.Window = new CharacterInterfaceComponent.CharacterWindow(comp.UIComponents); + comp.Window = new CharacterInterfaceComponent.CharacterWindow(comp.UIComponents) + { + SetSize = (545, 400) + }; + comp.Window.OnClose += () => _gameHud.CharacterButtonDown = false; }