LeviLamina
Loading...
Searching...
No Matches
ISceneStack.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
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"
11
12// auto generated forward declare list
13// clang-format off
14class AbstractScene;
15class OptionRegistry;
16class SceneStackProxy;
17struct ScreenThreshold;
18namespace Bedrock::PubSub { class Subscription; }
19// clang-format on
20
22public:
23 // ISceneStack inner types declare
24 // clang-format off
25 struct SceneElement;
27 // clang-format on
28
29 // ISceneStack inner types define
30 enum class FlushMode : int {
31 Queued = 0,
32 Immediate = 1,
33 QueuedIncludingNonFlushable = 2,
34 QueuedIgnoringTransitions = 3,
35 ImmediateIgnoringTransitions = 4,
36 Teardown = 5,
37 };
38
39 struct SceneElement {
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractScene>> mScene;
44 ::ll::TypedStorage<1, 1, bool> mHasCompletedPrepop;
45 // NOLINTEND
46
47 public:
48 // virtual functions
49 // NOLINTBEGIN
50 virtual ~SceneElement() = default;
51 // NOLINTEND
52 };
53
55 public:
56 // PendingSceneStackChange inner types define
57 enum class Kind : int {
58 Push = 0,
59 Pop = 1,
60 PopRangeOfType = 2,
61 Flush = 3,
62 RouteAction = 4,
63 };
64
65 public:
66 // member variables
67 // NOLINTBEGIN
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;
75 // NOLINTEND
76 };
77
78 using SceneChangeCallback = ::std::function<void(::AbstractScene&)>;
79
80 using PrePushSceneCallback = ::std::function<void(::AbstractScene&)>;
81
82 using PushSceneCallback =
83 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>;
84
85 using PrePopSceneCallback = ::std::function<void(::AbstractScene*)>;
86
87 using PopSceneCallback =
88 ::std::function<void(::std::shared_ptr<::AbstractScene>, bool, ::std::optional<::OreUI::RouteAction>)>;
89
90 using PopRangeSceneCallback = ::std::function<void(::std::vector<::std::shared_ptr<::AbstractScene>> const&)>;
91
92 using PostFlushCallback = ::std::function<void()>;
93
94 using RouteActionCallback = ::std::function<void(::OreUI::RouteAction const&)>;
95
96 using VoidSceneVisitor = ::brstd::function_ref<void(::AbstractScene&)>;
97
98 using BoolSceneVisitor = ::brstd::function_ref<bool(::AbstractScene&)>;
99
100 using BoolConstSceneVisitor = ::brstd::function_ref<bool(::AbstractScene const&)>;
101
102public:
103 // virtual functions
104 // NOLINTBEGIN
105 virtual ~ISceneStack() /*override*/ = default;
106
107 virtual void reload() = 0;
108
109 virtual void setOptions(::std::weak_ptr<::OptionRegistry> options) = 0;
110
111 virtual void
112 registerSceneChangeCallback(void* token, ::std::function<void(::AbstractScene&)> sceneChangeCallback) = 0;
113
114 virtual void unregisterSceneChangeCallback(void* token) = 0;
115
116 virtual void
117 registerPrePushSceneCallback(void* token, ::std::function<void(::AbstractScene&)> prePushSceneCallback) = 0;
118
119 virtual void unregisterPrePushSceneCallback(void* token) = 0;
120
121 virtual void registerPushSceneCallback(
122 void* token,
123 ::std::function<void(::std::shared_ptr<::AbstractScene>, ::std::optional<::OreUI::RouteAction>)>
124 pushSceneCallback
125 ) = 0;
126
127 virtual void unregisterPushSceneCallback(void* token) = 0;
128
129 virtual void
130 registerPrePopSceneCallback(void* token, ::std::function<void(::AbstractScene*)> prePopSceneCallback) = 0;
131
132 virtual void unregisterPrePopSceneCallback(void* token) = 0;
133
134 virtual void registerPopSceneCallback(
135 void* token,
136 ::std::function<void(::std::shared_ptr<::AbstractScene>, bool, ::std::optional<::OreUI::RouteAction>)>
137 popSceneCallback
138 ) = 0;
139
140 virtual void unregisterPopSceneCallback(void* token) = 0;
141
142 virtual void registerPopRangeSceneCallback(
143 void* token,
144 ::std::function<void(::std::vector<::std::shared_ptr<::AbstractScene>> const&)> popRangeSceneCallback
145 ) = 0;
146
147 virtual void unregisterPopRangeSceneCallback(void* token) = 0;
148
149 virtual void registerRouteActionCallback(
150 void* token,
151 ::std::function<void(::OreUI::RouteAction const&)> routeActionCallback
152 ) = 0;
153
154 virtual void unregisterRouteActionCallback(void* token) = 0;
155
156 virtual void forEachVisibleScreen(
157 ::brstd::function_ref<void(::AbstractScene&)> callback,
158 bool tickedLastFrame,
159 bool splitscreenRenderBypassThisFrame
160 ) = 0;
161
162 virtual void forEachScreen(::brstd::function_ref<bool(::AbstractScene&)> callback, bool topDown) = 0;
163
164 virtual void
165 forEachScreenConst(::brstd::function_ref<bool(::AbstractScene const&)> callback, bool topDown) const = 0;
166
167 virtual void forEachAlwaysAcceptInputScreen(
168 ::brstd::function_ref<void(::AbstractScene&)> callback,
169 ::AbstractScene const* ignoreScreen
170 ) = 0;
171
172 virtual void forEachAlwaysAcceptInputScreenWithTop(::brstd::function_ref<void(::AbstractScene&)> callback) = 0;
173
174 virtual void pushScreenWithRouteAction(
175 ::std::shared_ptr<::AbstractScene> newScreen,
176 ::OreUI::RouteAction const& routeAction
177 ) = 0;
178
179 virtual void popScreenWithRouteAction(::OreUI::RouteAction const& routeAction) = 0;
180
181 virtual void scheduleRouteAction(::OreUI::RouteAction const& routeAction) = 0;
182
183 virtual void pushScreen(::std::shared_ptr<::AbstractScene> newScreen, bool flush) = 0;
184
185 virtual void schedulePopScreen(int totalPopNumber) = 0;
186
187 virtual void schedulePopScreenWithExpectedNames(::std::vector<::std::string> const& expectedScreenNames) = 0;
188
189 virtual void flushStack(::ISceneStack::FlushMode mode, ::std::function<void()> postFlushCallback) = 0;
190
191 virtual void deferUpdatesUntilNextTick() = 0;
192
193 virtual ::std::optional<uint64> getFirstSceneIndexOfSceneType(::ui::SceneType sceneType) const = 0;
194
195 virtual bool popScreensBackTo(::ui::SceneType const sceneType) = 0;
196
197 virtual bool popScreensBackToFirstInstanceOf(::ui::SceneType const sceneType) = 0;
198
199 virtual bool popTopScreensOfType(::ui::SceneType const sceneType) = 0;
200
201 virtual bool update() = 0;
202
203 virtual void resetScreenChangeDirtyFlag() = 0;
204
205 virtual bool hasChangedThisFrame() const = 0;
206
207 virtual bool isEmpty() const = 0;
208
209 virtual uint64 getSize() const = 0;
210
211 virtual void setScreenTickingFlag(bool screenIsTicking) = 0;
212
213 virtual bool getScreenTickingFlag() const = 0;
214
215 virtual ::ui::SceneType getNonTerminatingSceneType() const = 0;
216
217 virtual ::std::vector<::std::string> getScreenNames() const = 0;
218
219 virtual ::std::vector<::std::string> getScreenTelemetryNames() const = 0;
220
221 virtual ::std::string getScreenName() const = 0;
222
223 virtual ::std::string getScreenTelemetry() const = 0;
224
225 virtual ::std::string const& getLastPoppedScreenName() const = 0;
226
227 virtual void handleLicenseChanged() = 0;
228
229 virtual void onGameEventNotification(::ui::GameEventNotification notification) = 0;
230
231 virtual ::AbstractScene* getTopScene() = 0;
232
233 virtual ::AbstractScene const* getTopScene() const = 0;
234
235 virtual ::std::shared_ptr<::AbstractScene> getTopSceneShared() const = 0;
236
237 virtual ::AbstractScene* getActiveScene() = 0;
238
239 virtual ::AbstractScene const* getActiveScene() const = 0;
240
241 virtual ::std::shared_ptr<::AbstractScene> getSharedNonTerminatingActiveScene() = 0;
242
243 virtual ::std::shared_ptr<::AbstractScene const> const getSharedNonTerminatingActiveScene() const = 0;
244
245 virtual ::gsl::span<::ISceneStack::SceneElement const> getScreenStackView() const = 0;
246
247 virtual ::std::vector<::ISceneStack::PendingSceneStackChange> getPendingSceneStackChanges() const = 0;
248
249 virtual int getScheduledPopCount() const = 0;
250
251 virtual bool isScreenReplaceable() const = 0;
252
253 virtual void handleTextChar(::std::string const& inputUtf8) = 0;
254
255 virtual void setBufferTextCharEvents(bool pushTextCharEvents) = 0;
256
257 virtual bool isBufferingTextCharEvents() const = 0;
258
259 virtual bool isOnSceneStack(::ui::SceneType sceneType) const = 0;
260
261 virtual bool isOnSceneStack(::std::string const& screenName) const = 0;
262
263 virtual ::SceneStackProxy* getProxy() = 0;
264
265 virtual bool hasScheduledScreens() const = 0;
266
267 virtual bool hasScheduledEvents() const = 0;
268
269 virtual void setScreenThreshold(::ScreenThreshold const& screenThreshold) = 0;
270
271 virtual ::Bedrock::PubSub::Subscription registerSceneStackDestroyedListener(::std::function<void()> callback) = 0;
272 // NOLINTEND
273};
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