3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/CardinalDirection.h"
7#include "mc/client/gui/DirtyFlag.h"
8#include "mc/client/gui/GameEventNotification.h"
9#include "mc/client/gui/controls/TextCharEventResult.h"
10#include "mc/client/gui/screens/ControlCollectionChange.h"
11#include "mc/client/gui/screens/ControlCollectionFlag.h"
12#include "mc/client/gui/screens/GamepadCursorData.h"
13#include "mc/client/gui/screens/TextEditFocusedListener.h"
14#include "mc/deps/core/utility/NonOwnerPointer.h"
15#include "mc/deps/core/utility/pub_sub/Subscription.h"
16#include "mc/deps/input/InputMode.h"
17#include "mc/deps/input/TextboxTextUpdateReason.h"
18#include "mc/deps/input/enums/ButtonState.h"
19#include "mc/deps/input/enums/DirectionId.h"
20#include "mc/deps/input/enums/FocusImpact.h"
27class ScreenController;
49namespace Json {
class Value; }
56 struct DelayedCommand;
61 enum class DelayedCommandLocation :
int {
109 using clock_type = ::std::chrono::steady_clock;
111 using duration_sec = ::std::chrono::duration<float, ::std::ratio<1, 1>>;
116 ::ll::TypedStorage<4, 4, float> mLastTime;
117 ::ll::TypedStorage<4, 4, float> mTickTime;
118 ::ll::TypedStorage<8, 8, double> mLastRawJoystickEventTime;
119 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
120 ::ll::TypedStorage<4, 4, int> mMenuUpButtonId;
121 ::ll::TypedStorage<4, 4, int> mMenuDownButtonId;
122 ::ll::TypedStorage<4, 4, int> mMenuLeftButtonId;
123 ::ll::TypedStorage<4, 4, int> mMenuRightButtonId;
124 ::ll::TypedStorage<4, 4, int> mMenuTabLeftButtonId;
125 ::ll::TypedStorage<4, 4, int> mMenuTabRightButtonId;
126 ::ll::TypedStorage<4, 8, ::std::array<uint, 2>> mPointerButtonIds;
127 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScreenController>> mController;
128 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VisualTree>> mVisualTree;
129 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAlwaysBindControls;
130 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mInputControls;
131 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mScrollViewControls;
132 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mOutOfModalScopeScrollViewControls;
133 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAnimationControls;
134 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mFactoryControls;
135 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mTextEditBoxControls;
136 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAlwaysListeningInputControls;
137 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mRenderableControls;
138 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mFlyingItemRendererControls;
139 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mSliderControls;
140 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mCustomRendererControls;
144 ::std::map<::std::vector<::std::shared_ptr<::UIControl>>*, ::std::vector<::std::shared_ptr<::UIControl>>>>
146 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScreenRenderBatch>> mRootRenderBatch;
147 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIAnimationController>> mAnimationController;
148 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint, ::std::vector<::std::weak_ptr<::UIControl>>>>
149 mReservedButtonUpEvents;
150 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mSelectedControl;
151 ::ll::TypedStorage<4, 4, ::InputMode> mInputMode;
152 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LayoutManager>> mLayoutManager;
153 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::FocusManager>> mFocusManager;
154 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ITTSEventManager>> mTTSEventManager;
155 ::ll::TypedStorage<1, 1, bool> mTextToSpeechEnabled;
156 ::ll::TypedStorage<8, 32, ::std::string> mTTSSectionHeader;
157 ::ll::TypedStorage<4, 4, float> mCurrentSliderValue;
158 ::ll::TypedStorage<1, 1, bool> mIsGUIScaleSlider;
159 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::ui::CardinalDirection>> mControllerStickDirections;
160 ::ll::TypedStorage<4, 4, int> mControllerLastMoved;
161 ::ll::TypedStorage<4, 4, int> mCursorTick;
162 ::ll::TypedStorage<4, 4, float const> mControllerXThreshold;
163 ::ll::TypedStorage<4, 4, float const> mControllerYThreshold;
164 ::ll::TypedStorage<4, 64, ::glm::vec2[8]> mControllerStickValues;
165 ::ll::TypedStorage<4, 8, ::GamepadCursorData> mGamepadCursorData;
166 ::ll::TypedStorage<4, 8, ::glm::vec2> mGamepadCursorPosition;
167 ::ll::TypedStorage<1, 1, bool> mHasSetInitialPosition;
168 ::ll::TypedStorage<1, 1, bool> mGamepadCursorFocusModeEnabled;
169 ::ll::TypedStorage<1, 1, bool> mGamepadCursorMagnetEnabled;
170 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mGamepadMagnetControl;
171 ::ll::TypedStorage<4, 4, float> mGamepadMoveTime;
172 ::ll::TypedStorage<4, 8, ::glm::vec2> mGamepadTrackedDirection;
173 ::ll::TypedStorage<1, 1, bool> mGamepadHasTapped;
174 ::ll::TypedStorage<4, 20, ::ScreenView::TouchPadData> mTouchPadData;
175 ::ll::TypedStorage<4, 8, ::glm::vec2> mPointerLocationPrevious;
176 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPointInTime;
177 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mCurrentTime;
178 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mTimeAccumulator;
179 ::ll::TypedStorage<4, 4, ::std::chrono::duration<float, ::std::ratio<1, 1>>
const> mFixedAnimationUpdateRate;
180 ::ll::TypedStorage<4, 4, float> mKeyboardHeight;
181 ::ll::TypedStorage<1, 1, bool> mShouldShowKeyboard;
182 ::ll::TypedStorage<1, 1, bool> mInitKeyboard;
183 ::ll::TypedStorage<4, 4, float> mCurrentObfuscateTime;
184 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
185 ::ll::TypedStorage<8, 24, ::std::vector<::RectangleArea>> mInputAreas;
186 ::ll::TypedStorage<8, 8, ::UIMeasureStrategy&> mMeasureStrategy;
187 ::ll::TypedStorage<1, 1, bool> mCanMoveFocus;
188 ::ll::TypedStorage<1, 1, ::FocusImpact> mNextFocusAction;
189 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::UIControlFactory>> mControlFactory;
190 ::ll::TypedStorage<8, 40, ::std::queue<::ScreenEvent, ::std::deque<::ScreenEvent>>> mAnimationEvents;
191 ::ll::TypedStorage<8, 40, ::std::queue<::ScreenEvent, ::std::deque<::ScreenEvent>>> mCustomRendererEvents;
192 ::ll::TypedStorage<4, 8, ::glm::vec2> mStartLocation;
193 ::ll::TypedStorage<4, 4, float> mTimeUntilNextPointerHeldEvent;
194 ::ll::TypedStorage<4, 4, float> mDelayBetweenEachPointerHeldEvent;
195 ::ll::TypedStorage<1, 1, bool> mShouldSendPointerHeldEvents;
196 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenView::DelayedCommand>> mDelayedCommands;
197 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScreenViewProxy>> mProxy;
198 ::ll::TypedStorage<1, 1, bool> mIsExiting;
199 ::ll::TypedStorage<1, 1, bool> mIsEntering;
200 ::ll::TypedStorage<1, 1, bool> mIsInitialized;
201 ::ll::TypedStorage<1, 1, bool> mHasFocus;
202 ::ll::TypedStorage<1, 1, bool> mHasHadFocus;
203 ::ll::TypedStorage<1, 1, bool> mIsTerminating;
204 ::ll::TypedStorage<1, 1, bool> mDirectionalButtonWasPressed;
205 ::ll::TypedStorage<1, 1, bool> mDelayedFocusRefresh;
206 ::ll::TypedStorage<1, 1, ::TextEditFocusedListener> mTextEditFocusedListener;
207 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ScreenLoadTimeTracker>> mScreenLoadTimeTracker;
208 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mFocusChangeSub;
222 ::std::shared_ptr<::ScreenController> controller,
223 ::std::unique_ptr<::VisualTree> visualTree,
224 ::std::shared_ptr<::UIControlFactory> controlFactory,
226 ::std::unique_ptr<::LayoutManager> layoutManager,
228 ::std::weak_ptr<::ITTSEventManager> ttsEventManager
231 MCAPI
void _addToControlCollection(
::UIControl& control, ::ControlCollectionFlag flag);
233 MCAPI
void _adjustFocusedControlToScrollRegion(
bool isRightStickScrolling);
235 MCAPI
void _adjustScrollToControl(
::UIControl& control);
238 _adjustScrollToFocusedControl(
::UIControl& focusedControl,
bool selectNearestControl,
bool isRightStickScrolling);
240 MCAPI
void _adjustScrollToIncludePosition(
242 ::glm::vec2 position,
244 bool isRightStickScrolling
247 MCAPI
void _adjustScrollToTopPosition();
249 MCAPI
void _advanceToNextToggleInNavigationTabGroup(
bool right);
251 MCAPI
void _bindData(
bool doAllBinds);
254 _changeInputControlCollection(
::UIControl& control, ::ControlCollectionChange change,
bool isRemoveCallback);
256 MCAPI
void _clearTTSQueue();
258 MCAPI
void _consumeFocusImpact(::FocusImpact focusImpact);
262 MCAPI
void _debugRenderFocusControl(
265 ::std::vector<::UIControl const*>& visited
268 MCAPI
void _deselectControl(
bool forceDeselect,
bool hoverAfterDeselect);
270 MCAPI
void _executeDelayedCommands(::ScreenView::DelayedCommandLocation location);
272 MCAPI
void _findAndSetFocusOnFocusableControlNotClippedVertical(
273 ::std::shared_ptr<::UIControl> rootControl,
275 bool isRightScrolling
278 MCAPI
void _fireSelectedStateChangeEvent(
::TextEditComponent const& textEditComponent,
bool state);
280 MCAPI
void _fireTextChangedEvent(
282 ::TextCharEventResult result,
285 ::UIPropertyBag* propertyBag
288 MCAPI
void _fireTextChangedEventTextEditControl(
291 ::TextCharEventResult result
294 MCAPI
void _focusChangeCallback(
295 ::std::weak_ptr<::UIControl> previousFocusControl,
296 ::std::weak_ptr<::UIControl> currentFocusControl
301 MCAPI
void _forwardEventToAnimationControls(::ScreenEvent
const& screenEvent);
303 MCAPI ::std::shared_ptr<::UIControl> _getGamepadCursorFocusedControl()
const;
305 MCAPI ::ScreenSettings
const* _getScreenComponent()
const;
307 MCAPI
void _handleDirtyVisualTree(
bool overrideFocusControl,
bool doAllBinds);
309 MCAPI
void _handlePointerLocation(
310 ::glm::vec2
const& position,
311 ::FocusImpact focusImpact,
312 bool forceHandleWhenMotionless,
313 bool isRightStickScrolling
316 MCAPI
bool _handleScreenViewRefresh();
318 MCAPI
void _handleSliderMovement();
320 MCAPI
void _handleStickScrolling(::DirectionId directionId);
323 _handleTTSOnSliderMovement(
::SliderComponent* sliderComponent, ::std::shared_ptr<::UIControl>& focusedControl);
325 MCAPI
bool _hasAnimationWithPlayAndEndEventId(uint playEventId, uint endEventId)
const;
327 MCAPI
bool _hasVisibleAnimationWithEndEventId(uint
id)
const;
331 MCAPI
bool _isTouchTTSEnabled()
const;
333 MCAPI
bool _notifyLayoutChange();
335 MCAPI
void _passViewCommand();
339 MCAPI
void _processControllerCursorMove(::DirectionId directionId);
341 MCAPI
void _processControllerDirection(::DirectionId directionId);
343 MCAPI
void _processControllerFocusChange(::DirectionId directionId);
347 MCAPI
void _queueTextToSpeechIfEnabled(
348 ::std::shared_ptr<::UIControl> focusedControl,
349 bool excludeControlHeader,
350 bool notInterruptible
353 MCAPI
void _queueTextToSpeechTextboxCharacter(::std::string
const& inputStr);
355 MCAPI
void _removeFromControlCollection(
::UIControl& control, ::ControlCollectionFlag flag);
359 MCAPI
void _resetFocusedControl();
361 MCAPI
void _scrollToGridItem(
::UIControl* gridControl,
int itemIndex,
int numItems);
363 MCAPI
void _selectControl(
::UIControl& control,
bool isHandlingTextChar);
365 MCAPI
void _selectNextFocusObject(
366 ::ui::CardinalDirection direction,
368 ::glm::vec2 overridePos,
369 bool isRightStickScrolling
372 MCAPI
void _sendScrollEvent(
::UIControl& parent,
float delta)
const;
374 MCAPI
void _setGamepadCursorFocusMode(
bool focusModeEnabled);
376 MCAPI
void _setKeyboardHeight(
float height);
378 MCAPI
void _setupControlFactoryCallbacks();
380 MCAPI
void _switchTabToTargetIndex(::std::vector<::std::shared_ptr<::UIControl>>& tabControls,
int targetIndex);
382 MCAPI
void _update();
384 MCAPI
bool _updateControlCollections(
bool overrideFocusControl);
387 _updateFocusControl(
bool forceUpdate,
bool forceFocusToAdjust,
bool isRightStickScrolling,
bool isHandlingTextChar);
389 MCAPI
void _updateInputAreas();
391 MCAPI
void _updateKeyboardVisibility();
393 MCAPI
bool _updateSelectedControl(
::ScreenInputContext& context, uint buttonId, ::ButtonState buttonState);
395 MCAPI
void cleanInputComponents();
397 MCAPI ::std::string getRoute()
const;
399 MCAPI ::std::string getScreenName()
const;
401 MCAPI ::std::string getScreenTelemetryName()
const;
403 MCAPI
void handleButtonEvent(uint buttonId, ::ButtonState buttonState, ::FocusImpact focusImpact);
405 MCAPI
void handleControlEvent(::ScreenEvent screenEvent);
407 MCAPI
void handleDirection(::DirectionId directionId,
float x,
float y, ::FocusImpact focusImpact);
409 MCAPI
void handleInputModeChanged(::InputMode inputMode);
412 handlePointerLocation(::glm::vec2
const& position,
bool forceMotionlessPointer, ::FocusImpact focusImpact);
414 MCAPI
void handleTextChar(::std::string
const& inputUtf8,
bool keepImePosition, ::FocusImpact focusImpact);
418 MCAPI
bool isGamepadDeflectionModeEnabled()
const;
420 MCAPI
void onFocusGained();
422 MCAPI
void onGameEventNotification(::ui::GameEventNotification notification);
424 MCAPI
void onScreenEntrance(
bool isRevisiting,
bool doScreenTransitions);
426 MCAPI
void onScreenExit(
bool isPopping,
bool doScreenTransitions, ::std::shared_ptr<::AbstractScene> pushedScene);
428 MCAPI
void reload(::Json::Value
const& globalVars);
434 MCAPI
void setInitialized();
436 MCAPI
void setScreenLoadTimeTracker(::Bedrock::NonOwnerPointer<::ScreenLoadTimeTracker> tracker);
438 MCAPI
void setTextboxText(::std::string
const& text, ::TextboxTextUpdateReason reason);
452 MCAPI
static bool& sIsDebuggingFocus();
454 MCAPI
static bool& sRenderDebugControls();
462 ::std::shared_ptr<::ScreenController> controller,
463 ::std::unique_ptr<::VisualTree> visualTree,
464 ::std::shared_ptr<::UIControlFactory> controlFactory,
466 ::std::unique_ptr<::LayoutManager> layoutManager,
468 ::std::weak_ptr<::ITTSEventManager> ttsEventManager
Definition AbstractScene.h:5
Definition KeyboardManager.h:5
Definition ScreenViewProxy.h:5
Definition ScreenView.h:5
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5
Definition DataBindingComponent.h:5
Definition FocusComponent.h:5
Definition FocusManager.h:5
Definition GamepadCursorData.h:5
Definition ITTSEventManager.h:5
Definition LayoutManager.h:5
Definition ScreenInputContext.h:5
Definition ScreenLoadTimeTracker.h:5
Definition ScreenRenderBatch.h:5
Definition ScreenSettings.h:5
Definition ScreenView.h:66
Definition ScreenView.h:93
Definition SliderComponent.h:5
Definition TextEditComponent.h:5
Definition TouchPadTouchEventData.h:5
Definition UIAnimationController.h:5
Definition UIControlFactory.h:5
Definition VisualTree.h:5