Skip to content

Commit ff04858

Browse files
committed
fix(gui): prevent recreating gameplay control bar in main menu after window resize
1 parent ea06e0c commit ff04858

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5822,12 +5822,12 @@ void InGameUI::resetIdleWorker()
58225822

58235823
void InGameUI::recreateControlBar()
58245824
{
5825-
Bool wasVisible = FALSE;
58265825
GameWindow *parent = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ControlBarParent"));
5827-
if (parent)
5826+
if (!parent)
58285827
{
5829-
wasVisible = !parent->winIsHidden();
5828+
return;
58305829
}
5830+
Bool wasVisible = !parent->winIsHidden();
58315831

58325832
GameWindow *win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ControlBarParent"));
58335833
if (win)

GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5995,12 +5995,12 @@ void InGameUI::resetIdleWorker()
59955995

59965996
void InGameUI::recreateControlBar()
59975997
{
5998-
Bool wasVisible = FALSE;
59995998
GameWindow *parent = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ControlBarParent"));
6000-
if (parent)
5999+
if (!parent)
60016000
{
6002-
wasVisible = !parent->winIsHidden();
6001+
return;
60036002
}
6003+
Bool wasVisible = !parent->winIsHidden();
60046004

60056005
GameWindow *win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ControlBarParent"));
60066006
if (win)

0 commit comments

Comments
 (0)