LeviLamina
Loading...
Searching...
No Matches
HudScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/game/ControlOptionType.h"
7#include "mc/client/gui/DirtyFlag.h"
8#include "mc/client/gui/GameEventNotification.h"
9#include "mc/client/gui/SceneType.h"
10#include "mc/client/gui/SoundDirection.h"
11#include "mc/client/gui/TitleMessage.h"
12#include "mc/client/gui/screens/controllers/ClientInstanceScreenController.h"
13#include "mc/client/input/vanilla/remapping/ActionEnum.h"
14#include "mc/deps/core/timing/Stopwatch.h"
15#include "mc/deps/core/utility/pub_sub/Subscription.h"
16#include "mc/options/option_types/OptionID.h"
17#include "mc/world/ContainerID.h"
18#include "mc/world/actor/ai/util/BossBarColor.h"
19#include "mc/world/level/BlockPos.h"
20
21// auto generated forward declare list
22// clang-format off
23class Block;
27class Keymapping;
28class RemappingLayout;
30class UIPropertyBag;
31namespace Json { class Value; }
32namespace mce { class Color; }
33// clang-format on
34
36public:
37 // HudScreenController inner types declare
38 // clang-format off
39 struct ButtonLists;
40 struct Tooltip;
41 // clang-format on
42
43 // HudScreenController inner types define
44 enum class Tooltips : uchar {
45 None = 0,
46 LeftTips = 1,
47 RightTips = 2,
48 };
49
50 struct ButtonLists {
51 public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> chatbuttonList;
55 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> ttsButtonList;
56 // NOLINTEND
57 };
58
59 struct Tooltip {
60 public:
61 // Tooltip inner types define
62 enum class Type : uchar {
63 KeyboardOnly = 0,
64 GamepadOnly = 1,
65 Mixed = 2,
66 };
67
68 public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<4, 4, ::Remapping::ActionEnum> action;
72 ::ll::TypedStorage<1, 1, ::HudScreenController::Tooltip::Type> type;
73 ::ll::TypedStorage<8, 64, ::std::function<::std::string()>> generateTooltipDescription;
74 ::ll::TypedStorage<8, 32, ::std::string> keyPostfix;
75 // NOLINTEND
76 };
77
78public:
79 // member variables
80 // NOLINTBEGIN
81 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnBossEventWithPacketSubscription;
82 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnBossEventSubscription;
83 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelSoundEvent;
84 ::ll::TypedStorage<1, 1, bool> mEDUDiscoveryObserved;
85 ::ll::TypedStorage<4, 4, int> mInputDelayTimer;
86 ::ll::TypedStorage<8, 32, ::std::string> mPopupItemText;
87 ::ll::TypedStorage<8, 32, ::std::string> mPopupJukeboxText;
88 ::ll::TypedStorage<8, 32, ::std::string> mTipText;
89 ::ll::TypedStorage<4, 12, ::BlockPos> mPlayerPos;
90 ::ll::TypedStorage<4, 12, ::BlockPos> mAgentPos;
91 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mRecordedDirtyState;
92 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::HudContainerManagerController>> mHudScreenManagerController;
93 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScoreboardScreenController>> mScoreboardScreenController;
94 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GameTipScreenController>> mGameTipScreenController;
95 ::ll::TypedStorage<1, 1, bool> mIsPlayerRiding;
96 ::ll::TypedStorage<1, 1, bool> mIsCreative;
97 ::ll::TypedStorage<1, 1, bool> mIsSpectator;
98 ::ll::TypedStorage<1, 1, bool> mIsExpediateEmoteActive;
99 ::ll::TypedStorage<1, 1, bool> mHasPresentedInitialChat;
100 ::ll::TypedStorage<1, 1, bool> mIsAutoSaving;
101 ::ll::TypedStorage<1, 1, bool> mIsAutoSaveTimerDone;
102 ::ll::TypedStorage<8, 56, ::Stopwatch> mAutoSaveTimer;
103 ::ll::TypedStorage<8, 56, ::Stopwatch> mHUDOpacityTimer;
104 ::ll::TypedStorage<4, 4, float> mHUDOpacityOverride;
105 ::ll::TypedStorage<1, 1, bool> mOverrideHUDOpacity;
106 ::ll::TypedStorage<1, 1, bool> mShouldFireInitialControlTipsActivationEvent;
107 ::ll::TypedStorage<1, 1, bool> mIsDisplayingGameTip;
108 ::ll::TypedStorage<1, 1, bool> mIsTitleOnDisplay;
109 ::ll::TypedStorage<1, 1, bool> mIsActionBarMessageOnDisplay;
110 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleQueuedData;
111 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleOnDisplayData;
112 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mLeftTooltips;
113 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mRightTooltips;
114 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mEmoteTooltips;
115 ::ll::TypedStorage<1, 1, bool> mOnNewDeathScreen;
116 ::ll::TypedStorage<1, 1, bool> mShowCursor;
117 ::ll::TypedStorage<8, 16, ::std::map<::OptionID, float>> mCustomizableFloatOptions;
118 ::ll::TypedStorage<8, 16, ::std::set<uint>> mPreviouslyActiveControlOptions;
119 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mOnNewDeathScreenDirtyFlag;
120 ::ll::TypedStorage<1, 1, bool> mIsNewDeathScreenEnabled;
121 ::ll::TypedStorage<1, 1, bool> mProfanityFilterChanged;
122 ::ll::TypedStorage<1, 1, bool> mShouldUseFilteredMessage;
123 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mProfanityToggleSubscription;
124 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnRouteChangedSubscription;
125 ::ll::TypedStorage<1, 1, bool> mShouldShowLocatorBarPrev;
126 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mSubtitlePositionSubscription;
127 ::ll::TypedStorage<1, 1, bool> mSubtitlePositionChanged;
128 // NOLINTEND
129
130public:
131 // prevent constructor by default
132 HudScreenController();
133
134public:
135 // virtual functions
136 // NOLINTBEGIN
137 virtual ~HudScreenController() /*override*/ = default;
138
139 virtual ::ui::DirtyFlag tick() /*override*/;
140
141 virtual bool bind(
142 ::std::string const& collectionName,
143 uint collectionNameHash,
144 int collectionIndex,
145 ::std::string const& bindingName,
146 uint bindingNameHash,
147 ::std::string const& bindingNameOverride,
148 ::UIPropertyBag& bag
149 ) /*override*/;
150
151 virtual bool bind(
152 ::std::string const& bindingName,
153 uint bindingNameHash,
154 ::std::string const& bindingNameOverride,
155 ::UIPropertyBag& bag
156 ) /*override*/;
157
158 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) /*override*/;
159
160 virtual void onInit() /*override*/;
161
162 virtual void onOpen() /*override*/;
163
164 virtual void onScreenPushedAbove() /*override*/;
165
166 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
167
168 virtual ::ui::SceneType getSceneType() const /*override*/;
169
170 virtual bool _isStillValid() const /*override*/;
171 // NOLINTEND
172
173public:
174 // member functions
175 // NOLINTBEGIN
176 MCAPI explicit HudScreenController(::std::shared_ptr<::ClientInstanceScreenModel> model);
177
178 MCAPI void _bindActionIconForGamepad(
179 ::Remapping::ActionEnum action,
180 ::std::string const& bindingNameOverride,
181 ::UIPropertyBag& bag
182 ) const;
183
184 MCAPI void _bindInventoryPromptsFlyout(
185 uint bindingNameHash,
186 ::std::string const& bindingNameOverride,
187 ::UIPropertyBag& bag
188 ) const;
189
190 MCAPI bool _bindKeyboardTooltip(
191 ::HudScreenController::Tooltip const& tip,
192 uint bindingNameHash,
193 ::std::string const& bindingNameOverride,
194 ::UIPropertyBag& bag
195 ) const;
196
197 MCAPI void
198 _bindMenuPromptsFlyout(uint bindingNameHash, ::std::string const& bindingNameOverride, ::UIPropertyBag& bag) const;
199
200 MCAPI void _bindTooltipCollection(
201 ::std::vector<::HudScreenController::Tooltip> const& tooltips,
202 int collectionIndex,
203 uint bindingNameHash,
204 ::std::string const& bindingNameOverride,
205 ::UIPropertyBag& bag,
206 ::HudScreenController::Tooltips tooltipType
207 ) const;
208
209 MCAPI void
210 _bindTooltipFlyout(uint bindingNameHash, ::std::string const& bindingNameOverride, ::UIPropertyBag& bag) const;
211
212 MCAPI void _fireInitialControlTipsActivationEvent() const;
213
214 MCAPI ::std::string _formatButtonList(::std::vector<::std::string> buttonList) const;
215
216 MCAPI ::mce::Color _getBossColorValue(::BossBarColor barColor) const;
217
218 MCAPI ::std::string _getContextAttackButton() const;
219
220 MCAPI ::std::string _getContextChat() const;
221
222 MCAPI ::std::string _getContextCodeBuilder() const;
223
224 MCAPI ::std::string _getContextCraftingButton() const;
225
226 MCAPI ::std::string _getContextDescendButton() const;
227
228 MCAPI ::std::string _getContextDismountButton() const;
229
230 MCAPI ::std::string _getContextDropItemButton() const;
231
232 MCAPI ::std::string _getContextEmoteButton() const;
233
234 MCAPI ::std::string _getContextImmersiveReader() const;
235
236 MCAPI ::std::string _getContextInventoryButton() const;
237
238 MCAPI ::std::string _getContextJumpButton() const;
239
240 MCAPI ::std::string _getContextToggleFlight() const;
241
242 MCAPI ::std::string _getContextUseButton() const;
243
244 MCAPI ::std::string _getEmoteName(int slot);
245
246 MCAPI void _getFloatCustomizableOptionValue(::OptionID optionID);
247
248 MCAPI ::Keymapping const& _getGamepadMapping(::Remapping::ActionEnum action) const;
249
250 MCAPI float _getHudAlpha();
251
252 MCAPI ::Keymapping const& _getKeyboardMapping(::Remapping::ActionEnum action) const;
253
254 MCAPI ::Keymapping const& _getMapping(::Remapping::ActionEnum action, ::RemappingLayout const& layout) const;
255
256 MCAPI void _handleNewActionBarMessage();
257
258 MCAPI void _handleSlotSelection(int slot, ::ContainerID containerId);
259
260 MCAPI bool _isAutoSaveIconVisible();
261
262 MCAPI bool
263 _isToolTipsHidden(::HudScreenController::Tooltips tooltipType, ::HudScreenController::Tooltip const* tip) const;
264
265 MCAPI bool _isTouchActive() const;
266
267 MCAPI void _leaveControlCustomizationScreen();
268
269 MCAPI void _pushNewChatMessage(::std::string const& message, float time);
270
271 MCAPI void _pushNewSubtitleMessage(
272 ::std::string const& message,
273 float timeSec,
274 ::SoundDirection direction,
275 bool isLocalPlayer
276 );
277
278 MCAPI void _recreateSubtitleContainer();
279
280 MCAPI void _refreshSubtitleMessages();
281
282 MCAPI bool _shouldShowLocatorBar() const;
283
284 MCAPI bool _shouldShowTags() const;
285
286 MCAPI bool _showClassicUI() const;
287
288 MCAPI bool _showPaperDoll() const;
289
290 MCAPI bool _showPocketUI() const;
291
292 MCAPI bool _showSurvivalUI() const;
293
294 MCAPI void displayOpenEmoteInstructions(::HudScreenController::ButtonLists const& buttonLists) const;
295
296 MCAPI ::HudScreenController::ButtonLists const getButtonLists() const;
297
298 MCAPI ::std::string const getFormattedOpenChatMessage(::std::vector<::std::string> const& buttonList) const;
299
300 MCAPI ::std::string const getFormattedOpenEmoteMessage(::std::vector<::std::string> const& buttonList) const;
301
302 MCAPI ::HudScreenController::ButtonLists const getGamepadEmoteButtonLists() const;
303
304 MCAPI ::HudScreenController::ButtonLists const getKeyboardEmoteButtonLists() const;
305
306 MCAPI void setupControlCustomizationCallbacksForOptions(::ControlOptionType controlOptionType);
307 // NOLINTEND
308
309public:
310 // static functions
311 // NOLINTBEGIN
312 MCAPI static bool _shouldShowDefaultUseTooltip(::Block const& block);
313 // NOLINTEND
314
315public:
316 // static variables
317 // NOLINTBEGIN
318 MCAPI static char const*& ROOT_CONTROL_NAME();
319
320 MCAPI static char const*& ROOT_CONTROL_NAME_INCLUDING_NAMESPACE();
321 // NOLINTEND
322
323public:
324 // constructor thunks
325 // NOLINTBEGIN
326 MCAPI void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model);
327 // NOLINTEND
328
329public:
330 // virtual function thunks
331 // NOLINTBEGIN
332 MCAPI ::ui::DirtyFlag $tick();
333
334 MCAPI bool $bind(
335 ::std::string const& collectionName,
336 uint collectionNameHash,
337 int collectionIndex,
338 ::std::string const& bindingName,
339 uint bindingNameHash,
340 ::std::string const& bindingNameOverride,
341 ::UIPropertyBag& bag
342 );
343
344 MCAPI bool $bind(
345 ::std::string const& bindingName,
346 uint bindingNameHash,
347 ::std::string const& bindingNameOverride,
348 ::UIPropertyBag& bag
349 );
350
351 MCAPI ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
352
353 MCAPI void $onInit();
354
355 MCAPI void $onOpen();
356
357 MCAPI void $onScreenPushedAbove();
358
359 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
360
361 MCFOLD ::ui::SceneType $getSceneType() const;
362
363 MCAPI bool $_isStillValid() const;
364 // NOLINTEND
365};
Definition Block.h:41
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition GameTipScreenController.h:5
Definition HudContainerManagerController.h:14
Definition HudScreenController.h:5
Definition Value.h:16
Definition Keymapping.h:5
Definition RemappingLayout.h:5
Definition ScoreboardScreenController.h:5
Definition UIPropertyBag.h:5
Definition Color.h:13
Definition HudScreenController.h:16
Definition HudScreenController.h:18