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/client/gui/screens/interfaces/ISceneStack.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/deps/core/utility/pub_sub/Publisher.h"
12#include "mc/deps/core/utility/pub_sub/Subscription.h"
13#include "mc/platform/brstd/function_ref.h"
25namespace Bedrock::PubSub::ThreadModel {
struct MultiThreaded; }
45 enum class EventType :
int {
57 ::ll::TypedStorage<4, 4, ::SceneStack::SceneStackEvent::EventType> mType;
63 virtual ~SceneStackEvent() =
default;
71 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
72 ::ll::TypedStorage<8, 48, ::std::optional<::OreUI::RouteAction>> mRouteAction;
78 virtual ~PushScreenEvent() =
default;
86 ::ll::TypedStorage<4, 4, int> mPopCount;
87 ::ll::TypedStorage<8, 48, ::std::optional<::OreUI::RouteAction>> mRouteAction;
88 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mExpectedScreenNames;
94 virtual ~PopScreenEvent() =
default;
102 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneType;
103 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneTypeExclusions;
104 ::ll::TypedStorage<4, 4, int> mPopCount;
110 virtual ~PopRangeOfTypeScreenEvent() =
default;
118 ::ll::TypedStorage<1, 1, bool> mIgnoreNotFlushableFlag;
119 ::ll::TypedStorage<1, 1, bool> mIgnoreTransitions;
120 ::ll::TypedStorage<8, 64, ::std::function<void()>> mPostFlushCallback;
126 virtual ~FlushScreenEvent() =
default;
134 virtual ~ReloadScreenEvent() =
default;
142 ::ll::TypedStorage<8, 40, ::OreUI::RouteAction> mRouteAction;
148 virtual ~RouteActionEvent() =
default;
155 ::ll::TypedStorage<8, 24, ::std::vector<::ISceneStack::SceneElement>> mScreenStack;
156 ::ll::TypedStorage<8, 8, ::CachedScenes&> mCachedScreens;
157 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SceneStack::SceneStackEvent>>> mStackEvents;
158 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SceneStack::SceneStackEvent>>> mQueuedStackEvents;
159 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenThreshold>> mScreenThresholds;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mDestroyScreenTaskGroup;
161 ::ll::TypedStorage<4, 4, int> mActiveStackSize;
162 ::ll::TypedStorage<4, 4, int> mScheduledScreenPushCount;
163 ::ll::TypedStorage<4, 4, int> mScheduledScreenPopCount;
164 ::ll::TypedStorage<1, 1, bool> mScreenNeedsEntrance;
165 ::ll::TypedStorage<8, 32, ::std::string> mLastPoppedScreenName;
166 ::ll::TypedStorage<1, 1, bool> mChangedThisFrame;
167 ::ll::TypedStorage<1, 1, bool> mScreenIsTicking;
168 ::ll::TypedStorage<1, 1, bool> mReloadScenesOnNextPop;
169 ::ll::TypedStorage<1, 1, bool> mDeferUpdatesUntilNextTick;
170 ::ll::TypedStorage<1, 1, bool> mBufferTextCharEvents;
171 ::ll::TypedStorage<8, 24, ::std::vector<::TextCharEventData>> mBufferedTextCharEventData;
172 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::OptionRegistry>> mOptions;
173 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mAsyncLoadOptionSubscription;
174 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mScreenAnimationsSubscription;
175 ::ll::TypedStorage<8, 128, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
176 mSceneStackDestroyedPublisher;
177 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(::AbstractScene&)>>>>
178 mSceneChangeCallbacks;
179 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(::AbstractScene&)>>>>
180 mPrePushSceneCallbacks;
184 ::std::vector<::std::pair<
186 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>>>>
188 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(::AbstractScene*)>>>>
189 mPrePopSceneCallbacks;
193 ::std::vector<::std::pair<
195 ::std::function<void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>>>>
201 ::std::pair<
void*, ::std::function<void(::std::vector<::std::shared_ptr<::AbstractScene>>
const&)>>>>
202 mPopRangeSceneCallbacks;
203 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(::OreUI::RouteAction
const&)>>>>
204 mRouteActionCallbacks;
205 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SceneStackProxy>> mProxy;
206 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::UIEventCoordinator>> mUIEventCoordinator;
207 ::ll::TypedStorage<8, 64, ::std::function<bool()>> mGetSuspended;
212 SceneStack& operator=(SceneStack
const&);
213 SceneStack(SceneStack
const&);
219 virtual ~SceneStack() ;
221 virtual void reload() ;
223 virtual void setOptions(::std::weak_ptr<::OptionRegistry> options) ;
226 registerSceneChangeCallback(
void* token, ::std::function<
void(::AbstractScene&)> sceneChangeCallback) ;
228 virtual void unregisterSceneChangeCallback(
void* token) ;
230 virtual void registerPrePushSceneCallback(
232 ::std::function<
void(::AbstractScene&)> prePushSceneCallback
235 virtual void unregisterPrePushSceneCallback(
void* token) ;
237 virtual void registerPushSceneCallback(
239 ::std::function<
void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>
243 virtual void unregisterPushSceneCallback(
void* token) ;
246 registerPrePopSceneCallback(
void* token, ::std::function<
void(::AbstractScene*)> prePopSceneCallback) ;
248 virtual void unregisterPrePopSceneCallback(
void* token) ;
250 virtual void registerPopSceneCallback(
252 ::std::function<
void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>
256 virtual void unregisterPopSceneCallback(
void* token) ;
258 virtual void registerPopRangeSceneCallback(
260 ::std::function<
void(::std::vector<::std::shared_ptr<::AbstractScene>>
const&)> popRangeSceneCallback
263 virtual void unregisterPopRangeSceneCallback(
void* token) ;
265 virtual void registerRouteActionCallback(
267 ::std::function<
void(::OreUI::RouteAction
const&)> routeActionCallback
270 virtual void unregisterRouteActionCallback(
void* token) ;
272 virtual void forEachVisibleScreen(
273 ::brstd::function_ref<
void(::AbstractScene&)> callback,
274 bool tickedLastFrame,
275 bool splitscreenRenderBypassThisFrame
278 virtual void forEachScreen(::brstd::function_ref<
bool(::AbstractScene&)> callback,
bool topDown) ;
280 virtual void forEachScreenConst(::brstd::function_ref<
bool(::AbstractScene
const&)> callback,
bool topDown)
const
283 virtual void forEachAlwaysAcceptInputScreen(
284 ::brstd::function_ref<
void(::AbstractScene&)> callback,
285 ::AbstractScene
const* ignoreScreen
289 forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref<
void(::AbstractScene&)> callback) ;
291 virtual void pushScreenWithRouteAction(
292 ::std::shared_ptr<::AbstractScene> newScreen,
293 ::OreUI::RouteAction
const& routeAction
296 virtual void popScreenWithRouteAction(::OreUI::RouteAction
const& routeAction) ;
298 virtual void scheduleRouteAction(::OreUI::RouteAction
const& routeAction) ;
300 virtual void pushScreen(::std::shared_ptr<::AbstractScene> newScreen,
bool flush) ;
302 virtual void schedulePopScreen(
int totalPopNumber) ;
305 schedulePopScreenWithExpectedNames(::std::vector<::std::string>
const& expectedScreenNames) ;
307 virtual void flushStack(::ISceneStack::FlushMode mode, ::std::function<
void()> postFlushCallback) ;
309 virtual void deferUpdatesUntilNextTick() ;
311 virtual ::std::optional<uint64> getFirstSceneIndexOfSceneType(::ui::SceneType sceneType)
const ;
313 virtual bool popScreensBackTo(::ui::SceneType
const sceneType) ;
315 virtual bool popScreensBackToFirstInstanceOf(::ui::SceneType
const sceneType) ;
317 virtual bool popTopScreensOfType(::ui::SceneType
const sceneType) ;
319 virtual bool update() ;
321 virtual void resetScreenChangeDirtyFlag() ;
323 virtual bool hasChangedThisFrame() const ;
325 virtual
bool isEmpty() const ;
327 virtual uint64 getSize() const ;
329 virtual
void setScreenTickingFlag(
bool screenIsTicking) ;
331 virtual
bool getScreenTickingFlag() const ;
333 virtual ::ui::SceneType getNonTerminatingSceneType() const ;
335 virtual ::std::vector<::std::
string> getScreenNames() const ;
337 virtual ::std::vector<::std::
string> getScreenTelemetryNames() const ;
339 virtual ::std::
string getScreenName() const ;
341 virtual ::std::
string getScreenTelemetry() const ;
343 virtual ::std::
string const& getLastPoppedScreenName() const ;
345 virtual
void handleLicenseChanged() ;
347 virtual
void onGameEventNotification(::ui::GameEventNotification notification) ;
349 virtual ::AbstractScene* getTopScene() ;
351 virtual ::AbstractScene const* getTopScene() const ;
353 virtual ::std::shared_ptr<::AbstractScene> getTopSceneShared() const ;
355 virtual ::AbstractScene* getActiveScene() ;
357 virtual ::AbstractScene const* getActiveScene() const ;
359 virtual ::std::shared_ptr<::AbstractScene> getSharedNonTerminatingActiveScene() ;
361 virtual ::std::shared_ptr<::AbstractScene const> const getSharedNonTerminatingActiveScene() const ;
363 virtual ::gsl::span<::ISceneStack::
SceneElement const> getScreenStackView() const ;
367 virtual
int getScheduledPopCount() const ;
369 virtual
bool isScreenReplaceable() const ;
371 virtual
void handleTextChar(::std::string_view inputUtf8) ;
373 virtual
void setBufferTextCharEvents(
bool pushTextCharEvents) ;
375 virtual
bool isBufferingTextCharEvents() const ;
377 virtual
bool isOnSceneStack(::ui::SceneType sceneType) const ;
379 virtual
bool isOnSceneStack(::std::string_view screenName) const ;
381 virtual ::SceneStackProxy* getProxy() ;
383 virtual
bool hasScheduledScreens() const ;
385 virtual
bool hasScheduledEvents() const ;
387 virtual
void setScreenThreshold(::ScreenThreshold const& screenThreshold) ;
389 virtual ::Bedrock::PubSub::Subscription
390 registerSceneStackDestroyedListener(::std::function<
void()> callback) ;
399 ::
std::function<
bool()> const& getSuspended,
400 ::
std::function<::
std::unique_ptr<::
TaskGroup>(::
std::
string)> const& taskGroupProvider
407 bool ignoreTransitions,
408 ::
std::optional<::OreUI::RouteAction> routeAction,
409 ::
std::vector<::
std::
string> const& expectedScreenNames
414 ::
std::optional<::OreUI::RouteAction> routeAction,
415 ::
std::vector<::
std::
string> const& expectedScreenNames
421 ::
std::optional<::OreUI::RouteAction> routeAction
432 bool splitscreenRenderBypassThisFrame,
433 uint64 topStackIndex,
436 bool renderDrawLastScreens
439 MCNAPI static
void forEachVisibleScreen(
442 bool tickedLastFrame,
443 bool splitscreenRenderBypassThisFrame,
454 ::
std::function<
bool()> const& getSuspended,
455 ::
std::function<::
std::unique_ptr<::
TaskGroup>(::
std::
string)> const& taskGroupProvider
515 bool tickedLastFrame,
516 bool splitscreenRenderBypassThisFrame
Definition AbstractScene.h:5
Definition CachedScenes.h:5
Definition ISceneStack.h:5
Definition OptionRegistry.h:5
Definition SceneStackProxy.h:5
Definition SceneStack.h:31
Definition SceneStack.h:29
Definition SceneStack.h:27
Definition SceneStack.h:25
Definition SceneStack.h:33
Definition SceneStack.h:35
Definition SceneStack.h:19
Definition SceneStack.h:5
MCAPI void $registerSceneChangeCallback(void *token, ::std::function< void(::AbstractScene &)> sceneChangeCallback)
MCAPI bool $popScreensBackToFirstInstanceOf(::ui::SceneType const sceneType)
static MCAPI void _forEachVisibleScreen(::brstd::function_ref< void(::AbstractScene &)> callback, ::std::function<::AbstractScene *(int)> getScreen, bool, bool splitscreenRenderBypassThisFrame, uint64 topStackIndex, uint64 startIndex, uint64 endIndex, bool renderDrawLastScreens)
MCAPI void $setScreenThreshold(::ScreenThreshold const &screenThreshold)
MCAPI bool $isOnSceneStack(::ui::SceneType sceneType) const
MCAPI void $forEachAlwaysAcceptInputScreen(::brstd::function_ref< void(::AbstractScene &)> callback, ::AbstractScene const *ignoreScreen)
MCAPI void $forEachVisibleScreen(::brstd::function_ref< void(::AbstractScene &)> callback, bool tickedLastFrame, bool splitscreenRenderBypassThisFrame)
MCAPI void $forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref< void(::AbstractScene &)> callback)
MCAPI void $pushScreen(::std::shared_ptr<::AbstractScene > newScreen, bool flush)
MCAPI void $popScreenWithRouteAction(::OreUI::RouteAction const &routeAction)
MCAPI void $setOptions(::std::weak_ptr<::OptionRegistry > options)
MCAPI bool $isEmpty() const
MCAPI void _schedulePushScreen(::std::shared_ptr<::AbstractScene > newScreen, bool flush, ::std::optional<::OreUI::RouteAction > routeAction)
MCAPI ::std::optional< uint64 > $getFirstSceneIndexOfSceneType(::ui::SceneType sceneType) const
MCAPI::Bedrock::PubSub::Subscription $registerSceneStackDestroyedListener(::std::function< void()> callback)
MCAPI bool $hasScheduledEvents() const
MCAPI void $unregisterPopRangeSceneCallback(void *token)
MCAPI void $scheduleRouteAction(::OreUI::RouteAction const &routeAction)
MCAPI int $getScheduledPopCount() const
MCAPI::std::string $getScreenTelemetry() const
MCAPI uint64 $getSize() const
MCAPI bool _popScreens(int &popCount, bool ignoreTransitions, ::std::optional<::OreUI::RouteAction > routeAction, ::std::vector<::std::string > const &expectedScreenNames)
MCAPI void $unregisterPrePopSceneCallback(void *token)
MCAPI bool _animationsEnabled() const
MCAPI void $forEachScreenConst(::brstd::function_ref< bool(::AbstractScene const &)> callback, bool topDown) const
MCAPI void $deferUpdatesUntilNextTick()
MCAPI bool $isBufferingTextCharEvents() const
MCAPI void $unregisterRouteActionCallback(void *token)
MCAPI ::std::shared_ptr<::AbstractScene > $getTopSceneShared() const
MCAPI ::std::vector<::std::string > $getScreenTelemetryNames() const
MCAPI ::gsl::span<::ISceneStack::SceneElement const > $getScreenStackView() const
MCAPI ::std::vector<::ISceneStack::PendingSceneStackChange > $getPendingSceneStackChanges() const
MCAPI void $registerPrePopSceneCallback(void *token, ::std::function< void(::AbstractScene *)> prePopSceneCallback)
MCAPI void $unregisterPushSceneCallback(void *token)
MCAPI ::std::shared_ptr<::AbstractScene > $getSharedNonTerminatingActiveScene()
MCAPI void $setScreenTickingFlag(bool screenIsTicking)
MCAPI bool $popTopScreensOfType(::ui::SceneType const sceneType)
MCAPI void $pushScreenWithRouteAction(::std::shared_ptr<::AbstractScene > newScreen, ::OreUI::RouteAction const &routeAction)
MCAPI void $unregisterPopSceneCallback(void *token)
MCAPI::ui::SceneType $getNonTerminatingSceneType() const
MCAPI void $registerPopSceneCallback(void *token, ::std::function< void(::std::shared_ptr<::AbstractScene >, bool, ::std::optional<::OreUI::RouteAction >)> popSceneCallback)
MCAPI::std::string const & $getLastPoppedScreenName() const
MCAPI void $resetScreenChangeDirtyFlag()
MCAPI void $schedulePopScreen(int totalPopNumber)
MCAPI::AbstractScene * $getTopScene()
MCAPI bool $isScreenReplaceable() const
MCAPI void $unregisterSceneChangeCallback(void *token)
MCAPI void $schedulePopScreenWithExpectedNames(::std::vector<::std::string > const &expectedScreenNames)
MCAPI void $registerPopRangeSceneCallback(void *token, ::std::function< void(::std::vector<::std::shared_ptr<::AbstractScene > > const &)> popRangeSceneCallback)
MCAPI::SceneStackProxy * $getProxy()
MCAPI bool $hasChangedThisFrame() const
MCAPI void $handleLicenseChanged()
MCAPI void * $ctor(::CachedScenes &cachedScenes, ::Bedrock::NotNullNonOwnerPtr<::UIEventCoordinator > const &uiEventCoordinator, ::std::function< bool()> const &getSuspended, ::std::function<::std::unique_ptr<::TaskGroup >(::std::string)> const &taskGroupProvider)
MCAPI void $registerPrePushSceneCallback(void *token, ::std::function< void(::AbstractScene &)> prePushSceneCallback)
MCAPI void $registerRouteActionCallback(void *token, ::std::function< void(::OreUI::RouteAction const &)> routeActionCallback)
MCAPI void $registerPushSceneCallback(void *token, ::std::function< void(::std::shared_ptr<::AbstractScene >, ::std::optional<::OreUI::RouteAction >)> pushSceneCallback)
MCAPI bool $getScreenTickingFlag() const
MCAPI bool $hasScheduledScreens() const
MCAPI bool $popScreensBackTo(::ui::SceneType const sceneType)
MCAPI void $unregisterPrePushSceneCallback(void *token)
MCAPI void _schedulePopScreen(int totalPopNumber, ::std::optional<::OreUI::RouteAction > routeAction, ::std::vector<::std::string > const &expectedScreenNames)
MCAPI void $handleTextChar(::std::string_view inputUtf8)
MCAPI::std::string $getScreenName() const
MCAPI::AbstractScene * $getActiveScene()
MCAPI void $setBufferTextCharEvents(bool pushTextCharEvents)
MCAPI ::std::vector<::std::string > $getScreenNames() const
MCAPI void $onGameEventNotification(::ui::GameEventNotification notification)
MCAPI void $flushStack(::ISceneStack::FlushMode mode, ::std::function< void()> postFlushCallback)
MCAPI void $forEachScreen(::brstd::function_ref< bool(::AbstractScene &)> callback, bool topDown)
Definition TaskGroup.h:85
Definition UIEventCoordinator.h:5
Definition MultiThreaded.h:7
Definition ISceneStack.h:18
Definition ISceneStack.h:16
Definition ScreenThreshold.h:5
Definition TextCharEventData.h:5