LeviLamina
Loading...
Searching...
No Matches
ScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/DirtyFlag.h"
7#include "mc/client/gui/GameEventNotification.h"
8#include "mc/client/gui/SceneType.h"
9#include "mc/client/gui/ViewRequest.h"
10#include "mc/client/gui/screens/ScreenViewCommand.h"
11#include "mc/client/gui/screens/interfaces/IScreenController.h"
12#include "mc/deps/input/enums/ButtonState.h"
13#include "mc/platform/brstd/move_only_function.h"
14
15// auto generated forward declare list
16// clang-format off
17class BlockPos;
19class StringHash;
20class TaskGroup;
21class TaskResult;
22class UIPropertyBag;
23struct ActorUniqueID;
26struct ItemRendererData;
29struct ScreenEvent;
33namespace Json { class Value; }
34namespace mce { class Color; }
35// clang-format on
36
38public:
39 // ScreenController inner types declare
40 // clang-format off
42 // clang-format on
43
44 // ScreenController inner types define
45 enum class PreviousButtonStateRequirement : int {
46 Any = 0,
47 Down = 1,
48 Up = 2,
49 NotDown = 3,
50 NotUp = 4,
51 };
52
53 enum class SliderChangeType : int {
54 AnyChange = 0,
55 NotFinalized = 1,
56 Finalized = 2,
57 };
58
60
61 using FocusMoveEventHandlerCallback =
62 ::brstd::move_only_function<::ui::ViewRequest(::FocusMoveScreenEventData&) const>;
63
64 using InputModeChangedEventHandlerCallback =
65 ::brstd::move_only_function<::ui::ViewRequest(::InputModeChangeScreenEventData&) const>;
66
67 using PointerHeldEventHandlerCallback =
68 ::brstd::move_only_function<::ui::ViewRequest(::PointerHeldScreenEventData&) const>;
69
70 using ButtonEventHandlerCallback = ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>;
71
72 using TextEventHandlerCallback =
73 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>;
74
75 using ToggleChangeEventHandlerCallback =
76 ::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const>;
77
78 using TextEditSelectedStateChangeEventHandlerCallback =
79 ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const>;
80
81 using SliderChangeEventHandlerCallback = ::brstd::move_only_function<::ui::ViewRequest(int, float) const>;
82
83 using AnimationEventHandlerCallback = ::brstd::move_only_function<::ui::ViewRequest() const>;
84
85 using RawInputEventHandlerCallback =
86 ::brstd::move_only_function<::ui::ViewRequest(::RawInputScreenEventData&) const>;
87
88 using ClippedCollectionEventHandlerCallback =
89 ::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const>;
90
91 using ClipStateChangeEventHandlerCallback =
92 ::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const>;
93
94 using CustomRendererEventHandlerCallback = ::brstd::move_only_function<::ui::ViewRequest() const>;
95
96 using BindPredicate = ::brstd::move_only_function<bool() const>;
97
98 using BindStringCallback = ::brstd::move_only_function<::std::string() const>;
99
100 using BindBoolCallback = ::brstd::move_only_function<bool() const>;
101
102 using BindIntCallback = ::brstd::move_only_function<int() const>;
103
104 using BindFloatCallback = ::brstd::move_only_function<float() const>;
105
106 using BindGridSizeCallback = ::brstd::move_only_function<::glm::ivec2() const>;
107
108 using BindGlobalGridSizeCallback = ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&) const>;
109
110 using BindColorCallback = ::brstd::move_only_function<::mce::Color() const>;
111
112 using BindColorWithBagCallback = ::brstd::move_only_function<::mce::Color(::UIPropertyBag&) const>;
113
114 using BindCollectionPredicate = ::brstd::move_only_function<bool(int) const>;
115
116 using BindStringForCollectionCallback = ::brstd::move_only_function<::std::string(int) const>;
117
118 using BindBoolForCollectionCallback = ::brstd::move_only_function<bool(int) const>;
119
120 using BindFloatForCollectionCallback = ::brstd::move_only_function<float(int) const>;
121
122 using BindIntForCollectionCallback = ::brstd::move_only_function<int(int) const>;
123
124 using BindColorForCollectionCallback = ::brstd::move_only_function<::mce::Color(int) const>;
125
126 using BindAnyCollectionPredicate = ::brstd::move_only_function<bool(::std::string const&, int) const>;
127
128 using BindItemDataForAnyCollectionCallback =
129 ::brstd::move_only_function<::ItemRendererData(::std::string const&, int) const>;
130
131 using BindStringForAnyCollectionCallback =
132 ::brstd::move_only_function<::std::string(::std::string const&, int) const>;
133
134 using BindBoolForAnyCollectionCallback = ::brstd::move_only_function<bool(::std::string const&, int) const>;
135
136 using BindIntForAnyCollectionCallback = ::brstd::move_only_function<int(::std::string const&, int) const>;
137
138 using BindFloatForAnyCollectionCallback = ::brstd::move_only_function<float(::std::string const&, int) const>;
139
140 using BindDoubleForAnyCollectionCallback = ::brstd::move_only_function<double(::std::string const&, int) const>;
141
142 using BindForAnyCollectionCallback =
143 ::brstd::move_only_function<void(int, ::std::string const&, ::UIPropertyBag&) const>;
144
145 using BindForCollectionCallback =
146 ::brstd::move_only_function<void(::std::string const&, int, ::std::string const&, ::UIPropertyBag&) const>;
147
148 using BindForGlobalCallback = ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&) const>;
149
150 using ButtonEventCallbackKey = ::std::tuple<uint, ::ButtonState>;
151
152 using ButtonEventCallbackInfo = ::std::tuple<
153 ::ScreenController::PreviousButtonStateRequirement,
154 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>;
155
156 using ButtonEventCallbackInfoVector = ::std::vector<::std::tuple<
157 ::ScreenController::PreviousButtonStateRequirement,
158 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>;
159
160 using ButtonEventCallbackMap = ::std::unordered_map<
161 ::std::tuple<uint, ::ButtonState>,
162 ::std::vector<::std::tuple<
163 ::ScreenController::PreviousButtonStateRequirement,
164 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>,
165 ::ScreenController::ButtonEventCallbackKeyHasher,
166 ::std::equal_to<::std::tuple<uint, ::ButtonState>>>;
167
168 using ButtonInteractedEventCallbackVector =
169 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>;
170
171 using ButtonInteractedEventCallbackMap = ::std::
172 unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>;
173
174 using ToggleChangeEventCallbackVector =
175 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const>>;
176
177 using ToggleChangeEventCallbackMap = ::std::unordered_map<
178 uint,
179 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const>>>;
180
181 using TextEditSelectedStateChangeEventCallbackVector =
182 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const>>;
183
184 using TextEditSelectedStateChangeEventCallbackMap = ::std::unordered_map<
185 uint,
186 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const>>>;
187
188 using SliderChangeEventHandlerCallbackInfo = ::std::
189 tuple<::ScreenController::SliderChangeType, ::brstd::move_only_function<::ui::ViewRequest(int, float) const>>;
190
191 using SliderChangeEventCallbackVector = ::std::vector<::std::tuple<
192 ::ScreenController::SliderChangeType,
193 ::brstd::move_only_function<::ui::ViewRequest(int, float) const>>>;
194
195 using SliderChangeEventCallbackMap = ::std::unordered_map<
196 uint,
197 ::std::vector<::std::tuple<
198 ::ScreenController::SliderChangeType,
199 ::brstd::move_only_function<::ui::ViewRequest(int, float) const>>>>;
200
201 using TextEventHandlerCallbackInfo =
202 ::std::tuple<bool, ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>>;
203
204 using TextEventHandlerCallbackVector = ::std::vector<
205 ::std::tuple<bool, ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>>>;
206
207 using TextEventHandlerCallbackMap = ::std::unordered_map<
208 uint,
209 ::std::vector<
210 ::std::tuple<bool, ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>>>>;
211
212 using AnimationEventHandlerCallbackVector = ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>;
213
214 using AnimationEventHandlerCallbackMap =
215 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>;
216
217 using ClippedCollectionEventHandlerCallbackVector =
218 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const>>;
219
220 using ClippedCollectionEventHandlerCallbackMap = ::std::unordered_map<
221 uint,
222 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const>>>;
223
224 using ClipStateChangeHandlerCallbackVector =
225 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const>>;
226
227 using ClipStateChangeEventHandlerCallbackMap = ::std::unordered_map<
228 uint,
229 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const>>>;
230
231 using CustomRendererEventHandlerCallbackVector =
232 ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>;
233
234 using CustomRendererEventHandlerCallbackMap =
235 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>;
236
237public:
238 // member variables
239 // NOLINTBEGIN
240 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&, ::UIPropertyBag const&)>>
241 mControlCreateCallback;
242 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&, ::std::string const&)>>
243 mControlDestroyCallback;
244 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&)>> mControlDestroyAllCallback;
245 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&)>> mScreenViewSendManualInputEventCallback;
246 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScreenControllerProxy>> mProxy;
247 ::ll::TypedStorage<1, 1, bool> mCreateInitialized;
248 ::ll::TypedStorage<1, 1, bool> mInitialized;
249 ::ll::TypedStorage<1, 1, bool> mUsesErrorInfo;
250 ::ll::TypedStorage<8, 1728, ::ScreenViewCommand> mScreenViewCommand;
251 ::ll::TypedStorage<1, 1, bool> mIsScrollingLocked;
252 ::ll::TypedStorage<
253 8,
254 64,
255 ::std::unordered_map<
256 ::std::tuple<uint, ::ButtonState>,
257 ::std::vector<::std::tuple<
258 ::ScreenController::PreviousButtonStateRequirement,
259 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>,
260 ::ScreenController::ButtonEventCallbackKeyHasher,
261 ::std::equal_to<::std::tuple<uint, ::ButtonState>>>>
262 mButtonEventCallbackMap;
263 ::ll::TypedStorage<
264 8,
265 64,
266 ::std::
267 unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>>
268 mButtonInteractedEventCallbackMap;
269 ::ll::TypedStorage<8, 64, ::brstd::move_only_function<::ui::ViewRequest(::RawInputScreenEventData&) const>>
270 mRawInputEventHandlerCallback;
271 ::ll::TypedStorage<
272 8,
273 24,
274 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::FocusMoveScreenEventData&) const>>>
275 mFocusMoveEventCallbacks;
276 ::ll::TypedStorage<
277 8,
278 24,
279 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::InputModeChangeScreenEventData&) const>>>
280 mInputModeChangedEventCallbacks;
281 ::ll::TypedStorage<
282 8,
283 24,
284 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::PointerHeldScreenEventData&) const>>>
285 mPointerHeldEventCallbacks;
286 ::ll::TypedStorage<
287 8,
288 64,
289 ::std::unordered_map<
290 uint,
291 ::std::vector<::std::tuple<
292 bool,
293 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>>>>>
294 mTextEditEventCallbackMap;
295 ::ll::TypedStorage<
296 8,
297 64,
298 ::std::unordered_map<
299 uint,
300 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const>>>>
301 mToggleChangeEventCallbackMap;
302 ::ll::TypedStorage<
303 8,
304 64,
305 ::std::unordered_map<
306 uint,
307 ::std::vector<
308 ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const>>>>
309 mTextEditSelectedStateChangeEventCallbackMap;
310 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ScreenController>>> mSubControllers;
311 ::ll::TypedStorage<
312 8,
313 64,
314 ::std::unordered_map<
315 uint,
316 ::std::vector<::std::tuple<
317 ::ScreenController::SliderChangeType,
318 ::brstd::move_only_function<::ui::ViewRequest(int, float) const>>>>>
319 mSliderChangeEventCallbackMap;
320 ::ll::TypedStorage<
321 8,
322 64,
323 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>>
324 mAnimationEventCallbackMap;
325 ::ll::TypedStorage<
326 8,
327 64,
328 ::std::unordered_map<
329 uint,
330 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const>>>>
331 mClippedCollectionEventCallbackMap;
332 ::ll::TypedStorage<
333 8,
334 64,
335 ::std::unordered_map<
336 uint,
337 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const>>>>
338 mClipStateChangeEventCallbackMap;
339 ::ll::TypedStorage<
340 8,
341 64,
342 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>>
343 mCustomRendererEventHandlerCallbackMap;
344 ::ll::TypedStorage<
345 8,
346 64,
347 ::std::unordered_map<uint, ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&)>>>
348 mBindCallbacks;
349 ::ll::TypedStorage<
350 8,
351 64,
352 ::std::unordered_map<uint, ::brstd::move_only_function<void(int, ::std::string const&, ::UIPropertyBag&)>>>
353 mCollectionBindCallbacks;
354 ::ll::TypedStorage<
355 8,
356 64,
357 ::std::unordered_map<
358 uint,
359 ::brstd::move_only_function<void(::std::string const&, int, ::std::string const&, ::UIPropertyBag&)>>>
360 mAnyCollectionBindCallbacks;
361 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
362 // NOLINTEND
363
364public:
365 void registerButtonPressedHandler(
366 uint buttonId,
367 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
368 ) {
369 // A "press" is entering Down, so it must not already have been Down.
370 registerButtonEventHandler(
371 buttonId,
372 ::ButtonState::Down,
373 PreviousButtonStateRequirement::NotDown,
374 std::move(callback)
375 );
376 }
377
378 [[nodiscard]] uint _getNameId(::std::string const& name) const {
379 uint hash = 0x811C9DC5u;
380 for (char const c : name) {
381 hash = (hash ^ c) * 0x01000193u;
382 }
383 return hash;
384 }
385
386public:
387 // prevent constructor by default
388 ScreenController();
389
390public:
391 // virtual functions
392 // NOLINTBEGIN
393 virtual ~ScreenController() /*override*/;
394
395 virtual ::ui::DirtyFlag tick() /*override*/;
396
397 virtual void preFrameTick() /*override*/;
398
399 virtual ::ui::ViewRequest handleEvent(::ScreenEvent& screenEvent) /*override*/;
400
401 virtual ::std::optional<::std::string> getRoute() const /*override*/;
402
403 virtual void setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&) /*override*/;
404
405 virtual void onOpen();
406
407 virtual void queueTitleNarration();
408
409 virtual void onTerminate();
410
411 virtual void onInit();
412
413 virtual void onDelete();
414
415 virtual bool canExit();
416
417 virtual ::ui::ViewRequest tryExit();
418
419 virtual void onCreation();
420
421 virtual void onReload();
422
423 virtual void onLeave();
424
425 virtual void leaveScreen(::std::string const& expectedScreenName);
426
427 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification);
428
429 virtual bool bind(
430 ::std::string const& collectionName,
431 uint collectionNameHash,
432 int collectionIndex,
433 ::std::string const& bindingName,
434 uint bindingNameHash,
435 ::std::string const& bindingNameOverride,
436 ::UIPropertyBag& bag
437 );
438
439 virtual bool bind(
440 ::std::string const& bindingName,
441 uint bindingNameHash,
442 ::std::string const& bindingNameOverride,
443 ::UIPropertyBag& bag
444 );
445
446 virtual void handleLicenseChanged();
447
448 virtual void setAssociatedBlockPos(::BlockPos const& pos);
449
450 virtual void setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
451
452 virtual void setSuspendInput(bool suspendInput);
453
454 virtual void setSuspendDirectionalInput(bool suspendDirectionalInput);
455
456 virtual void setViewCommand(::ScreenViewCommand const& callback);
457
458 virtual void addStaticScreenVars(::Json::Value& globalVars);
459
460 virtual ::std::string getAdditionalScreenInfo() const;
461
462 virtual ::std::string getTelemetryOverride() const;
463
464 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
465
466 virtual ::ui::SceneType getSceneType() const;
467
468 virtual int getScreenVersion() const;
469
470 virtual uint getSceneId() const;
471
472 virtual ::ScreenControllerProxy* getProxy();
473
474 virtual void onEntered();
475
476 virtual void onScreenPushedAbove();
477
478 virtual void onEntering();
479
480 virtual bool _doesScreenHaveExitBehavior() const;
481
482 virtual bool _isContainerScreen() const;
483 // NOLINTEND
484
485public:
486 // member functions
487 // NOLINTBEGIN
488 MCAPI explicit ScreenController(bool useTaskGroup);
489
490 MCAPI ::ui::ViewRequest _handleEvent(::ScreenEvent& screenEvent);
491
492 MCAPI void _registerSubController(::std::shared_ptr<::ScreenController> controller);
493
494 MCAPI void bindBool(
495 ::StringHash const& bindingName,
496 ::brstd::move_only_function<bool() const> callback,
497 ::brstd::move_only_function<bool() const> condition
498 );
499
500 MCAPI void bindBoolForAnyCollection(
501 ::StringHash const& bindingName,
502 ::brstd::move_only_function<bool(::std::string const&, int) const> callback,
503 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
504 );
505
506 MCAPI void bindBoolForCollection(
507 ::StringHash const& collectionName,
508 ::StringHash const& bindingName,
509 ::brstd::move_only_function<bool(int) const> callback,
510 ::brstd::move_only_function<bool(int) const> condition
511 );
512
513 MCAPI void bindColor(
514 ::StringHash const& bindingName,
515 ::brstd::move_only_function<::mce::Color() const> callback,
516 ::brstd::move_only_function<bool() const> condition
517 );
518
519 MCAPI void bindColorForCollection(
520 ::StringHash const& collectionName,
521 ::StringHash const& bindingName,
522 ::brstd::move_only_function<::mce::Color(int) const> callback,
523 ::brstd::move_only_function<bool(int) const> condition
524 );
525
526 MCAPI void bindColorWithPropertyBag(
527 ::StringHash const& bindingName,
528 ::brstd::move_only_function<::mce::Color(::UIPropertyBag&) const> callback,
529 ::brstd::move_only_function<bool() const> condition
530 );
531
532 MCAPI void bindDoubleForAnyCollection(
533 ::StringHash const& bindingName,
534 ::brstd::move_only_function<double(::std::string const&, int) const> callback,
535 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
536 );
537
538 MCAPI void bindFloat(
539 ::StringHash const& bindingName,
540 ::brstd::move_only_function<float() const> callback,
541 ::brstd::move_only_function<bool() const> condition
542 );
543
544 MCAPI void bindFloatForAnyCollection(
545 ::StringHash const& bindingName,
546 ::brstd::move_only_function<float(::std::string const&, int) const> callback,
547 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
548 );
549
550 MCAPI void bindFloatForCollection(
551 ::StringHash const& collectionName,
552 ::StringHash const& bindingName,
553 ::brstd::move_only_function<float(int) const> callback,
554 ::brstd::move_only_function<bool(int) const> condition
555 );
556
557 MCAPI void bindForAnyCollection(
558 ::StringHash const& bindingName,
559 ::brstd::move_only_function<void(int, ::std::string const&, ::UIPropertyBag&) const> callback,
560 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
561 );
562
563 MCAPI void bindForAnyCollection(
564 ::StringHash const& bindingName,
565 ::brstd::move_only_function<void(::std::string const&, int, ::std::string const&, ::UIPropertyBag&) const>
566 callback,
567 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
568 );
569
570 MCAPI void bindForGlobalGridSize(
571 ::StringHash const& bindingName,
572 ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&) const> callback,
573 ::brstd::move_only_function<bool() const> condition
574 );
575
576 MCAPI void bindGridSize(
577 ::StringHash const& bindingName,
578 ::brstd::move_only_function<::glm::ivec2() const> callback,
579 ::brstd::move_only_function<bool() const> condition
580 );
581
582 MCAPI void bindInt(
583 ::StringHash const& bindingName,
584 ::brstd::move_only_function<int() const> callback,
585 ::brstd::move_only_function<bool() const> condition
586 );
587
588 MCAPI void bindIntForAnyCollection(
589 ::StringHash const& bindingName,
590 ::brstd::move_only_function<int(::std::string const&, int) const> callback,
591 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
592 );
593
594 MCAPI void bindIntForCollection(
595 ::StringHash const& collectionName,
596 ::StringHash const& bindingName,
597 ::brstd::move_only_function<int(int) const> callback,
598 ::brstd::move_only_function<bool(int) const> condition
599 );
600
601 MCAPI void bindItemDataForAnyCollection(
602 ::StringHash const& bindingName,
603 ::brstd::move_only_function<::ItemRendererData(::std::string const&, int) const> callback,
604 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
605 );
606
607 MCAPI void bindString(
608 ::StringHash const& bindingName,
609 ::brstd::move_only_function<::std::string() const> callback,
610 ::brstd::move_only_function<bool() const> condition
611 );
612
613 MCAPI void bindStringForAnyCollection(
614 ::StringHash const& bindingName,
615 ::brstd::move_only_function<::std::string(::std::string const&, int) const> callback,
616 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
617 );
618
619 MCAPI void bindStringForCollection(
620 ::StringHash const& collectionName,
621 ::StringHash const& bindingName,
622 ::brstd::move_only_function<::std::string(int) const> callback,
623 ::brstd::move_only_function<bool(int) const> condition
624 );
625
626 MCAPI bool hasFinishedAsyncTasks() const;
627
628 MCAPI void queueAsyncTask(::brstd::move_only_function<::TaskResult()>&& task, ::std::function<void()>&& callback);
629
630 MCAPI void
631 registerAnimationEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const> callback);
632
633 MCAPI void registerButtonEventHandler(
634 uint buttonId,
635 ::ButtonState currentState,
636 ::ScreenController::PreviousButtonStateRequirement previousStateRequirement,
637 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
638 );
639
640 MCAPI void registerButtonInteractedHandler(
641 uint buttonId,
642 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
643 );
644
645 MCAPI void registerClipStateChangeEventHandler(
646 uint eventId,
647 ::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const> callback
648 );
649
650 MCAPI void registerClippedCollectionEventHandler(
651 ::StringHash const& collectionName,
652 ::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const> callback
653 );
654
655 MCAPI void
656 registerCustomRendererEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const> callback);
657
658 MCAPI void registerSliderChangedEventHandler(
659 uint buttonId,
660 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
661 );
662
663 MCAPI void registerSliderFinishedEventHandler(
664 uint buttonId,
665 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
666 );
667
668 MCAPI void registerSliderNotFinishedEventHandler(
669 uint buttonId,
670 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
671 );
672
673 MCAPI void registerTextEditChangedEventHandler(
674 uint buttonId,
675 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
676 );
677
678 MCAPI void registerTextEditFinishedEventHandler(
679 uint buttonId,
680 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
681 );
682
683 MCAPI void registerTextEditSelectedStateChangeEventHandler(
684 uint buttonId,
685 ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const> callback
686 );
687
688 MCAPI void registerTextEventHandler(
689 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
690 );
691
692 MCAPI void registerToggleChangeEventHandler(
693 uint buttonId,
694 ::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const> callback
695 );
696 // NOLINTEND
697
698public:
699 // constructor thunks
700 // NOLINTBEGIN
701 MCAPI void* $ctor(bool useTaskGroup);
702 // NOLINTEND
703
704public:
705 // destructor thunk
706 // NOLINTBEGIN
707 MCAPI void $dtor();
708 // NOLINTEND
709
710public:
711 // virtual function thunks
712 // NOLINTBEGIN
713 MCAPI ::ui::DirtyFlag $tick();
714
715 MCFOLD void $preFrameTick();
716
717 MCAPI ::ui::ViewRequest $handleEvent(::ScreenEvent& screenEvent);
718
719 MCFOLD ::std::optional<::std::string> $getRoute() const;
720
721 MCFOLD void $setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&);
722
723 MCAPI void $onOpen();
724
725 MCAPI void $queueTitleNarration();
726
727 MCFOLD void $onTerminate();
728
729 MCAPI void $onInit();
730
731 MCFOLD void $onDelete();
732
733 MCAPI bool $canExit();
734
735 MCFOLD ::ui::ViewRequest $tryExit();
736
737 MCAPI void $onCreation();
738
739 MCFOLD void $onReload();
740
741 MCAPI void $onLeave();
742
743 MCFOLD void $leaveScreen(::std::string const& expectedScreenName);
744
745 MCFOLD ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
746
747 MCAPI bool $bind(
748 ::std::string const& collectionName,
749 uint collectionNameHash,
750 int collectionIndex,
751 ::std::string const& bindingName,
752 uint bindingNameHash,
753 ::std::string const& bindingNameOverride,
754 ::UIPropertyBag& bag
755 );
756
757 MCAPI bool $bind(
758 ::std::string const& bindingName,
759 uint bindingNameHash,
760 ::std::string const& bindingNameOverride,
761 ::UIPropertyBag& bag
762 );
763
764 MCFOLD void $handleLicenseChanged();
765
766 MCFOLD void $setAssociatedBlockPos(::BlockPos const& pos);
767
768 MCFOLD void $setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
769
770 MCFOLD void $setSuspendInput(bool suspendInput);
771
772 MCFOLD void $setSuspendDirectionalInput(bool suspendDirectionalInput);
773
774 MCAPI void $setViewCommand(::ScreenViewCommand const& callback);
775
776 MCFOLD void $addStaticScreenVars(::Json::Value& globalVars);
777
778 MCFOLD ::std::string $getAdditionalScreenInfo() const;
779
780 MCFOLD ::std::string $getTelemetryOverride() const;
781
782 MCFOLD void $addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
783
784 MCFOLD ::ui::SceneType $getSceneType() const;
785
786 MCFOLD int $getScreenVersion() const;
787
788 MCFOLD uint $getSceneId() const;
789
790 MCFOLD ::ScreenControllerProxy* $getProxy();
791
792 MCFOLD void $onEntered();
793
794 MCFOLD void $onScreenPushedAbove();
795
796 MCFOLD void $onEntering();
797
798 MCFOLD bool $_doesScreenHaveExitBehavior() const;
799
800 MCFOLD bool $_isContainerScreen() const;
801 // NOLINTEND
802};
Definition BlockPos.h:17
Definition IScreenController.h:5
Definition Value.h:16
Definition ScreenControllerProxy.h:5
Definition ScreenController.h:5
Definition StringHash.h:5
Definition TaskGroup.h:86
Definition TaskResult.h:5
Definition UIPropertyBag.h:5
Definition Color.h:13
Definition ActorUniqueID.h:5
Definition FocusMoveScreenEventData.h:5
Definition InputModeChangeScreenEventData.h:5
Definition ItemRendererData.h:5
Definition PointerHeldScreenEventData.h:5
Definition RawInputScreenEventData.h:5
Definition ScreenController.h:17
Definition ScreenEvent.h:5
Definition TextEditScreenEventData.h:5
Definition TextEditSelectedStateChangeEventData.h:5
Definition ToggleChangeEventData.h:5