Skip to content
LeviMC
English
AutoLightDark
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<1, 1, bool> mBindingRefreshRequested;
253 ::ll::TypedStorage<
254 8,
255 64,
256 ::std::unordered_map<
257 ::std::tuple<uint, ::ButtonState>,
258 ::std::vector<::std::tuple<
259 ::ScreenController::PreviousButtonStateRequirement,
260 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>,
261 ::ScreenController::ButtonEventCallbackKeyHasher,
262 ::std::equal_to<::std::tuple<uint, ::ButtonState>>>>
263 mButtonEventCallbackMap;
264 ::ll::TypedStorage<
265 8,
266 64,
267 ::std::
268 unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const>>>>
269 mButtonInteractedEventCallbackMap;
270 ::ll::TypedStorage<8, 64, ::brstd::move_only_function<::ui::ViewRequest(::RawInputScreenEventData&) const>>
271 mRawInputEventHandlerCallback;
272 ::ll::TypedStorage<
273 8,
274 24,
275 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::FocusMoveScreenEventData&) const>>>
276 mFocusMoveEventCallbacks;
277 ::ll::TypedStorage<
278 8,
279 24,
280 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::InputModeChangeScreenEventData&) const>>>
281 mInputModeChangedEventCallbacks;
282 ::ll::TypedStorage<
283 8,
284 24,
285 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::PointerHeldScreenEventData&) const>>>
286 mPointerHeldEventCallbacks;
287 ::ll::TypedStorage<
288 8,
289 64,
290 ::std::unordered_map<
291 uint,
292 ::std::vector<::std::tuple<
293 bool,
294 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const>>>>>
295 mTextEditEventCallbackMap;
296 ::ll::TypedStorage<
297 8,
298 64,
299 ::std::unordered_map<
300 uint,
301 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const>>>>
302 mToggleChangeEventCallbackMap;
303 ::ll::TypedStorage<
304 8,
305 64,
306 ::std::unordered_map<
307 uint,
308 ::std::vector<
309 ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const>>>>
310 mTextEditSelectedStateChangeEventCallbackMap;
311 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ScreenController>>> mSubControllers;
312 ::ll::TypedStorage<
313 8,
314 64,
315 ::std::unordered_map<
316 uint,
317 ::std::vector<::std::tuple<
318 ::ScreenController::SliderChangeType,
319 ::brstd::move_only_function<::ui::ViewRequest(int, float) const>>>>>
320 mSliderChangeEventCallbackMap;
321 ::ll::TypedStorage<
322 8,
323 64,
324 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>>
325 mAnimationEventCallbackMap;
326 ::ll::TypedStorage<
327 8,
328 64,
329 ::std::unordered_map<
330 uint,
331 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const>>>>
332 mClippedCollectionEventCallbackMap;
333 ::ll::TypedStorage<
334 8,
335 64,
336 ::std::unordered_map<
337 uint,
338 ::std::vector<::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const>>>>
339 mClipStateChangeEventCallbackMap;
340 ::ll::TypedStorage<
341 8,
342 64,
343 ::std::unordered_map<uint, ::std::vector<::brstd::move_only_function<::ui::ViewRequest() const>>>>
344 mCustomRendererEventHandlerCallbackMap;
345 ::ll::TypedStorage<
346 8,
347 64,
348 ::std::unordered_map<uint, ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&)>>>
349 mBindCallbacks;
350 ::ll::TypedStorage<
351 8,
352 64,
353 ::std::unordered_map<uint, ::brstd::move_only_function<void(int, ::std::string const&, ::UIPropertyBag&)>>>
354 mCollectionBindCallbacks;
355 ::ll::TypedStorage<
356 8,
357 64,
358 ::std::unordered_map<
359 uint,
360 ::brstd::move_only_function<void(::std::string const&, int, ::std::string const&, ::UIPropertyBag&)>>>
361 mAnyCollectionBindCallbacks;
362 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
363 // NOLINTEND
364
365public:
366 void registerButtonPressedHandler(
367 uint buttonId,
368 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
369 ) {
370 // A "press" is entering Down, so it must not already have been Down.
371 registerButtonEventHandler(
372 buttonId,
373 ::ButtonState::Down,
374 PreviousButtonStateRequirement::NotDown,
375 std::move(callback)
376 );
377 }
378
379 [[nodiscard]] uint _getNameId(::std::string const& name) const {
380 uint hash = 0x811C9DC5u;
381 for (char const c : name) {
382 hash = (hash ^ c) * 0x01000193u;
383 }
384 return hash;
385 }
386
387public:
388 // prevent constructor by default
389 ScreenController();
390
391public:
392 // virtual functions
393 // NOLINTBEGIN
394 virtual ~ScreenController() /*override*/;
395
396 virtual ::ui::DirtyFlag tick() /*override*/;
397
398 virtual void preFrameTick() /*override*/;
399
400 virtual ::ui::ViewRequest handleEvent(::ScreenEvent& screenEvent) /*override*/;
401
402 virtual ::std::optional<::std::string> getRoute() const /*override*/;
403
404 virtual void setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&) /*override*/;
405
406 virtual void onOpen();
407
408 virtual void queueTitleNarration();
409
410 virtual void onTerminate();
411
412 virtual void onInit();
413
414 virtual void onDelete();
415
416 virtual bool canExit();
417
418 virtual ::ui::ViewRequest tryExit();
419
420 virtual void onCreation();
421
422 virtual void onReload();
423
424 virtual void onLeave();
425
426 virtual void leaveScreen(::std::string const& expectedScreenName);
427
428 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification);
429
430 virtual bool bind(
431 ::std::string const& collectionName,
432 uint collectionNameHash,
433 int collectionIndex,
434 ::std::string const& bindingName,
435 uint bindingNameHash,
436 ::std::string const& bindingNameOverride,
437 ::UIPropertyBag& bag
438 );
439
440 virtual bool bind(
441 ::std::string const& bindingName,
442 uint bindingNameHash,
443 ::std::string const& bindingNameOverride,
444 ::UIPropertyBag& bag
445 );
446
447 virtual void handleLicenseChanged();
448
449 virtual void setAssociatedBlockPos(::BlockPos const& pos);
450
451 virtual void setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
452
453 virtual void setSuspendInput(bool suspendInput);
454
455 virtual void setSuspendDirectionalInput(bool suspendDirectionalInput);
456
457 virtual void setViewCommand(::ScreenViewCommand const& callback);
458
459 virtual void addStaticScreenVars(::Json::Value& globalVars);
460
461 virtual ::std::string getAdditionalScreenInfo() const;
462
463 virtual ::std::string getTelemetryOverride() const;
464
465 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
466
467 virtual ::ui::SceneType getSceneType() const;
468
469 virtual int getScreenVersion() const;
470
471 virtual uint getSceneId() const;
472
473 virtual ::ScreenControllerProxy* getProxy();
474
475 virtual void onEntered();
476
477 virtual void onScreenPushedAbove();
478
479 virtual void onEntering();
480
481 virtual bool _doesScreenHaveExitBehavior() const;
482
483 virtual bool _isContainerScreen() const;
484 // NOLINTEND
485
486public:
487 // member functions
488 // NOLINTBEGIN
489 MCAPI explicit ScreenController(bool useTaskGroup);
490
491 MCNAPI ::ui::ViewRequest _handleEvent(::ScreenEvent& screenEvent);
492
493 MCNAPI void _registerSubController(::std::shared_ptr<::ScreenController> controller);
494
495 MCAPI void bindBool(
496 ::StringHash const& bindingName,
497 ::brstd::move_only_function<bool() const> callback,
498 ::brstd::move_only_function<bool() const> condition
499 );
500
501 MCAPI void bindBoolForAnyCollection(
502 ::StringHash const& bindingName,
503 ::brstd::move_only_function<bool(::std::string const&, int) const> callback,
504 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
505 );
506
507 MCAPI void bindBoolForCollection(
508 ::StringHash const& collectionName,
509 ::StringHash const& bindingName,
510 ::brstd::move_only_function<bool(int) const> callback,
511 ::brstd::move_only_function<bool(int) const> condition
512 );
513
514 MCNAPI void bindColor(
515 ::StringHash const& bindingName,
516 ::brstd::move_only_function<::mce::Color() const> callback,
517 ::brstd::move_only_function<bool() const> condition
518 );
519
521 ::StringHash const& collectionName,
522 ::StringHash const& bindingName,
523 ::brstd::move_only_function<::mce::Color(int) const> callback,
524 ::brstd::move_only_function<bool(int) const> condition
525 );
526
528 ::StringHash const& bindingName,
529 ::brstd::move_only_function<::mce::Color(::UIPropertyBag&) const> callback,
530 ::brstd::move_only_function<bool() const> condition
531 );
532
534 ::StringHash const& bindingName,
535 ::brstd::move_only_function<double(::std::string const&, int) const> callback,
536 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
537 );
538
539 MCAPI void bindFloat(
540 ::StringHash const& bindingName,
541 ::brstd::move_only_function<float() const> callback,
542 ::brstd::move_only_function<bool() const> condition
543 );
544
545 MCAPI void bindFloatForAnyCollection(
546 ::StringHash const& bindingName,
547 ::brstd::move_only_function<float(::std::string const&, int) const> callback,
548 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
549 );
550
551 MCAPI void bindFloatForCollection(
552 ::StringHash const& collectionName,
553 ::StringHash const& bindingName,
554 ::brstd::move_only_function<float(int) const> callback,
555 ::brstd::move_only_function<bool(int) const> condition
556 );
557
558 MCAPI void bindForAnyCollection(
559 ::StringHash const& bindingName,
560 ::brstd::move_only_function<void(int, ::std::string const&, ::UIPropertyBag&) const> callback,
561 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
562 );
563
564 MCNAPI void bindForAnyCollection(
565 ::StringHash const& bindingName,
566 ::brstd::move_only_function<void(::std::string const&, int, ::std::string const&, ::UIPropertyBag&) const>
567 callback,
568 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
569 );
570
572 ::StringHash const& bindingName,
573 ::brstd::move_only_function<void(::std::string const&, ::UIPropertyBag&) const> callback,
574 ::brstd::move_only_function<bool() const> condition
575 );
576
577 MCAPI void bindGridSize(
578 ::StringHash const& bindingName,
579 ::brstd::move_only_function<::glm::ivec2() const> callback,
580 ::brstd::move_only_function<bool() const> condition
581 );
582
583 MCNAPI void bindInt(
584 ::StringHash const& bindingName,
585 ::brstd::move_only_function<int() const> callback,
586 ::brstd::move_only_function<bool() const> condition
587 );
588
589 MCAPI void bindIntForAnyCollection(
590 ::StringHash const& bindingName,
591 ::brstd::move_only_function<int(::std::string const&, int) const> callback,
592 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
593 );
594
595 MCAPI void bindIntForCollection(
596 ::StringHash const& collectionName,
597 ::StringHash const& bindingName,
598 ::brstd::move_only_function<int(int) const> callback,
599 ::brstd::move_only_function<bool(int) const> condition
600 );
601
602 MCAPI void bindItemDataForAnyCollection(
603 ::StringHash const& bindingName,
604 ::brstd::move_only_function<::ItemRendererData(::std::string const&, int) const> callback,
605 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
606 );
607
608 MCAPI void bindString(
609 ::StringHash const& bindingName,
610 ::brstd::move_only_function<::std::string() const> callback,
611 ::brstd::move_only_function<bool() const> condition
612 );
613
614 MCAPI void bindStringForAnyCollection(
615 ::StringHash const& bindingName,
616 ::brstd::move_only_function<::std::string(::std::string const&, int) const> callback,
617 ::brstd::move_only_function<bool(::std::string const&, int) const> condition
618 );
619
620 MCAPI void bindStringForCollection(
621 ::StringHash const& collectionName,
622 ::StringHash const& bindingName,
623 ::brstd::move_only_function<::std::string(int) const> callback,
624 ::brstd::move_only_function<bool(int) const> condition
625 );
626
628
629 MCNAPI bool hasFinishedAsyncTasks() const;
630
631 MCNAPI void queueAsyncTask(::brstd::move_only_function<::TaskResult()>&& task, ::std::function<void()>&& callback);
632
633 MCNAPI void
634 registerAnimationEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const> callback);
635
636 MCAPI void registerButtonEventHandler(
637 uint buttonId,
638 ::ButtonState currentState,
639 ::ScreenController::PreviousButtonStateRequirement previousStateRequirement,
640 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
641 );
642
644 uint buttonId,
645 ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag*) const> callback
646 );
647
649 uint eventId,
650 ::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag&) const> callback
651 );
652
654 ::StringHash const& collectionName,
655 ::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag&) const> callback
656 );
657
658 MCNAPI void
659 registerCustomRendererEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const> callback);
660
661 MCAPI void registerSliderChangedEventHandler(
662 uint buttonId,
663 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
664 );
665
667 uint buttonId,
668 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
669 );
670
672 uint buttonId,
673 ::brstd::move_only_function<::ui::ViewRequest(int, float) const> callback
674 );
675
676 MCAPI void registerTextEditChangedEventHandler(
677 uint buttonId,
678 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
679 );
680
681 MCAPI void registerTextEditFinishedEventHandler(
682 uint buttonId,
683 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
684 );
685
687 uint buttonId,
688 ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData&) const> callback
689 );
690
692 ::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData&, int) const> callback
693 );
694
695 MCAPI void registerToggleChangeEventHandler(
696 uint buttonId,
697 ::brstd::move_only_function<::ui::ViewRequest(::ToggleChangeEventData&) const> callback
698 );
699
700 MCNAPI void
701 setControlFactoryCreateCallback(::std::function<void(::std::string const&, ::UIPropertyBag const&)> callback);
702
703 MCNAPI void setControlFactoryDestroyAllCallback(::std::function<void(::std::string const&)> callback);
704
705 MCNAPI void
706 setControlFactoryDestroyCallback(::std::function<void(::std::string const&, ::std::string const&)> callback);
707 // NOLINTEND
708
709public:
710 // constructor thunks
711 // NOLINTBEGIN
712 MCAPI void* $ctor(bool useTaskGroup);
713 // NOLINTEND
714
715public:
716 // destructor thunk
717 // NOLINTBEGIN
718 MCAPI void $dtor();
719 // NOLINTEND
720
721public:
722 // virtual function thunks
723 // NOLINTBEGIN
724 MCAPI ::ui::DirtyFlag $tick();
725
726 MCFOLD void $preFrameTick();
727
728 MCAPI ::ui::ViewRequest $handleEvent(::ScreenEvent& screenEvent);
729
730 MCFOLD ::std::optional<::std::string> $getRoute() const;
731
732 MCFOLD void $setScreenState(::std::vector<::std::pair<::std::string_view, ::std::string_view>> const&);
733
734 MCAPI void $onOpen();
735
736 MCAPI void $queueTitleNarration();
737
738 MCFOLD void $onTerminate();
739
740 MCAPI void $onInit();
741
742 MCFOLD void $onDelete();
743
744 MCAPI bool $canExit();
745
746 MCNAPI ::ui::ViewRequest $tryExit();
747
748 MCAPI void $onCreation();
749
750 MCFOLD void $onReload();
751
752 MCAPI void $onLeave();
753
754 MCFOLD void $leaveScreen(::std::string const& expectedScreenName);
755
756 MCFOLD ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
757
758 MCAPI bool $bind(
759 ::std::string const& collectionName,
760 uint collectionNameHash,
761 int collectionIndex,
762 ::std::string const& bindingName,
763 uint bindingNameHash,
764 ::std::string const& bindingNameOverride,
765 ::UIPropertyBag& bag
766 );
767
768 MCAPI bool $bind(
769 ::std::string const& bindingName,
770 uint bindingNameHash,
771 ::std::string const& bindingNameOverride,
772 ::UIPropertyBag& bag
773 );
774
775 MCFOLD void $handleLicenseChanged();
776
777 MCFOLD void $setAssociatedBlockPos(::BlockPos const& pos);
778
779 MCFOLD void $setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
780
781 MCFOLD void $setSuspendInput(bool suspendInput);
782
783 MCFOLD void $setSuspendDirectionalInput(bool suspendDirectionalInput);
784
785 MCAPI void $setViewCommand(::ScreenViewCommand const& callback);
786
787 MCFOLD void $addStaticScreenVars(::Json::Value& globalVars);
788
789 MCFOLD ::std::string $getAdditionalScreenInfo() const;
790
791 MCFOLD ::std::string $getTelemetryOverride() const;
792
793 MCFOLD void $addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
794
795 MCFOLD ::ui::SceneType $getSceneType() const;
796
797 MCFOLD int $getScreenVersion() const;
798
799 MCFOLD uint $getSceneId() const;
800
801 MCAPI ::ScreenControllerProxy* $getProxy();
802
803 MCFOLD void $onEntered();
804
805 MCFOLD void $onScreenPushedAbove();
806
807 MCFOLD void $onEntering();
808
809 MCNAPI bool $_doesScreenHaveExitBehavior() const;
810
811 MCNAPI bool $_isContainerScreen() const;
812 // NOLINTEND
813};
Definition BlockPos.h:14
Definition IScreenController.h:5
Definition Value.h:16
Definition ScreenControllerProxy.h:5
Definition ScreenController.h:5
MCAPI void _registerSubController(::std::shared_ptr<::ScreenController > controller)
MCAPI void bindForGlobalGridSize(::StringHash const &bindingName, ::brstd::move_only_function< void(::std::string const &, ::UIPropertyBag &) const > callback, ::brstd::move_only_function< bool() const > condition)
MCAPI void bindColorForCollection(::StringHash const &collectionName, ::StringHash const &bindingName, ::brstd::move_only_function<::mce::Color(int) const > callback, ::brstd::move_only_function< bool(int) const > condition)
MCAPI void registerClippedCollectionEventHandler(::StringHash const &collectionName, ::brstd::move_only_function<::ui::ViewRequest(int, int, ::UIPropertyBag &) const > callback)
MCAPI void registerButtonInteractedHandler(uint buttonId, ::brstd::move_only_function<::ui::ViewRequest(::UIPropertyBag *) const > callback)
MCAPI void setControlFactoryDestroyCallback(::std::function< void(::std::string const &, ::std::string const &)> callback)
MCAPI void bindInt(::StringHash const &bindingName, ::brstd::move_only_function< int() const > callback, ::brstd::move_only_function< bool() const > condition)
MCAPI void setControlFactoryDestroyAllCallback(::std::function< void(::std::string const &)> callback)
MCAPI void registerSliderNotFinishedEventHandler(uint buttonId, ::brstd::move_only_function<::ui::ViewRequest(int, float) const > callback)
MCAPI void registerTextEditSelectedStateChangeEventHandler(uint buttonId, ::brstd::move_only_function<::ui::ViewRequest(::TextEditSelectedStateChangeEventData &) const > callback)
MCAPI::ui::ViewRequest _handleEvent(::ScreenEvent &screenEvent)
MCAPI bool $_isContainerScreen() const
MCAPI void registerClipStateChangeEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest(bool, ::UIPropertyBag &) const > callback)
MCAPI void setControlFactoryCreateCallback(::std::function< void(::std::string const &, ::UIPropertyBag const &)> callback)
MCAPI bool consumeBindingRefreshRequest()
MCAPI void registerCustomRendererEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const > callback)
MCAPI void queueAsyncTask(::brstd::move_only_function<::TaskResult()> &&task, ::std::function< void()> &&callback)
MCAPI void registerSliderFinishedEventHandler(uint buttonId, ::brstd::move_only_function<::ui::ViewRequest(int, float) const > callback)
MCAPI void registerTextEventHandler(::brstd::move_only_function<::ui::ViewRequest(::TextEditScreenEventData &, int) const > callback)
MCAPI bool hasFinishedAsyncTasks() const
MCAPI void bindDoubleForAnyCollection(::StringHash const &bindingName, ::brstd::move_only_function< double(::std::string const &, int) const > callback, ::brstd::move_only_function< bool(::std::string const &, int) const > condition)
MCAPI void bindColor(::StringHash const &bindingName, ::brstd::move_only_function<::mce::Color() const > callback, ::brstd::move_only_function< bool() const > condition)
MCAPI void bindColorWithPropertyBag(::StringHash const &bindingName, ::brstd::move_only_function<::mce::Color(::UIPropertyBag &) const > callback, ::brstd::move_only_function< bool() const > condition)
MCAPI bool $_doesScreenHaveExitBehavior() const
MCAPI::ui::ViewRequest $tryExit()
MCAPI void registerAnimationEventHandler(uint eventId, ::brstd::move_only_function<::ui::ViewRequest() const > callback)
Definition StringHash.h:5
Definition TaskGroup.h:85
Definition TaskResult.h:5
Definition UIPropertyBag.h:5
Definition Color.h:13
STL namespace.
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 ScreenViewCommand.h:5
Definition TextEditScreenEventData.h:5
Definition TextEditSelectedStateChangeEventData.h:5
Definition ToggleChangeEventData.h:5