From f72cb160ed6ce2d7c9a683cd5943534d4ac390ab Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Sat, 22 Jan 2022 15:32:55 +0400 Subject: [PATCH] fix portrait bullshi on windows resize --- sources/GUI/NiceLobbyMenu.uc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/sources/GUI/NiceLobbyMenu.uc b/sources/GUI/NiceLobbyMenu.uc index fd2fd75..b89db7c 100644 --- a/sources/GUI/NiceLobbyMenu.uc +++ b/sources/GUI/NiceLobbyMenu.uc @@ -78,13 +78,29 @@ function InitComponent(GUIController MyC, GUIComponent MyO) { super(UT2k4MainPage).InitComponent(MyC, MyO); - i_Portrait.WinTop = PlayerPortraitBG.ActualTop() + 30; - i_Portrait.WinHeight = PlayerPortraitBG.ActualHeight() - 36; - + FixPortrait(); t_ChatBox.FocusInstead = PerkClickLabel; } +event ResolutionChanged(int ResX, int ResY) +{ + super.ResolutionChanged(ResX, ResY); + FixPortrait(); +} + + +// FUCKING TWI, YOUR FUCKING BUGS +final private function bool FixPortrait() +{ + i_Portrait.WinTop = PlayerPortraitBG.RelativeTop(i_Portrait.WinTop); // ActualTop() + 30; + i_Portrait.WinHeight = PlayerPortraitBG.RelativeHeight(i_Portrait.WinHeight); // ActualHeight() - 36; + // log(">>> HideLobbyMenu: FixPortrait() called!!!"); + + return false; +} + + // Called when the Menu Owner is opened event Opened(GUIComponent Sender) {