LeviLamina
Loading...
Searching...
No Matches
InputComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/controls/ButtonHandleResult.h"
7#include "mc/client/gui/controls/UIComponent.h"
8#include "mc/client/gui/screens/ScreenEventScope.h"
9#include "mc/deps/input/InputMode.h"
10#include "mc/deps/input/enums/ButtonState.h"
11#include "mc/deps/input/enums/DirectionId.h"
12
13// auto generated forward declare list
14// clang-format off
17class UIControl;
18class VisualTree;
20// clang-format on
21
22class InputComponent : public ::UIComponent {
23public:
24 // InputComponent inner types declare
25 // clang-format off
27 struct PressStats;
28 // clang-format on
29
30 // InputComponent inner types define
31 enum class PressType : int {
32 Single = 0,
33 Double = 1,
34 };
35
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<4, 4, uint> toButtonId;
41 ::ll::TypedStorage<1, 1, ::ScreenEventScope> scope;
42 // NOLINTEND
43 };
44
45 struct PressStats {
46 public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<4, 4, int> pressCount;
50 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> lastPressTime;
51 ::ll::TypedStorage<4, 8, ::glm::vec2> position;
52 // NOLINTEND
53 };
54
55public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenButtonMapping>> mButtonMappings;
59 ::ll::TypedStorage<8, 24, ::std::vector<::InputComponent::ScreenHoverButtonMapping>> mHoverButtonMappings;
60 ::ll::TypedStorage<1, 1, ::ScreenEventScope> mRemappingMappingScope;
61 ::ll::TypedStorage<1, 1, bool> mAlwaysHandlePointer;
62 ::ll::TypedStorage<1, 1, bool> mAlwaysHandleControllerDirection;
63 ::ll::TypedStorage<1, 1, bool> mHasRemappingMapping;
64 ::ll::TypedStorage<1, 1, bool> mAlwaysListensToInput;
65 ::ll::TypedStorage<1, 1, bool> mModal;
66 ::ll::TypedStorage<1, 1, bool> mInlineModal;
67 ::ll::TypedStorage<1, 1, bool> mIgnoreHoverChange;
68 ::ll::TypedStorage<1, 1, bool> mHoverEnabled;
69 ::ll::TypedStorage<1, 1, bool> mConsumeHoverEvents;
70 ::ll::TypedStorage<1, 1, bool> mPreventsTouchControl;
71 ::ll::TypedStorage<1, 1, bool> mGamepadDeflectionMode;
72 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint, ::InputComponent::PressStats>> mPressStats;
73 // NOLINTEND
74
75public:
76 // virtual functions
77 // NOLINTBEGIN
78 virtual ~InputComponent() /*override*/ = default;
79
80 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
81
82 virtual void reset() /*override*/;
83
84 virtual void onVisibilityChanged(bool visible) /*override*/;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCAPI ::InputComponent::PressType
91 _detectDoubleClick(uint buttonId, ::ButtonState state, ::glm::vec2 const& pointerPosition, bool isTTSTouchEnabled);
92
93 MCAPI bool _getContentPanelHover(::glm::vec2 const& pointerPosition);
94
95 MCAPI bool _sendButtonScreenEvent(
96 ::ScreenInputContext& context,
97 ::ScreenButtonMapping const& buttonMapping,
98 ::ButtonState state,
99 ::glm::vec2 const& pointerPosition,
100 ::VisualTree& visualTree,
101 ::UIAnimationController& animationController,
102 ::InputMode inputMode
103 );
104
105 MCAPI bool _sendHoverScreenEvent(
106 ::ScreenInputContext& context,
107 ::VisualTree& visualTree,
108 ::UIAnimationController& animationController,
109 ::glm::vec2 const& position,
110 bool alreadyHandled
111 );
112
113 MCAPI bool _shouldHandleControllerDirection(::DirectionId directionId, ::glm::vec2 const& deltaPosition);
114
115 MCAPI bool _shouldHandlePressedMapping(
116 ::ScreenButtonMapping const& buttonMapping,
117 uint buttonId,
118 ::ButtonState state,
119 ::glm::vec2 const& pointerPosition,
120 ::InputMode inputMode
121 );
122
123 MCAPI ::ButtonHandleResult handleButtonEvent(
124 ::VisualTree& visualTree,
125 ::UIAnimationController& animationController,
126 ::ScreenInputContext& context,
127 uint buttonId,
128 ::ButtonState state,
129 ::glm::vec2 const& pointerPosition,
130 ::InputMode inputMode,
131 bool isTTSTouchEnabled
132 );
133
134 MCAPI bool handleControllerDirection(
135 ::VisualTree& visualTree,
136 ::UIAnimationController& animationController,
137 ::ScreenInputContext& context,
138 ::DirectionId directionId,
139 ::glm::vec2 const& deltaPosition,
140 bool alreadyHandled
141 );
142
143 MCAPI bool handleFocusLocation(
144 ::VisualTree& visualTree,
145 ::UIAnimationController& animationController,
146 ::ScreenInputContext& context,
147 ::glm::vec2 const& position,
148 bool alreadyHandled
149 );
150
151 MCAPI bool handlePointerLocation(
152 ::VisualTree& visualTree,
153 ::UIAnimationController& animationController,
154 ::ScreenInputContext& context,
155 ::glm::vec2 const& position,
156 ::glm::vec2 const& deltaPosition,
157 bool alreadyHandled
158 );
159
160 MCAPI bool isWithinClipRegion(::glm::vec2 const& pointerPosition) const;
161 // NOLINTEND
162
163public:
164 // virtual function thunks
165 // NOLINTBEGIN
166 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
167
168 MCAPI void $reset();
169
170 MCAPI void $onVisibilityChanged(bool visible);
171 // NOLINTEND
172
173public:
174 // vftables
175 // NOLINTBEGIN
176 MCNAPI static void** $vftable();
177 // NOLINTEND
178};
Definition InputComponent.h:5
static MCAPI void ** $vftable()
Definition ScreenInputContext.h:5
Definition UIAnimationController.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition VisualTree.h:5
Definition InputComponent.h:18
Definition InputComponent.h:16
Definition ScreenButtonMapping.h:5