diff --git a/targets/app/common/Tutorial/Tutorial.cpp b/targets/app/common/Tutorial/Tutorial.cpp index 844085386..3f3d9a24a 100644 --- a/targets/app/common/Tutorial/Tutorial.cpp +++ b/targets/app/common/Tutorial/Tutorial.cpp @@ -72,6 +72,8 @@ bool Tutorial::PopupMessageDetails::isSameContent(PopupMessageDetails* other) { return textTheSame && titleTheSame && promptTheSame; } +void ITutorial::staticInit() { Tutorial::staticCtor(); } + void Tutorial::staticCtor() { // /* diff --git a/targets/minecraft/client/Minecraft.cpp b/targets/minecraft/client/Minecraft.cpp index 6b17606d8..d46f463aa 100644 --- a/targets/minecraft/client/Minecraft.cpp +++ b/targets/minecraft/client/Minecraft.cpp @@ -17,7 +17,7 @@ #include "Timer.h" #include "User.h" #include "app/common/Audio/SoundEngine.h" -#include "app/common/Tutorial/Tutorial.h" +#include "minecraft/world/tutorial/ITutorial.h" #include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIStructs.h" #include "app/linux/Linux_UIController.h" @@ -4207,7 +4207,7 @@ void Minecraft::main(IPlatformLeaderboard& leaderboard) { EntityRenderDispatcher::staticCtor(); TileEntityRenderDispatcher::staticCtor(); User::staticCtor(); - Tutorial::staticCtor(); + ITutorial::staticInit(); ColourTable::staticCtor(); gameServices().loadDefaultGameRules(); diff --git a/targets/minecraft/world/tutorial/ITutorial.h b/targets/minecraft/world/tutorial/ITutorial.h index 6c3c23d28..20a75b694 100644 --- a/targets/minecraft/world/tutorial/ITutorial.h +++ b/targets/minecraft/world/tutorial/ITutorial.h @@ -23,6 +23,11 @@ class ITutorial { public: virtual ~ITutorial() = default; + // One-time process-wide initialisation. The concrete tutorial + // implementation in app/common/Tutorial/Tutorial.cpp provides the + // body. Called once from Minecraft::staticCtor. + static void staticInit(); + [[nodiscard]] virtual bool isStateCompleted(eTutorial_State state) = 0; virtual void changeTutorialState(eTutorial_State newState) = 0;