LeviLamina
Loading...
Searching...
No Matches
Scene.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/SceneState.h"
9#include "mc/client/gui/oreui/interface/IScene.h"
10#include "mc/client/gui/oreui/interface/RouteMode.h"
11#include "mc/client/gui/oreui/interface/ViewId.h"
12#include "mc/client/gui/oreui/routing/RouterAction.h"
13#include "mc/client/gui/screens/AbstractScene.h"
14#include "mc/client/renderer/screen/EyeRenderingModeBit.h"
15#include "mc/deps/core/utility/NonOwnerPointer.h"
16#include "mc/deps/core/utility/pub_sub/Subscription.h"
17#include "mc/deps/input/InputMode.h"
18#include "mc/deps/input/TextboxTextUpdateReason.h"
19#include "mc/deps/input/enums/ButtonState.h"
20#include "mc/deps/input/enums/DirectionId.h"
21#include "mc/deps/input/enums/FocusImpact.h"
22#include "mc/deps/input/enums/RawInputType.h"
23
24// auto generated forward declare list
25// clang-format off
28class CachedScenes;
30class RectangleArea;
31class ScreenContext;
32class TaskGroup;
35struct ScreenSizeData;
38namespace OreUI { class IView; }
39namespace OreUI { class IViewProvider; }
40namespace OreUI { class RouteModeInputHandler; }
41namespace OreUI { class Router; }
42namespace OreUI { class RouterLocation; }
43namespace OreUI::Debug { class ISceneDataProvider; }
44// clang-format on
45
46namespace OreUI {
47
48class Scene : public ::AbstractScene, public ::OreUI::IScene {
49public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<4, 4, ::OreUI::ViewId const> mViewId;
53 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::OreUI::IViewProvider>> mViewProvider;
54 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::OreUI::IView>> mView;
55 ::ll::TypedStorage<8, 64, ::std::function<void()>> mOnLoadFailedCallback;
56 ::ll::TypedStorage<8, 32, ::std::string> mCurrentRoute;
57 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::OreUI::RouteModeInputHandler>> mRouteModeInputHandler;
58 ::ll::TypedStorage<1, 1, ::OreUI::SceneState> mState;
59 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnRouteChangedSubscription;
60 ::ll::TypedStorage<4, 8, ::glm::vec2> mGamepadCursorPosition;
61 ::ll::TypedStorage<2, 2, short> mCurrentPointerPositionX;
62 ::ll::TypedStorage<2, 2, short> mCurrentPointerPositionY;
63 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::AbstractScreenSetupCleanupStrategy>> mScreenSetupCleanup;
64 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AbstractSceneProxy>> mProxy;
65 // NOLINTEND
66
67public:
68 // prevent constructor by default
69 Scene();
70
71public:
72 // virtual functions
73 // NOLINTBEGIN
74 virtual ~Scene() /*override*/;
75
76 virtual void onCreation() /*override*/;
77
78 virtual void init(::ScreenSizeData const&) /*override*/;
79
80 virtual void setSize(::ScreenSizeData const& screenSizeData) /*override*/;
81
82 virtual void onSetKeyboardHeight(float) /*override*/;
83
84 virtual ::std::vector<::RectangleArea> getInputAreas() const /*override*/;
85
86 virtual void onInternetUpdate() /*override*/;
87
88 virtual void onFocusGained() /*override*/;
89
90 virtual void onFocusLost() /*override*/;
91
92 virtual void terminate() /*override*/;
93
94 virtual void onLeave() /*override*/;
95
96 virtual void onGameEventNotification(::ui::GameEventNotification) /*override*/;
97
98 virtual void leaveScreen() /*override*/;
99
100 virtual void preFrameTick() /*override*/;
101
102 virtual void tick(int, int) /*override*/;
103
104 virtual void frameUpdate(::MinecraftUIFrameUpdateContext&) /*override*/;
105
106 virtual void applyInput(float) /*override*/;
107
108 virtual void preRenderUpdate(::ScreenContext&) /*override*/;
109
110 virtual void prepareFrame(::ScreenContext&) /*override*/;
111
112 virtual void render(::ScreenContext& screenContext, ::FrameRenderObject const&) /*override*/;
113
114 virtual void postRenderUpdate(::ScreenContext&) /*override*/;
115
116 virtual void handleInputModeChanged(::InputMode) /*override*/;
117
118 virtual void handleButtonPress(uint, ::FocusImpact) /*override*/;
119
120 virtual void handleButtonRelease(uint, ::FocusImpact) /*override*/;
121
122 virtual void handleRawInputEvent(int, ::RawInputType, ::ButtonState, bool) /*override*/;
123
124 virtual bool handlePointerLocation(::PointerLocationEventData const&, ::FocusImpact) /*override*/;
125
126 virtual void handlePointerPressed(bool) /*override*/;
127
128 virtual void handleDirection(::DirectionId, float, float, ::FocusImpact) /*override*/;
129
130 virtual void handleTextChar(::std::string const&, ::FocusImpact) /*override*/;
131
132 virtual void handleTouchPadTouch(::TouchPadTouchEventData const&, ::FocusImpact) /*override*/;
133
134 virtual void setTextboxText(::std::string const&, ::TextboxTextUpdateReason) /*override*/;
135
136 virtual void onKeyboardDismissed() /*override*/;
137
138 virtual void handleLicenseChanged() /*override*/;
139
140 virtual bool renderGameBehind() const /*override*/;
141
142 virtual bool absorbsInput() const /*override*/;
143
144 virtual bool closeOnPlayerHurt() const /*override*/;
145
146 virtual bool useCustomPocketToast() const /*override*/;
147
148 virtual bool isModal() const /*override*/;
149
150 virtual bool isEditorMode() const /*override*/;
151
152 virtual bool isShowingMenu() const /*override*/;
153
154 virtual bool shouldStealMouse() const /*override*/;
155
156 virtual bool screenIsNotFlushable() const /*override*/;
157
158 virtual bool alwaysAcceptsInput() const /*override*/;
159
160 virtual bool screenDrawsLast() const /*override*/;
161
162 virtual bool isPlayScreen() const /*override*/;
163
164 virtual bool renderOnlyWhenTopMost() const /*override*/;
165
166 virtual bool lowFreqRendering() const /*override*/;
167
168 virtual bool ignoreAsTop() const /*override*/;
169
170 virtual bool shouldBeSkippedInAutomation() const /*override*/;
171
172 virtual int getWidth() /*override*/;
173
174 virtual int getHeight() /*override*/;
175
176 virtual void reload() /*override*/;
177
178 virtual ::EyeRenderingModeBit getEyeRenderingMode() const /*override*/;
179
180 virtual ::ui::SceneType getSceneType() const /*override*/;
181
182 virtual ::std::string getScreenName() const /*override*/;
183
184 virtual bool equalsScreenName(::std::string_view comparison) const /*override*/;
185
186 virtual bool containsScreenNameSubstring(::std::string_view substring) const /*override*/;
187
188 virtual ::std::string getRawScreenName() const /*override*/;
189
190 virtual ::std::string getRoute() const /*override*/;
191
192 virtual ::std::string getScreenTelemetryName() const /*override*/;
193
194 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>&) const /*override*/;
195
196 virtual int getScreenVersion() const /*override*/;
197
198 virtual void processBufferedTextCharEvents(::std::vector<::TextCharEventData> const&) /*override*/;
199
200 virtual bool getShouldSendEvents() /*override*/;
201
202 virtual void setShouldSendEvents(bool) /*override*/;
203
204 virtual bool getWantsTextOnly() /*override*/;
205
206 virtual void setWantsTextOnly(bool) /*override*/;
207
208 virtual void onDelete(::CachedScenes&, ::TaskGroup&) /*override*/;
209
210 virtual bool isGamepadCursorEnabled() const /*override*/;
211
212 virtual bool isGamepadDeflectionModeEnabled() const /*override*/;
213
214 virtual ::glm::vec2 const& getGamepadCursorPosition() const /*override*/;
215
216 virtual void cleanInputComponents() /*override*/;
217
218 virtual ::std::weak_ptr<::AbstractSceneProxy> getProxy() /*override*/;
219
220 virtual bool canBePushed() const /*override*/;
221
222 virtual bool canBePopped() const /*override*/;
223
224 virtual bool canBeTransitioned() const /*override*/;
225
226 virtual void onScreenExit(bool, bool, ::std::shared_ptr<::AbstractScene>) /*override*/;
227
228 virtual void onScreenEntrance(bool, bool) /*override*/;
229
230 virtual bool isEntering() const /*override*/;
231
232 virtual bool isExiting() const /*override*/;
233
234 virtual void schedulePop() /*override*/;
235
236 virtual bool isTerminating() const /*override*/;
237
238 virtual bool loadScreenImmediately() const /*override*/;
239
240 virtual bool forceUpdateActiveSceneStackWhenPushed() const /*override*/;
241
242 virtual ::RectangleArea getAreaOfControlByName(::std::string const&) const /*override*/;
243
244 virtual bool hasFinishedLoading() const /*override*/;
245
246 virtual void sendScreenEvent(::std::string const& eventName, ::std::string const& eventData) /*override*/;
247
248 virtual void setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&) /*override*/;
249
250 virtual ::Bedrock::NonOwnerPointer<::OreUI::Debug::ISceneDataProvider const> getDebugDataProvider() const
251 /*override*/;
252
253 virtual void onLoadFailed(char const*, char const*) /*override*/;
254
255 virtual void onViewReused() /*override*/;
256
257 virtual void onReusedViewReleased() /*override*/;
258
259 virtual bool isInputEnabled() const /*override*/;
260 // NOLINTEND
261
262public:
263 // member functions
264 // NOLINTBEGIN
265 MCAPI Scene(
266 ::OreUI::ViewId viewId,
267 ::Bedrock::NotNullNonOwnerPtr<::OreUI::IViewProvider> viewProvider,
268 ::OreUI::Router& router,
269 ::OreUI::RouteMode routeMode,
270 ::std::function<void()> onLoadFailedCallback,
271 ::Bedrock::NotNullNonOwnerPtr<::OreUI::RouteModeInputHandler> routeModeInputHandler
272 );
273
274 MCAPI bool _isSameScene(::std::optional<::OreUI::RouterLocation> const& currentLocation) const;
275
276 MCAPI void _updateRouteAndRouteMode(
277 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
278 ::std::optional<::OreUI::RouterLocation> const& currentLocation
279 );
280
281 MCAPI void onRouteChanged(
282 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
283 ::std::optional<::OreUI::RouterLocation> const& currentLocation,
284 ::OreUI::RouterAction
285 );
286
287 MCAPI void setScreenSetupCleanup(::std::unique_ptr<::AbstractScreenSetupCleanupStrategy> strategy);
288 // NOLINTEND
289
290public:
291 // constructor thunks
292 // NOLINTBEGIN
293 MCAPI void* $ctor(
294 ::OreUI::ViewId viewId,
295 ::Bedrock::NotNullNonOwnerPtr<::OreUI::IViewProvider> viewProvider,
296 ::OreUI::Router& router,
297 ::OreUI::RouteMode routeMode,
298 ::std::function<void()> onLoadFailedCallback,
299 ::Bedrock::NotNullNonOwnerPtr<::OreUI::RouteModeInputHandler> routeModeInputHandler
300 );
301 // NOLINTEND
302
303public:
304 // destructor thunk
305 // NOLINTBEGIN
306 MCAPI void $dtor();
307 // NOLINTEND
308
309public:
310 // virtual function thunks
311 // NOLINTBEGIN
312 MCFOLD void $onCreation();
313
314 MCFOLD void $init(::ScreenSizeData const&);
315
316 MCAPI void $setSize(::ScreenSizeData const& screenSizeData);
317
318 MCFOLD void $onSetKeyboardHeight(float);
319
320 MCFOLD ::std::vector<::RectangleArea> $getInputAreas() const;
321
322 MCFOLD void $onInternetUpdate();
323
324 MCFOLD void $onFocusGained();
325
326 MCAPI void $onFocusLost();
327
328 MCFOLD void $terminate();
329
330 MCFOLD void $onLeave();
331
332 MCFOLD void $onGameEventNotification(::ui::GameEventNotification);
333
334 MCFOLD void $leaveScreen();
335
336 MCFOLD void $preFrameTick();
337
338 MCFOLD void $tick(int, int);
339
340 MCFOLD void $frameUpdate(::MinecraftUIFrameUpdateContext&);
341
342 MCFOLD void $applyInput(float);
343
344 MCFOLD void $preRenderUpdate(::ScreenContext&);
345
346 MCFOLD void $prepareFrame(::ScreenContext&);
347
348 MCAPI void $render(::ScreenContext& screenContext, ::FrameRenderObject const&);
349
350 MCFOLD void $postRenderUpdate(::ScreenContext&);
351
352 MCFOLD void $handleInputModeChanged(::InputMode);
353
354 MCFOLD void $handleButtonPress(uint, ::FocusImpact);
355
356 MCFOLD void $handleButtonRelease(uint, ::FocusImpact);
357
358 MCFOLD void $handleRawInputEvent(int, ::RawInputType, ::ButtonState, bool);
359
360 MCFOLD bool $handlePointerLocation(::PointerLocationEventData const&, ::FocusImpact);
361
362 MCFOLD void $handlePointerPressed(bool);
363
364 MCFOLD void $handleDirection(::DirectionId, float, float, ::FocusImpact);
365
366 MCFOLD void $handleTextChar(::std::string const&, ::FocusImpact);
367
368 MCFOLD void $handleTouchPadTouch(::TouchPadTouchEventData const&, ::FocusImpact);
369
370 MCFOLD void $setTextboxText(::std::string const&, ::TextboxTextUpdateReason);
371
372 MCFOLD void $onKeyboardDismissed();
373
374 MCFOLD void $handleLicenseChanged();
375
376 MCFOLD bool $renderGameBehind() const;
377
378 MCAPI bool $absorbsInput() const;
379
380 MCFOLD bool $closeOnPlayerHurt() const;
381
382 MCFOLD bool $useCustomPocketToast() const;
383
384 MCFOLD bool $isModal() const;
385
386 MCFOLD bool $isEditorMode() const;
387
388 MCAPI bool $isShowingMenu() const;
389
390 MCAPI bool $shouldStealMouse() const;
391
392 MCFOLD bool $screenIsNotFlushable() const;
393
394 MCFOLD bool $alwaysAcceptsInput() const;
395
396 MCFOLD bool $screenDrawsLast() const;
397
398 MCFOLD bool $isPlayScreen() const;
399
400 MCFOLD bool $renderOnlyWhenTopMost() const;
401
402 MCFOLD bool $lowFreqRendering() const;
403
404 MCAPI bool $ignoreAsTop() const;
405
406 MCFOLD bool $shouldBeSkippedInAutomation() const;
407
408 MCAPI int $getWidth();
409
410 MCAPI int $getHeight();
411
412 MCFOLD void $reload();
413
414 MCAPI ::EyeRenderingModeBit $getEyeRenderingMode() const;
415
416 MCFOLD ::ui::SceneType $getSceneType() const;
417
418 MCAPI ::std::string $getScreenName() const;
419
420 MCAPI bool $equalsScreenName(::std::string_view comparison) const;
421
422 MCAPI bool $containsScreenNameSubstring(::std::string_view substring) const;
423
424 MCAPI ::std::string $getRawScreenName() const;
425
426 MCFOLD ::std::string $getRoute() const;
427
428 MCFOLD ::std::string $getScreenTelemetryName() const;
429
430 MCFOLD void $addEventProperties(::std::unordered_map<::std::string, ::std::string>&) const;
431
432 MCFOLD int $getScreenVersion() const;
433
434 MCFOLD void $processBufferedTextCharEvents(::std::vector<::TextCharEventData> const&);
435
436 MCFOLD bool $getShouldSendEvents();
437
438 MCFOLD void $setShouldSendEvents(bool);
439
440 MCFOLD bool $getWantsTextOnly();
441
442 MCFOLD void $setWantsTextOnly(bool);
443
444 MCFOLD void $onDelete(::CachedScenes&, ::TaskGroup&);
445
446 MCFOLD bool $isGamepadCursorEnabled() const;
447
448 MCFOLD bool $isGamepadDeflectionModeEnabled() const;
449
450 MCFOLD ::glm::vec2 const& $getGamepadCursorPosition() const;
451
452 MCFOLD void $cleanInputComponents();
453
454 MCAPI ::std::weak_ptr<::AbstractSceneProxy> $getProxy();
455
456 MCFOLD bool $canBePushed() const;
457
458 MCFOLD bool $canBePopped() const;
459
460 MCAPI bool $canBeTransitioned() const;
461
462 MCAPI void $onScreenExit(bool, bool, ::std::shared_ptr<::AbstractScene>);
463
464 MCAPI void $onScreenEntrance(bool, bool);
465
466 MCFOLD bool $isEntering() const;
467
468 MCAPI bool $isExiting() const;
469
470 MCFOLD void $schedulePop();
471
472 MCFOLD bool $isTerminating() const;
473
474 MCFOLD bool $loadScreenImmediately() const;
475
476 MCFOLD bool $forceUpdateActiveSceneStackWhenPushed() const;
477
478 MCFOLD ::RectangleArea $getAreaOfControlByName(::std::string const&) const;
479
480 MCAPI bool $hasFinishedLoading() const;
481
482 MCAPI void $sendScreenEvent(::std::string const& eventName, ::std::string const& eventData);
483
484 MCFOLD void $setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&);
485
486 MCFOLD ::Bedrock::NonOwnerPointer<::OreUI::Debug::ISceneDataProvider const> $getDebugDataProvider() const;
487
488 MCAPI void $onLoadFailed(char const*, char const*);
489
490 MCAPI void $onViewReused();
491
492 MCAPI void $onReusedViewReleased();
493
494 MCAPI bool $isInputEnabled() const;
495 // NOLINTEND
496
497public:
498 // vftables
499 // NOLINTBEGIN
500 MCNAPI static void** $vftableForAbstractScene();
501
502 MCNAPI static void** $vftableForIScene();
503 // NOLINTEND
504};
505
506} // namespace OreUI
Definition AbstractSceneProxy.h:5
Definition AbstractScreenSetupCleanupStrategy.h:5
Definition CachedScenes.h:5
Definition MinecraftUIFrameUpdateContext.h:5
Definition ISceneDataProvider.h:7
Definition IViewProvider.h:7
Definition IView.h:7
Definition RouteModeInputHandler.h:7
Definition RouterLocation.h:7
Definition Router.h:7
Definition Scene.h:7
static MCAPI void ** $vftableForIScene()
static MCAPI void ** $vftableForAbstractScene()
Definition RectangleArea.h:5
Definition ScreenContext.h:5
Definition TaskGroup.h:55
Definition FrameRenderObject.h:5
Definition PointerLocationEventData.h:5
Definition ScreenSizeData.h:5
Definition TextCharEventData.h:5
Definition TouchPadTouchEventData.h:5