Skip to content

Commit affa598

Browse files
authored
refactor(gui): Remove duplicate code in score screen (#1699)
1 parent c12bab6 commit affa598

File tree

2 files changed

+0
-42
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus
  • Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus

2 files changed

+0
-42
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,15 +1265,6 @@ void populatePlayerInfo( Player *player, Int pos)
12651265
win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor());
12661266
win->winHide(FALSE);
12671267

1268-
// set the total BuildingsDestroyed
1269-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", pos);
1270-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
1271-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
1272-
winValue.format(L"%d", scoreKpr->getTotalBuildingsDestroyed());
1273-
GadgetStaticTextSetText(win, winValue);
1274-
win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor());
1275-
win->winHide(FALSE);
1276-
12771268
// set the total Resources
12781269
winName.format("ScoreScreen.wnd:StaticTextResources%d", pos);
12791270
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
@@ -2035,12 +2026,6 @@ void hideWindows( Int pos )
20352026
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
20362027
win->winHide(TRUE);
20372028

2038-
// set the total BuildingsDestroyed
2039-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i);
2040-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
2041-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
2042-
win->winHide(TRUE);
2043-
20442029
// set the total Resources
20452030
winName.format("ScoreScreen.wnd:StaticTextResources%d", i);
20462031
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
@@ -2133,12 +2118,6 @@ void setObserverWindows( Player *player, Int i )
21332118
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
21342119
win->winHide(TRUE);
21352120

2136-
// set the total BuildingsDestroyed
2137-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i);
2138-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
2139-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
2140-
win->winHide(TRUE);
2141-
21422121
// set the total Resources
21432122
winName.format("ScoreScreen.wnd:StaticTextResources%d", i);
21442123
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,15 +1499,6 @@ void populatePlayerInfo( Player *player, Int pos)
14991499
win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor());
15001500
win->winHide(FALSE);
15011501

1502-
// set the total BuildingsDestroyed
1503-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", pos);
1504-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
1505-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
1506-
winValue.format(L"%d", scoreKpr->getTotalBuildingsDestroyed());
1507-
GadgetStaticTextSetText(win, winValue);
1508-
win->winSetEnabledTextColors(color, win->winGetEnabledTextBorderColor());
1509-
win->winHide(FALSE);
1510-
15111502
// set the total Resources
15121503
winName.format("ScoreScreen.wnd:StaticTextResources%d", pos);
15131504
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
@@ -2303,12 +2294,6 @@ void hideWindows( Int pos )
23032294
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
23042295
win->winHide(TRUE);
23052296

2306-
// set the total BuildingsDestroyed
2307-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i);
2308-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
2309-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
2310-
win->winHide(TRUE);
2311-
23122297
// set the total Resources
23132298
winName.format("ScoreScreen.wnd:StaticTextResources%d", i);
23142299
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
@@ -2401,12 +2386,6 @@ void setObserverWindows( Player *player, Int i )
24012386
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
24022387
win->winHide(TRUE);
24032388

2404-
// set the total BuildingsDestroyed
2405-
winName.format("ScoreScreen.wnd:StaticTextBuildingsDestroyed%d", i);
2406-
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );
2407-
DEBUG_ASSERTCRASH(win,("Could not find window %s on the score screen", winName.str()));
2408-
win->winHide(TRUE);
2409-
24102389
// set the total Resources
24112390
winName.format("ScoreScreen.wnd:StaticTextResources%d", i);
24122391
win = TheWindowManager->winGetWindowFromId( parent, TheNameKeyGenerator->nameToKey( winName ) );

0 commit comments

Comments
 (0)