Skip to content

Commit b84d52a

Browse files
authored
Make RestartGameplay offline only
This should force the RestartGameplay button to only be able to be pressed when not in a Network session. The way this is done is basically the best way I could come up to do it with the existing architecture. It just checks to see if the previous screen is the right one, then goes through the motions if it is. If a theme ends up renaming that screen or messes with the order of execution then this might break. ... then it's the themer's fault, right?
1 parent 44def90 commit b84d52a

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/ScreenGameplay.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,18 +1905,23 @@ bool ScreenGameplay::Input( const InputEventPlus &input )
19051905
return false;
19061906
}
19071907

1908-
/* Restart gameplay button moved from theme to allow for rebinding for people who
1909-
* dont want to edit lua files :)
1910-
*/
1911-
bool bHoldingRestart = false;
1912-
if (GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(input.GameI) == Column_Invalid)
1908+
// RestartGameplay may only be pressed when in Singleplayer.
1909+
// Clever theming or something can probably break this, but we should at least try.
1910+
if (SCREENMAN->GetTopScreen()->GetPrevScreen() == "ScreenSelectMusic")
19131911
{
1914-
bHoldingRestart |= input.MenuI == GAME_BUTTON_RESTART;
1915-
}
1916-
if (bHoldingRestart)
1917-
{
1918-
SCREENMAN->GetTopScreen()->SetPrevScreenName("ScreenStageInformation");
1919-
BeginBackingOutFromGameplay();
1912+
/* Restart gameplay button moved from theme to allow for rebinding for people who
1913+
* dont want to edit lua files :)
1914+
*/
1915+
bool bHoldingRestart = false;
1916+
if (GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(input.GameI) == Column_Invalid)
1917+
{
1918+
bHoldingRestart |= input.MenuI == GAME_BUTTON_RESTART;
1919+
}
1920+
if (bHoldingRestart)
1921+
{
1922+
SCREENMAN->GetTopScreen()->SetPrevScreenName("ScreenStageInformation");
1923+
BeginBackingOutFromGameplay();
1924+
}
19201925
}
19211926

19221927

0 commit comments

Comments
 (0)