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; }
44 enum class EventType :
int {
55 ::ll::TypedStorage<4, 4, ::SceneStack::SceneStackEvent::EventType> mType;
61 virtual ~SceneStackEvent();
81 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
82 ::ll::TypedStorage<8, 48, ::std::optional<::OreUI::RouteAction>> mRouteAction;
99 PushScreenEvent(::std::shared_ptr<::AbstractScene> scene, ::std::optional<::OreUI::RouteAction> routeAction);
105 MCAPI
void* $ctor(::std::shared_ptr<::AbstractScene> scene, ::std::optional<::OreUI::RouteAction> routeAction);
119 ::ll::TypedStorage<4, 4, int> mPopCount;
120 ::ll::TypedStorage<8, 48, ::std::optional<::OreUI::RouteAction>> mRouteAction;
121 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mExpectedScreenNames;
141 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneType;
142 ::ll::TypedStorage<4, 4, ::ui::SceneType> mSceneTypeExclusions;
143 ::ll::TypedStorage<4, 4, int> mPopCount;
163 ::ll::TypedStorage<1, 1, bool> mIgnoreNotFlushableFlag;
164 ::ll::TypedStorage<1, 1, bool> mIgnoreTransitions;
165 ::ll::TypedStorage<8, 64, ::std::function<void()>> mPostFlushCallback;
198 ::ll::TypedStorage<8, 24, ::std::vector<::ISceneStack::SceneElement>> mScreenStack;
199 ::ll::TypedStorage<8, 8, ::CachedScenes&> mCachedScreens;
200 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SceneStack::SceneStackEvent>>> mStackEvents;
201 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SceneStack::SceneStackEvent>>> mQueuedStackEvents;
202 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenThreshold>> mScreenThresholds;
203 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mDestroyScreenTaskGroup;
204 ::ll::TypedStorage<4, 4, int> mActiveStackSize;
205 ::ll::TypedStorage<4, 4, int> mScheduledScreenPushCount;
206 ::ll::TypedStorage<4, 4, int> mScheduledScreenPopCount;
207 ::ll::TypedStorage<1, 1, bool> mScreenNeedsEntrance;
208 ::ll::TypedStorage<8, 32, ::std::string> mLastPoppedScreenName;
209 ::ll::TypedStorage<1, 1, bool> mChangedThisFrame;
210 ::ll::TypedStorage<1, 1, bool> mScreenIsTicking;
211 ::ll::TypedStorage<1, 1, bool> mReloadScenesOnNextPop;
212 ::ll::TypedStorage<1, 1, bool> mDeferUpdatesUntilNextTick;
213 ::ll::TypedStorage<1, 1, bool> mBufferTextCharEvents;
214 ::ll::TypedStorage<8, 24, ::std::vector<::TextCharEventData>> mBufferedTextCharEventData;
215 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Options>> mOptions;
216 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mAsyncLoadOptionSubscription;
217 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mScreenAnimationsSubscription;
219 mSceneStackDestroyedPublisher;
220 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(
::AbstractScene&)>>>>
221 mSceneChangeCallbacks;
222 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(
::AbstractScene&)>>>>
223 mPrePushSceneCallbacks;
227 ::std::vector<::std::pair<
229 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>>>>
231 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<
void*, ::std::function<void(
::AbstractScene*)>>>>
232 mPrePopSceneCallbacks;
236 ::std::vector<::std::pair<
238 ::std::function<void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>>>>
240 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SceneStackProxy>> mProxy;
241 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::UIEventCoordinator>> mUIEventCoordinator;
242 ::ll::TypedStorage<8, 64, ::std::function<bool()>> mGetSuspended;
247 SceneStack& operator=(SceneStack
const&);
248 SceneStack(SceneStack
const&);
254 virtual ~SceneStack() ;
256 virtual void reload() ;
258 virtual void setOptions(::std::weak_ptr<::Options> options) ;
261 registerSceneChangeCallback(
void* token, ::std::function<
void(
::AbstractScene&)> sceneChangeCallback) ;
263 virtual void unregisterSceneChangeCallback(
void* token) ;
265 virtual void registerPrePushSceneCallback(
270 virtual void unregisterPrePushSceneCallback(
void* token) ;
272 virtual void registerPushSceneCallback(
274 ::std::function<
void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>
278 virtual void unregisterPushSceneCallback(
void* token) ;
281 registerPrePopSceneCallback(
void* token, ::std::function<
void(
::AbstractScene*)> prePopSceneCallback) ;
283 virtual void unregisterPrePopSceneCallback(
void* token) ;
285 virtual void registerPopSceneCallback(
287 ::std::function<
void(::std::shared_ptr<::AbstractScene>,
bool, ::std::optional<::OreUI::RouteAction>)>
291 virtual void unregisterPopSceneCallback(
void* token) ;
293 virtual void forEachVisibleScreen(
295 bool tickedLastFrame,
296 bool splitscreenRenderBypassThisFrame
304 virtual void forEachAlwaysAcceptInputScreen(
312 virtual void pushScreenWithRouteAction(
313 ::std::shared_ptr<::AbstractScene> newScreen,
319 virtual void pushScreen(::std::shared_ptr<::AbstractScene> newScreen,
bool flush) ;
321 virtual void schedulePopScreen(
int totalPopNumber) ;
324 schedulePopScreenWithExpectedNames(::std::vector<::std::string>
const& expectedScreenNames) ;
326 virtual void flushStack(
328 bool ignoreNotFlushableFlag,
329 bool ignoreTransitions,
330 ::std::function<
void()> postFlushCallback
333 virtual void deferUpdatesUntilNextTick() ;
335 virtual ::std::optional<uint64> getFirstSceneIndexOfSceneType(::ui::SceneType sceneType)
const ;
337 virtual bool popScreensBackTo(::ui::SceneType
const sceneType) ;
339 virtual bool popScreensBackToFirstInstanceOf(::ui::SceneType
const sceneType) ;
341 virtual bool popTopScreensOfType(::ui::SceneType
const sceneType) ;
343 virtual bool update() ;
345 virtual void resetScreenChangeDirtyFlag() ;
347 virtual bool hasChangedThisFrame() const ;
349 virtual
bool isEmpty() const ;
351 virtual uint64 getSize() const ;
353 virtual
void setScreenTickingFlag(
bool screenIsTicking) ;
355 virtual
bool getScreenTickingFlag() const ;
357 virtual ::ui::SceneType getNonTerminatingSceneType() const ;
359 virtual ::
std::vector<::
std::
string> getScreenNames() const ;
361 virtual ::
std::vector<::
std::
string> getScreenTelemetryNames() const ;
363 virtual ::
std::
string getScreenName() const ;
365 virtual ::
std::
string getScreenTelemetry() const ;
367 virtual ::
std::
string const& getLastPoppedScreenName() const ;
369 virtual
void handleLicenseChanged() ;
371 virtual
void onGameEventNotification(::ui::GameEventNotification notification) ;
383 virtual ::
std::shared_ptr<::
AbstractScene> getSharedNonTerminatingActiveScene() ;
385 virtual ::
std::shared_ptr<::
AbstractScene const> const getSharedNonTerminatingActiveScene() const ;
389 virtual
int getScheduledPopCount() const ;
391 virtual
bool isScreenReplaceable() const ;
393 virtual
void handleTextChar(::
std::
string const& inputUtf8) ;
395 virtual
void setBufferTextCharEvents(
bool pushTextCharEvents) ;
397 virtual
bool isBufferingTextCharEvents() const ;
399 virtual
bool isOnSceneStack(::ui::SceneType sceneType) const ;
401 virtual
bool isOnSceneStack(::
std::
string const& screenName) const ;
405 virtual
bool hasScheduledScreens() const ;
407 virtual
bool hasScheduledEvents() const ;
409 virtual
void setScreenThreshold(::
ScreenThreshold const& screenThreshold) ;
411 virtual ::Bedrock::PubSub::Subscription
412 registerSceneStackDestroyedListener(::
std::function<
void()> callback) ;
421 ::
std::function<
bool()> const& getSuspended
424 MCAPI
bool _animationsEnabled() const;
426 MCAPI
bool _handleFlushEvent(::SceneStack::
FlushScreenEvent const& flushEvent);
432 MCAPI
bool _popScreens(
434 bool ignoreTransitions,
435 ::
std::optional<::OreUI::RouteAction> routeAction,
436 ::
std::vector<::
std::
string> const& expectedScreenNames
439 MCAPI
bool _scenesAllIgnoreAsTop(
int count) const;
441 MCAPI
void _schedulePopScreen(
443 ::
std::optional<::OreUI::RouteAction> routeAction,
444 ::
std::vector<::
std::
string> const& expectedScreenNames
447 MCAPI
void _schedulePushScreen(
450 ::
std::optional<::OreUI::RouteAction> routeAction
457 MCAPI static
void _forEachVisibleScreen(
461 bool splitscreenRenderBypassThisFrame,
462 uint64 topStackIndex,
465 bool renderDrawLastScreens
468 MCAPI static
void forEachVisibleScreen(
471 bool tickedLastFrame,
472 bool splitscreenRenderBypassThisFrame,
483 ::
std::function<
bool()> const& getSuspended
496 MCAPI
void $reload();
498 MCAPI
void $setOptions(::
std::weak_ptr<::
Options> options);
500 MCAPI
void $registerSceneChangeCallback(
void* token, ::
std::function<
void(::
AbstractScene&)> sceneChangeCallback);
502 MCAPI
void $unregisterSceneChangeCallback(
void* token);
504 MCAPI
void $registerPrePushSceneCallback(
void* token, ::
std::function<
void(::
AbstractScene&)> prePushSceneCallback);
506 MCAPI
void $unregisterPrePushSceneCallback(
void* token);
508 MCAPI
void $registerPushSceneCallback(
514 MCAPI
void $unregisterPushSceneCallback(
void* token);
516 MCAPI
void $registerPrePopSceneCallback(
void* token, ::
std::function<
void(::
AbstractScene*)> prePopSceneCallback);
518 MCAPI
void $unregisterPrePopSceneCallback(
void* token);
520 MCAPI
void $registerPopSceneCallback(
526 MCAPI
void $unregisterPopSceneCallback(
void* token);
528 MCAPI
void $forEachVisibleScreen(
530 bool tickedLastFrame,
531 bool splitscreenRenderBypassThisFrame
534 MCFOLD
void $forEachScreen(::brstd::function_ref<
bool(::
AbstractScene&)> callback,
bool topDown);
536 MCFOLD
void $forEachScreenConst(::brstd::function_ref<
bool(::
AbstractScene const&)> callback,
bool topDown) const;
538 MCAPI
void $forEachAlwaysAcceptInputScreen(
543 MCAPI
void $forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref<
void(::
AbstractScene&)> callback);
546 $pushScreenWithRouteAction(::
std::shared_ptr<::
AbstractScene> newScreen, ::OreUI::RouteAction const& routeAction);
548 MCAPI
void $popScreenWithRouteAction(::OreUI::RouteAction const& routeAction);
550 MCAPI
void $pushScreen(::
std::shared_ptr<::
AbstractScene> newScreen,
bool flush);
552 MCAPI
void $schedulePopScreen(
int totalPopNumber);
554 MCAPI
void $schedulePopScreenWithExpectedNames(::
std::vector<::
std::
string> const& expectedScreenNames);
556 MCAPI
void $flushStack(
558 bool ignoreNotFlushableFlag,
559 bool ignoreTransitions,
560 ::
std::function<
void()> postFlushCallback
563 MCAPI
void $deferUpdatesUntilNextTick();
565 MCAPI ::
std::optional<uint64> $getFirstSceneIndexOfSceneType(::ui::SceneType sceneType) const;
567 MCAPI
bool $popScreensBackTo(::ui::SceneType const sceneType);
569 MCAPI
bool $popScreensBackToFirstInstanceOf(::ui::SceneType const sceneType);
571 MCAPI
bool $popTopScreensOfType(::ui::SceneType const sceneType);
573 MCAPI
bool $update();
575 MCAPI
void $resetScreenChangeDirtyFlag();
577 MCFOLD
bool $hasChangedThisFrame() const;
579 MCAPI
bool $isEmpty() const;
581 MCAPI uint64 $getSize() const;
583 MCAPI
void $setScreenTickingFlag(
bool screenIsTicking);
585 MCAPI
bool $getScreenTickingFlag() const;
587 MCAPI ::ui::SceneType $getNonTerminatingSceneType() const;
589 MCAPI ::
std::vector<::
std::
string> $getScreenNames() const;
591 MCAPI ::
std::vector<::
std::
string> $getScreenTelemetryNames() const;
593 MCAPI ::
std::
string $getScreenName() const;
595 MCAPI ::
std::
string $getScreenTelemetry() const;
597 MCFOLD ::
std::
string const& $getLastPoppedScreenName() const;
599 MCAPI
void $handleLicenseChanged();
601 MCAPI
void $onGameEventNotification(::ui::GameEventNotification notification);
613 MCFOLD ::
std::shared_ptr<::
AbstractScene> $getSharedNonTerminatingActiveScene();
615 MCFOLD ::
std::shared_ptr<::
AbstractScene const> const $getSharedNonTerminatingActiveScene() const;
619 MCFOLD
int $getScheduledPopCount() const;
621 MCAPI
bool $isScreenReplaceable() const;
623 MCAPI
void $handleTextChar(::
std::
string const& inputUtf8);
625 MCAPI
void $setBufferTextCharEvents(
bool pushTextCharEvents);
627 MCAPI
bool $isBufferingTextCharEvents() const;
629 MCAPI
bool $isOnSceneStack(::ui::SceneType sceneType) const;
631 MCAPI
bool $isOnSceneStack(::
std::
string const& screenName) const;
635 MCAPI
bool $hasScheduledScreens() const;
637 MCAPI
bool $hasScheduledEvents() const;
639 MCAPI
void $setScreenThreshold(::
ScreenThreshold const& screenThreshold);
641 MCFOLD ::Bedrock::PubSub::Subscription $registerSceneStackDestroyedListener(::
std::function<
void()> callback);
Definition AbstractScene.h:5
Definition CachedScenes.h:5
Definition ISceneStack.h:5
Definition SceneStackProxy.h:5
Definition SceneStack.h:30
static MCAPI void ** $vftable()
Definition SceneStack.h:28
static MCAPI void ** $vftable()
Definition SceneStack.h:26
static MCAPI void ** $vftable()
Definition SceneStack.h:24
static MCAPI void ** $vftable()
Definition SceneStack.h:32
static MCAPI void ** $vftable()
Definition SceneStack.h:18
static MCAPI void ** $vftable()
Definition SceneStack.h:5
static MCAPI void ** $vftable()
Definition TaskGroup.h:57
Definition UIEventCoordinator.h:13
Definition function_ref.h:60
Definition MultiThreaded.h:12
Definition ISceneStack.h:13
Definition RouteAction.h:7
Definition ScreenThreshold.h:5
Definition TextCharEventData.h:5