Skip to content

Commit 8109614

Browse files
MaullerBart Roossien
andauthored
[GEN][ZH] Enable Control Bar toggle for Replay playback and match observers (#854)
Co-authored-by: Bart Roossien <[email protected]>
1 parent 0a97cd0 commit 8109614

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,8 +2982,6 @@ void ControlBar::switchControlBarStage( ControlBarStages stage )
29822982
{
29832983
if(stage < CONTROL_BAR_STAGE_DEFAULT || stage >= MAX_CONTROL_BAR_STAGES)
29842984
return;
2985-
if (TheRecorder && TheRecorder->getMode() == RECORDERMODETYPE_PLAYBACK)
2986-
return;
29872985
switch (stage) {
29882986
case CONTROL_BAR_STAGE_DEFAULT:
29892987
setDefaultControlBarConfig();

Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,20 +3033,17 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
30333033
}
30343034
else
30353035
{
3036-
if (!(TheRecorder && TheRecorder->getMode() == RECORDERMODETYPE_PLAYBACK))
3036+
Bool hide = false;
3037+
if (TheWindowManager)
30373038
{
3038-
Bool hide = false;
3039-
if (TheWindowManager)
3040-
{
3041-
Int id = (Int)TheNameKeyGenerator->nameToKey(AsciiString("ControlBar.wnd:ControlBarParent"));
3042-
GameWindow *window = TheWindowManager->winGetWindowFromId(NULL, id);
3043-
3044-
if (window)
3045-
hide = !window->winIsHidden();
3046-
}
3039+
Int id = (Int)TheNameKeyGenerator->nameToKey(AsciiString("ControlBar.wnd:ControlBarParent"));
3040+
GameWindow *window = TheWindowManager->winGetWindowFromId(NULL, id);
30473041

3048-
ToggleControlBar();
3042+
if (window)
3043+
hide = !window->winIsHidden();
30493044
}
3045+
3046+
ToggleControlBar();
30503047
}
30513048
disp = DESTROY_MESSAGE;
30523049
break;

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,8 +3005,6 @@ void ControlBar::switchControlBarStage( ControlBarStages stage )
30053005
{
30063006
if(stage < CONTROL_BAR_STAGE_DEFAULT || stage >= MAX_CONTROL_BAR_STAGES)
30073007
return;
3008-
if (TheRecorder && TheRecorder->getMode() == RECORDERMODETYPE_PLAYBACK)
3009-
return;
30103008
switch (stage) {
30113009
case CONTROL_BAR_STAGE_DEFAULT:
30123010
setDefaultControlBarConfig();

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3179,20 +3179,17 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
31793179
}
31803180
else
31813181
{
3182-
if (!(TheRecorder && TheRecorder->getMode() == RECORDERMODETYPE_PLAYBACK))
3182+
Bool hide = false;
3183+
if (TheWindowManager)
31833184
{
3184-
Bool hide = false;
3185-
if (TheWindowManager)
3186-
{
3187-
Int id = (Int)TheNameKeyGenerator->nameToKey(AsciiString("ControlBar.wnd:ControlBarParent"));
3188-
GameWindow *window = TheWindowManager->winGetWindowFromId(NULL, id);
3189-
3190-
if (window)
3191-
hide = !window->winIsHidden();
3192-
}
3185+
Int id = (Int)TheNameKeyGenerator->nameToKey(AsciiString("ControlBar.wnd:ControlBarParent"));
3186+
GameWindow *window = TheWindowManager->winGetWindowFromId(NULL, id);
31933187

3194-
ToggleControlBar();
3188+
if (window)
3189+
hide = !window->winIsHidden();
31953190
}
3191+
3192+
ToggleControlBar();
31963193
}
31973194
disp = DESTROY_MESSAGE;
31983195
break;

0 commit comments

Comments
 (0)