3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/GameEventNotification.h"
7#include "mc/client/gui/SceneType.h"
8#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
9#include "mc/platform/brstd/function_ref.h"
33 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
34 ::ll::TypedStorage<1, 1, bool> mHasCompletedPrepop;
40 virtual ~SceneElement() =
default;
44 using SceneChangeCallback = ::std::function<void(::AbstractScene&)>;
46 using PrePushSceneCallback = ::std::function<void(::AbstractScene&)>;
48 using PushSceneCallback =
49 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>;
51 using PrePopSceneCallback = ::std::function<void(::AbstractScene*)>;
53 using PopSceneCallback =
54 ::std::function<void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>;
56 using PostFlushCallback = ::std::function<void()>;
58 using VoidSceneVisitor = ::brstd::function_ref<void(::AbstractScene&)>;
60 using BoolSceneVisitor = ::brstd::function_ref<bool(::AbstractScene&)>;
62 using BoolConstSceneVisitor = ::brstd::function_ref<bool(::AbstractScene
const&)>;
67 virtual ~ISceneStack() =
default;
69 virtual void reload() = 0;
71 virtual void setOptions(::std::weak_ptr<::OptionRegistry> options) = 0;
74 registerSceneChangeCallback(
void* token, ::std::function<
void(::AbstractScene&)> sceneChangeCallback) = 0;
76 virtual void unregisterSceneChangeCallback(
void* token) = 0;
79 registerPrePushSceneCallback(
void* token, ::std::function<
void(::AbstractScene&)> prePushSceneCallback) = 0;
81 virtual void unregisterPrePushSceneCallback(
void* token) = 0;
83 virtual void registerPushSceneCallback(
85 ::std::function<
void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>
89 virtual void unregisterPushSceneCallback(
void* token) = 0;
92 registerPrePopSceneCallback(
void* token, ::std::function<
void(::AbstractScene*)> prePopSceneCallback) = 0;
94 virtual void unregisterPrePopSceneCallback(
void* token) = 0;
96 virtual void registerPopSceneCallback(
98 ::std::function<
void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>
102 virtual void unregisterPopSceneCallback(
void* token) = 0;
104 virtual void forEachVisibleScreen(
105 ::brstd::function_ref<
void(::AbstractScene&)> callback,
106 bool tickedLastFrame,
107 bool splitscreenRenderBypassThisFrame
110 virtual void forEachScreen(::brstd::function_ref<
bool(::AbstractScene&)> callback,
bool topDown) = 0;
113 forEachScreenConst(::brstd::function_ref<
bool(::AbstractScene
const&)> callback,
bool topDown)
const = 0;
115 virtual void forEachAlwaysAcceptInputScreen(
116 ::brstd::function_ref<
void(::AbstractScene&)> callback,
117 ::AbstractScene
const* ignoreScreen
120 virtual void forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref<
void(::AbstractScene&)> callback) = 0;
122 virtual void pushScreenWithRouteAction(
123 ::std::shared_ptr<::AbstractScene> newScreen,
124 ::OreUI::RouteAction
const& routeAction
127 virtual void popScreenWithRouteAction(::OreUI::RouteAction
const& routeAction) = 0;
129 virtual void pushScreen(::std::shared_ptr<::AbstractScene> newScreen,
bool flush) = 0;
131 virtual void schedulePopScreen(
int totalPopNumber) = 0;
133 virtual void schedulePopScreenWithExpectedNames(::std::vector<::std::string>
const& expectedScreenNames) = 0;
135 virtual void flushStack(
137 bool ignoreNotFlushableFlag,
138 bool ignoreTransitions,
139 ::std::function<
void()> postFlushCallback
142 virtual void deferUpdatesUntilNextTick() = 0;
144 virtual ::std::optional<uint64> getFirstSceneIndexOfSceneType(::ui::SceneType sceneType)
const = 0;
146 virtual bool popScreensBackTo(::ui::SceneType
const sceneType) = 0;
148 virtual bool popScreensBackToFirstInstanceOf(::ui::SceneType
const sceneType) = 0;
150 virtual bool popTopScreensOfType(::ui::SceneType
const sceneType) = 0;
152 virtual bool update() = 0;
154 virtual void resetScreenChangeDirtyFlag() = 0;
156 virtual bool hasChangedThisFrame()
const = 0;
158 virtual bool isEmpty()
const = 0;
160 virtual uint64 getSize()
const = 0;
162 virtual void setScreenTickingFlag(
bool screenIsTicking) = 0;
164 virtual bool getScreenTickingFlag()
const = 0;
166 virtual ::ui::SceneType getNonTerminatingSceneType()
const = 0;
168 virtual ::std::vector<::std::string> getScreenNames()
const = 0;
170 virtual ::std::vector<::std::string> getScreenTelemetryNames()
const = 0;
172 virtual ::std::string getScreenName()
const = 0;
174 virtual ::std::string getScreenTelemetry()
const = 0;
176 virtual ::std::string
const& getLastPoppedScreenName()
const = 0;
178 virtual void handleLicenseChanged() = 0;
180 virtual void onGameEventNotification(::ui::GameEventNotification notification) = 0;
182 virtual ::AbstractScene* getTopScene() = 0;
184 virtual ::AbstractScene
const* getTopScene()
const = 0;
186 virtual ::std::shared_ptr<::AbstractScene> getTopSceneShared()
const = 0;
188 virtual ::AbstractScene* getActiveScene() = 0;
190 virtual ::AbstractScene
const* getActiveScene()
const = 0;
192 virtual ::std::shared_ptr<::AbstractScene> getSharedNonTerminatingActiveScene() = 0;
194 virtual ::std::shared_ptr<::AbstractScene const>
const getSharedNonTerminatingActiveScene()
const = 0;
196 virtual ::gsl::span<::ISceneStack::SceneElement const> getScreenStackView()
const = 0;
198 virtual int getScheduledPopCount()
const = 0;
200 virtual bool isScreenReplaceable()
const = 0;
202 virtual void handleTextChar(::std::string
const& inputUtf8) = 0;
204 virtual void setBufferTextCharEvents(
bool pushTextCharEvents) = 0;
206 virtual bool isBufferingTextCharEvents()
const = 0;
208 virtual bool isOnSceneStack(::ui::SceneType sceneType)
const = 0;
210 virtual bool isOnSceneStack(::std::string
const& screenName)
const = 0;
212 virtual ::SceneStackProxy* getProxy() = 0;
214 virtual bool hasScheduledScreens()
const = 0;
216 virtual bool hasScheduledEvents()
const = 0;
218 virtual void setScreenThreshold(::ScreenThreshold
const& screenThreshold) = 0;
220 virtual ::Bedrock::PubSub::Subscription registerSceneStackDestroyedListener(::std::function<
void()> callback) = 0;
Definition AbstractScene.h:5
Definition EnableNonOwnerReferences.h:7
Definition Subscription.h:10
Definition ISceneStack.h:5
Definition OptionRegistry.h:5
Definition SceneStackProxy.h:5
Definition ISceneStack.h:13
Definition RouteAction.h:7
Definition ScreenThreshold.h:5