Skip to content

Commit b51df95

Browse files
committed
Make a way to access GameplayPractice & GameplayReplay
replace the gameplay branch with a "solid" fallback
1 parent ce9017f commit b51df95

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

Themes/Til Death/Scripts/02 Branches.lua

-3
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ Branch = {
185185
return "ScreenStageInformation"
186186
end
187187
end,
188-
GameplayScreen = function()
189-
return "ScreenGameplay"
190-
end,
191188
AfterGameplay = function()
192189
return "ScreenEvaluationNormal"
193190
end,

Themes/_fallback/Scripts/02 Branches.lua

+10-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ function GameOverOrContinue()
3232
end
3333
end
3434

35+
function ToGameplay()
36+
if GAMESTATE:IsPracticeMode() then
37+
return "ScreenGameplayPractice"
38+
elseif GAMESTATE:IsReplayMode() then
39+
return "ScreenGameplayReplay"
40+
else
41+
return "ScreenGameplay"
42+
end
43+
end
44+
3545
Branch = {
3646
Init = function()
3747
return "ScreenInit"
@@ -189,9 +199,6 @@ Branch = {
189199
return "ScreenStageInformation"
190200
end
191201
end,
192-
GameplayScreen = function()
193-
return "ScreenGameplay"
194-
end,
195202
AfterGameplay = function()
196203
return "ScreenEvaluationNormal"
197204
end,

Themes/_fallback/metrics.ini

+14-1
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ Fallback="StepsDisplay"
15521552
[ScreenStageInformation]
15531553
Class="ScreenSplash"
15541554
Fallback="ScreenSplash"
1555-
NextScreen=Branch.GameplayScreen()
1555+
NextScreen=ToGameplay()
15561556
PrevScreen=Branch.BackOutOfStageInformation()
15571557
PrepareScreen="ScreenGameplay"
15581558
#
@@ -2550,6 +2550,19 @@ PrepareScreen=
25502550
Class="ScreenExit"
25512551
Fallback="ScreenWithMenuElements"
25522552
AllowOperatorMenuButton=false
2553+
2554+
[ScreenGameplayPractice]
2555+
Fallback="ScreenGameplay"
2556+
Class="ScreenGameplayPractice"
2557+
NextScreen=Branch.AfterGameplay()
2558+
PrevScreen=Branch.BackOutOfStageInformation()
2559+
2560+
[ScreenGameplayReplay]
2561+
Fallback="ScreenGameplay"
2562+
Class="ScreenGameplayReplay"
2563+
NextScreen=Branch.AfterGameplay()
2564+
PrevScreen=Branch.BackOutOfStageInformation()
2565+
25532566
[ScreenNetGameplay]
25542567
Fallback="ScreenGameplay"
25552568
Class="ScreenGameplayNormal"

src/Etterna/Singletons/GameState.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,8 @@ class LunaGameState : public Luna<GameState>
18621862
GamePreferences::m_AutoPlay.Set(p->m_pPlayerState->m_PlayerController);
18631863
return 0;
18641864
}
1865+
DEFINE_METHOD(IsPracticeMode, IsPracticeMode())
1866+
DEFINE_METHOD(IsReplayMode, IsReplayMode())
18651867

18661868
DEFINE_METHOD(GetEtternaVersion, GetEtternaVersion())
18671869
LunaGameState()
@@ -1954,6 +1956,8 @@ class LunaGameState : public Luna<GameState>
19541956
ADD_METHOD(UpdateDiscordMenu);
19551957
ADD_METHOD(UpdateDiscordPresence);
19561958
ADD_METHOD(IsPaused);
1959+
ADD_METHOD(IsPracticeMode);
1960+
ADD_METHOD(IsReplayMode);
19571961
}
19581962
};
19591963

src/Etterna/Singletons/GameState.h

+7
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,13 @@ class GameState
314314
Profile* GetEditLocalProfile();
315315
bool m_bIsChartPreviewActive;
316316

317+
// is the game in a practice state
318+
bool m_practice = false;
319+
// is the game in a replay state
320+
bool m_replay = false;
321+
bool IsPracticeMode() { return m_practice; }
322+
bool IsReplayMode() { return m_replay; }
323+
317324
// Discord Rich Presence
318325
void discordInit();
319326
void updateDiscordPresence(const RString& largeImageText,

0 commit comments

Comments
 (0)