From f7a77ab9e7a644c586bb4137c17d48841bede1ee Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 15 Oct 2025 19:27:43 +1100 Subject: [PATCH 1/2] refactor: Remove duplicate buildings destroyed score screen logic --- .../GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp | 9 --------- .../GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp | 9 --------- 2 files changed, 18 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 69fac1c830..b88d473b9f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -1265,15 +1265,6 @@ void populatePlayerInfo( Player *player, Int pos) win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor()); win->winHide(FALSE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", pos); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - winValue.format(L"%d", scoreKpr->getTotalBuildingsDestroyed()); - GadgetStaticTextSetText(win, winValue); - win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor()); - win->winHide(FALSE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", pos); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 7d824b2dae..604b06be68 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -1499,15 +1499,6 @@ void populatePlayerInfo( Player *player, Int pos) win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor()); win->winHide(FALSE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", pos); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - winValue.format(L"%d", scoreKpr->getTotalBuildingsDestroyed()); - GadgetStaticTextSetText(win, winValue); - win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor()); - win->winHide(FALSE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", pos); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); From 0592b1e4d1670ee1302d3ce2c8e95c445e5c228b Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 15 Oct 2025 20:16:49 +1100 Subject: [PATCH 2/2] refactor: Remove more duplicate buildings destroyed score screen logic --- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 12 ------------ .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index b88d473b9f..0c02343939 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -2026,12 +2026,6 @@ void hideWindows( Int pos ) DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); win->winHide(TRUE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - win->winHide(TRUE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", i); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); @@ -2124,12 +2118,6 @@ void setObserverWindows( Player *player, Int i ) DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); win->winHide(TRUE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - win->winHide(TRUE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", i); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 604b06be68..d7d4c1db4e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -2294,12 +2294,6 @@ void hideWindows( Int pos ) DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); win->winHide(TRUE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - win->winHide(TRUE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", i); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); @@ -2392,12 +2386,6 @@ void setObserverWindows( Player *player, Int i ) DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); win->winHide(TRUE); - // set the total BuildingsDestroyed - winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i); - win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) ); - DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str())); - win->winHide(TRUE); - // set the total Resources winName.format("ScoreScreen.wnd:StaticTextResources%d", i); win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );