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*/;
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 _shouldHandlePressedMapping(
114 ::ScreenButtonMapping const& buttonMapping,
115 uint buttonId,
116 ::ButtonState state,
117 ::glm::vec2 const& pointerPosition,
118 ::InputMode inputMode
119 );
120
121 MCAPI ::ButtonHandleResult handleButtonEvent(
122 ::VisualTree& visualTree,
123 ::UIAnimationController& animationController,
124 ::ScreenInputContext& context,
125 uint buttonId,
126 ::ButtonState state,
127 ::glm::vec2 const& pointerPosition,
128 ::InputMode inputMode,
129 bool isTTSTouchEnabled
130 );
131
132 MCAPI bool handleControllerDirection(
133 ::VisualTree& visualTree,
134 ::UIAnimationController& animationController,
135 ::ScreenInputContext& context,
136 ::DirectionId directionId,
137 ::glm::vec2 const& deltaPosition,
138 bool alreadyHandled
139 );
140
141 MCAPI bool handleFocusLocation(
142 ::VisualTree& visualTree,
143 ::UIAnimationController& animationController,
144 ::ScreenInputContext& context,
145 ::glm::vec2 const& position,
146 bool alreadyHandled
147 );
148
149 MCAPI bool handlePointerLocation(
150 ::VisualTree& visualTree,
151 ::UIAnimationController& animationController,
152 ::ScreenInputContext& context,
153 ::glm::vec2 const& position,
154 ::glm::vec2 const& deltaPosition,
155 bool alreadyHandled
156 );
157
158 MCAPI bool isWithinClipRegion(::glm::vec2 const& pointerPosition) const;
159 // NOLINTEND
160
161public:
162 // destructor thunk
163 // NOLINTBEGIN
164 MCAPI void $dtor();
165 // NOLINTEND
166
167public:
168 // virtual function thunks
169 // NOLINTBEGIN
170 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
171
172 MCAPI void $reset();
173
174 MCAPI void $onVisibilityChanged(bool visible);
175 // NOLINTEND
176
177public:
178 // vftables
179 // NOLINTBEGIN
180 MCNAPI static void** $vftable();
181 // NOLINTEND
182};
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