3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/GameEventNotification.h"
7#include "mc/client/gui/SceneType.h"
8#include "mc/client/gui/oreui/routing/RouteAction.h"
9#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
10#include "mc/platform/brstd/function_ref.h"
30 enum class FlushMode :
int {
33 QueuedIncludingNonFlushable = 2,
34 QueuedIgnoringTransitions = 3,
35 ImmediateIgnoringTransitions = 4,
43 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
44 ::ll::TypedStorage<1, 1, bool> mHasCompletedPrepop;
50 virtual ~SceneElement() =
default;
57 enum class Kind :
int {
68 ::ll::TypedStorage<4, 4, ::ISceneStack::PendingSceneStackChange::Kind> mKind;
69 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
70 ::ll::TypedStorage<8, 48, ::std::optional<::OreUI::RouteAction>> mRouteAction;
71 ::ll::TypedStorage<4, 4, int> mPopCount;
72 ::ll::TypedStorage<1, 1, bool> mFlushIgnoreNotFlushable;
73 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneType;
74 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneTypeExclusions;
78 using SceneChangeCallback = ::std::function<void(::AbstractScene&)>;
80 using PrePushSceneCallback = ::std::function<void(::AbstractScene&)>;
82 using PushSceneCallback =
83 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>;
85 using PrePopSceneCallback = ::std::function<void(::AbstractScene*)>;
87 using PopSceneCallback =
88 ::std::function<void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>;
90 using PopRangeSceneCallback = ::std::function<void(::std::vector<::std::shared_ptr<::AbstractScene>>
const&)>;
92 using PostFlushCallback = ::std::function<void()>;
94 using RouteActionCallback = ::std::function<void(::OreUI::RouteAction
const&)>;
96 using VoidSceneVisitor = ::brstd::function_ref<void(::AbstractScene&)>;
98 using BoolSceneVisitor = ::brstd::function_ref<bool(::AbstractScene&)>;
100 using BoolConstSceneVisitor = ::brstd::function_ref<bool(::AbstractScene
const&)>;
105 virtual ~ISceneStack() =
default;
107 virtual void reload() = 0;
109 virtual void setOptions(::std::weak_ptr<::OptionRegistry> options) = 0;
112 registerSceneChangeCallback(
void* token, ::std::function<
void(::AbstractScene&)> sceneChangeCallback) = 0;
114 virtual void unregisterSceneChangeCallback(
void* token) = 0;
117 registerPrePushSceneCallback(
void* token, ::std::function<
void(::AbstractScene&)> prePushSceneCallback) = 0;
119 virtual void unregisterPrePushSceneCallback(
void* token) = 0;
121 virtual void registerPushSceneCallback(
123 ::std::function<
void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>
127 virtual void unregisterPushSceneCallback(
void* token) = 0;
130 registerPrePopSceneCallback(
void* token, ::std::function<
void(::AbstractScene*)> prePopSceneCallback) = 0;
132 virtual void unregisterPrePopSceneCallback(
void* token) = 0;
134 virtual void registerPopSceneCallback(
136 ::std::function<
void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>
140 virtual void unregisterPopSceneCallback(
void* token) = 0;
142 virtual void registerPopRangeSceneCallback(
144 ::std::function<
void(::std::vector<::std::shared_ptr<::AbstractScene>>
const&)> popRangeSceneCallback
147 virtual void unregisterPopRangeSceneCallback(
void* token) = 0;
149 virtual void registerRouteActionCallback(
151 ::std::function<
void(::OreUI::RouteAction
const&)> routeActionCallback
154 virtual void unregisterRouteActionCallback(
void* token) = 0;
156 virtual void forEachVisibleScreen(
157 ::brstd::function_ref<
void(::AbstractScene&)> callback,
158 bool tickedLastFrame,
159 bool splitscreenRenderBypassThisFrame
162 virtual void forEachScreen(::brstd::function_ref<
bool(::AbstractScene&)> callback,
bool topDown) = 0;
165 forEachScreenConst(::brstd::function_ref<
bool(::AbstractScene
const&)> callback,
bool topDown)
const = 0;
167 virtual void forEachAlwaysAcceptInputScreen(
168 ::brstd::function_ref<
void(::AbstractScene&)> callback,
169 ::AbstractScene
const* ignoreScreen
172 virtual void forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref<
void(::AbstractScene&)> callback) = 0;
174 virtual void pushScreenWithRouteAction(
175 ::std::shared_ptr<::AbstractScene> newScreen,
176 ::OreUI::RouteAction
const& routeAction
179 virtual void popScreenWithRouteAction(::OreUI::RouteAction
const& routeAction) = 0;
181 virtual void scheduleRouteAction(::OreUI::RouteAction
const& routeAction) = 0;
183 virtual void pushScreen(::std::shared_ptr<::AbstractScene> newScreen,
bool flush) = 0;
185 virtual void schedulePopScreen(
int totalPopNumber) = 0;
187 virtual void schedulePopScreenWithExpectedNames(::std::vector<::std::string>
const& expectedScreenNames) = 0;
189 virtual void flushStack(::ISceneStack::FlushMode mode, ::std::function<
void()> postFlushCallback) = 0;
191 virtual void deferUpdatesUntilNextTick() = 0;
193 virtual ::std::optional<uint64> getFirstSceneIndexOfSceneType(::ui::SceneType sceneType)
const = 0;
195 virtual bool popScreensBackTo(::ui::SceneType
const sceneType) = 0;
197 virtual bool popScreensBackToFirstInstanceOf(::ui::SceneType
const sceneType) = 0;
199 virtual bool popTopScreensOfType(::ui::SceneType
const sceneType) = 0;
201 virtual bool update() = 0;
203 virtual void resetScreenChangeDirtyFlag() = 0;
205 virtual bool hasChangedThisFrame()
const = 0;
207 virtual bool isEmpty()
const = 0;
209 virtual uint64 getSize()
const = 0;
211 virtual void setScreenTickingFlag(
bool screenIsTicking) = 0;
213 virtual bool getScreenTickingFlag()
const = 0;
215 virtual ::ui::SceneType getNonTerminatingSceneType()
const = 0;
217 virtual ::std::vector<::std::string> getScreenNames()
const = 0;
219 virtual ::std::vector<::std::string> getScreenTelemetryNames()
const = 0;
221 virtual ::std::string getScreenName()
const = 0;
223 virtual ::std::string getScreenTelemetry()
const = 0;
225 virtual ::std::string
const& getLastPoppedScreenName()
const = 0;
227 virtual void handleLicenseChanged() = 0;
229 virtual void onGameEventNotification(::ui::GameEventNotification notification) = 0;
231 virtual ::AbstractScene* getTopScene() = 0;
233 virtual ::AbstractScene
const* getTopScene()
const = 0;
235 virtual ::std::shared_ptr<::AbstractScene> getTopSceneShared()
const = 0;
237 virtual ::AbstractScene* getActiveScene() = 0;
239 virtual ::AbstractScene
const* getActiveScene()
const = 0;
241 virtual ::std::shared_ptr<::AbstractScene> getSharedNonTerminatingActiveScene() = 0;
243 virtual ::std::shared_ptr<::AbstractScene const>
const getSharedNonTerminatingActiveScene()
const = 0;
245 virtual ::gsl::span<::ISceneStack::SceneElement const> getScreenStackView()
const = 0;
247 virtual ::std::vector<::ISceneStack::PendingSceneStackChange> getPendingSceneStackChanges()
const = 0;
249 virtual int getScheduledPopCount()
const = 0;
251 virtual bool isScreenReplaceable()
const = 0;
253 virtual void handleTextChar(::std::string
const& inputUtf8) = 0;
255 virtual void setBufferTextCharEvents(
bool pushTextCharEvents) = 0;
257 virtual bool isBufferingTextCharEvents()
const = 0;
259 virtual bool isOnSceneStack(::ui::SceneType sceneType)
const = 0;
261 virtual bool isOnSceneStack(::std::string
const& screenName)
const = 0;
263 virtual ::SceneStackProxy* getProxy() = 0;
265 virtual bool hasScheduledScreens()
const = 0;
267 virtual bool hasScheduledEvents()
const = 0;
269 virtual void setScreenThreshold(::ScreenThreshold
const& screenThreshold) = 0;
271 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:18
Definition ISceneStack.h:16
Definition ScreenThreshold.h:5