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/oreui/routing/RouterAction.h"
13#include "mc/client/gui/screens/controllers/ClientInstanceScreenController.h"
14#include "mc/client/input/vanilla/remapping/ActionEnum.h"
15#include "mc/deps/core/timing/Stopwatch.h"
16#include "mc/deps/core/utility/pub_sub/Subscription.h"
17#include "mc/options/option_types/OptionID.h"
18#include "mc/world/ContainerID.h"
19#include "mc/world/actor/ai/util/BossBarColor.h"
20#include "mc/world/actor/ai/util/BossEventUpdateType.h"
21#include "mc/world/level/BlockPos.h"
22
23// auto generated forward declare list
24// clang-format off
25class Block;
26class BossEventPacket;
30class Keymapping;
31class RemappingLayout;
33class UIPropertyBag;
34class Vec3;
35struct ActorUniqueID;
36namespace Bedrock::Safety { class RedactableString; }
37namespace Json { class Value; }
38namespace OreUI { class RouterLocation; }
39namespace mce { class Color; }
40// clang-format on
41
43public:
44 // HudScreenController inner types declare
45 // clang-format off
46 struct ButtonLists;
47 struct Tooltip;
48 // clang-format on
49
50 // HudScreenController inner types define
51 enum class Tooltips : uchar {
52 None = 0,
53 LeftTips = 1,
54 RightTips = 2,
55 };
56
57 struct ButtonLists {
58 public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> chatbuttonList;
62 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> ttsButtonList;
63 // NOLINTEND
64 };
65
66 struct Tooltip {
67 public:
68 // Tooltip inner types define
69 enum class Type : uchar {
70 KeyboardOnly = 0,
71 GamepadOnly = 1,
72 Mixed = 2,
73 };
74
75 public:
76 // member variables
77 // NOLINTBEGIN
78 ::ll::TypedStorage<4, 4, ::Remapping::ActionEnum> action;
79 ::ll::TypedStorage<1, 1, ::HudScreenController::Tooltip::Type> type;
80 ::ll::TypedStorage<8, 64, ::std::function<::std::string()>> generateTooltipDescription;
81 ::ll::TypedStorage<8, 32, ::std::string> keyPostfix;
82 // NOLINTEND
83
84 public:
85 // prevent constructor by default
86 Tooltip& operator=(Tooltip const&);
87 Tooltip();
88
89 public:
90 // member functions
91 // NOLINTBEGIN
92 MCAPI Tooltip(::HudScreenController::Tooltip const&);
93
94 MCAPI ~Tooltip();
95 // NOLINTEND
96
97 public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCAPI void* $ctor(::HudScreenController::Tooltip const&);
101 // NOLINTEND
102
103 public:
104 // destructor thunk
105 // NOLINTBEGIN
106 MCAPI void $dtor();
107 // NOLINTEND
108 };
109
110public:
111 // member variables
112 // NOLINTBEGIN
113 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnBossEventWithPacketSubscription;
114 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnBossEventSubscription;
115 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelSoundEvent;
116 ::ll::TypedStorage<1, 1, bool> mEDUDiscoveryObserved;
117 ::ll::TypedStorage<4, 4, int> mInputDelayTimer;
118 ::ll::TypedStorage<8, 32, ::std::string> mPopupItemText;
119 ::ll::TypedStorage<8, 32, ::std::string> mPopupJukeboxText;
120 ::ll::TypedStorage<8, 32, ::std::string> mTipText;
121 ::ll::TypedStorage<4, 12, ::BlockPos> mPlayerPos;
122 ::ll::TypedStorage<4, 12, ::BlockPos> mAgentPos;
123 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mRecordedDirtyState;
124 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::HudContainerManagerController>> mHudScreenManagerController;
125 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScoreboardScreenController>> mScoreboardScreenController;
126 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GameTipScreenController>> mGameTipScreenController;
127 ::ll::TypedStorage<1, 1, bool> mIsPlayerRiding;
128 ::ll::TypedStorage<1, 1, bool> mIsCreative;
129 ::ll::TypedStorage<1, 1, bool> mIsSpectator;
130 ::ll::TypedStorage<1, 1, bool> mIsExpediateEmoteActive;
131 ::ll::TypedStorage<1, 1, bool> mHasPresentedInitialChat;
132 ::ll::TypedStorage<1, 1, bool> mIsAutoSaving;
133 ::ll::TypedStorage<1, 1, bool> mIsAutoSaveTimerDone;
134 ::ll::TypedStorage<8, 56, ::Stopwatch> mAutoSaveTimer;
135 ::ll::TypedStorage<8, 56, ::Stopwatch> mHUDOpacityTimer;
136 ::ll::TypedStorage<4, 4, float> mHUDOpacityOverride;
137 ::ll::TypedStorage<1, 1, bool> mOverrideHUDOpacity;
138 ::ll::TypedStorage<1, 1, bool> mShouldFireInitialControlTipsActivationEvent;
139 ::ll::TypedStorage<1, 1, bool> mIsDisplayingGameTip;
140 ::ll::TypedStorage<1, 1, bool> mIsTitleOnDisplay;
141 ::ll::TypedStorage<1, 1, bool> mIsActionBarMessageOnDisplay;
142 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleQueuedData;
143 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleOnDisplayData;
144 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mLeftTooltips;
145 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mRightTooltips;
146 ::ll::TypedStorage<8, 24, ::std::vector<::HudScreenController::Tooltip>> mEmoteTooltips;
147 ::ll::TypedStorage<1, 1, bool> mOnNewDeathScreen;
148 ::ll::TypedStorage<1, 1, bool> mShowCursor;
149 ::ll::TypedStorage<8, 16, ::std::map<::OptionID, float>> mCustomizableFloatOptions;
150 ::ll::TypedStorage<8, 16, ::std::set<uint>> mPreviouslyActiveControlOptions;
151 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mOnNewDeathScreenDirtyFlag;
152 ::ll::TypedStorage<1, 1, bool> mIsNewDeathScreenEnabled;
153 ::ll::TypedStorage<1, 1, bool> mProfanityFilterChanged;
154 ::ll::TypedStorage<1, 1, bool> mShouldUseFilteredMessage;
155 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mProfanityToggleSubscription;
156 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnRouteChangedSubscription;
157 ::ll::TypedStorage<1, 1, bool> mShouldShowLocatorBarPrev;
158 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mSubtitlePositionSubscription;
159 ::ll::TypedStorage<1, 1, bool> mSubtitlePositionChanged;
160 // NOLINTEND
161
162public:
163 // prevent constructor by default
164 HudScreenController();
165
166public:
167 // virtual functions
168 // NOLINTBEGIN
169 virtual ~HudScreenController() /*override*/;
170
171 virtual ::ui::DirtyFlag tick() /*override*/;
172
173 virtual bool bind(
174 ::std::string const& collectionName,
175 uint collectionNameHash,
176 int collectionIndex,
177 ::std::string const& bindingName,
178 uint bindingNameHash,
179 ::std::string const& bindingNameOverride,
180 ::UIPropertyBag& bag
181 ) /*override*/;
182
183 virtual bool bind(
184 ::std::string const& bindingName,
185 uint bindingNameHash,
186 ::std::string const& bindingNameOverride,
187 ::UIPropertyBag& bag
188 ) /*override*/;
189
190 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) /*override*/;
191
192 virtual void onInit() /*override*/;
193
194 virtual void onOpen() /*override*/;
195
196 virtual void onScreenPushedAbove() /*override*/;
197
198 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
199
200 virtual ::ui::SceneType getSceneType() const /*override*/;
201
202 virtual bool _isStillValid() const /*override*/;
203 // NOLINTEND
204
205public:
206 // member functions
207 // NOLINTBEGIN
208 MCAPI explicit HudScreenController(::std::shared_ptr<::ClientInstanceScreenModel> model);
209
210 MCAPI void _bindActionIconForGamepad(
211 ::Remapping::ActionEnum action,
212 ::std::string const& bindingNameOverride,
213 ::UIPropertyBag& bag
214 ) const;
215
216 MCAPI void _bindInventoryPromptsFlyout(
217 uint bindingNameHash,
218 ::std::string const& bindingNameOverride,
219 ::UIPropertyBag& bag
220 ) const;
221
222 MCAPI bool _bindKeyboardTooltip(
223 ::HudScreenController::Tooltip const& tip,
224 uint bindingNameHash,
225 ::std::string const& bindingNameOverride,
226 ::UIPropertyBag& bag
227 ) const;
228
229 MCAPI void
230 _bindMenuPromptsFlyout(uint bindingNameHash, ::std::string const& bindingNameOverride, ::UIPropertyBag& bag) const;
231
232 MCAPI void _bindTooltipCollection(
233 ::std::vector<::HudScreenController::Tooltip> const& tooltips,
234 int collectionIndex,
235 uint bindingNameHash,
236 ::std::string const& bindingNameOverride,
237 ::UIPropertyBag& bag,
238 ::HudScreenController::Tooltips tooltipType
239 ) const;
240
241 MCAPI void
242 _bindTooltipFlyout(uint bindingNameHash, ::std::string const& bindingNameOverride, ::UIPropertyBag& bag) const;
243
244 MCAPI bool _canChatAndEmoteGameTipBeShown() const;
245
246 MCAPI void _checkEduDiscoveryReachable();
247
248 MCAPI void _fireInitialControlTipsActivationEvent() const;
249
250 MCAPI ::std::string _formatButtonList(::std::vector<::std::string> buttonList) const;
251
252 MCAPI ::mce::Color _getBossColorValue(::BossBarColor barColor) const;
253
254 MCAPI ::std::string _getContextAttackButton() const;
255
256 MCAPI ::std::string _getContextChat() const;
257
258 MCAPI ::std::string _getContextCodeBuilder() const;
259
260 MCAPI ::std::string _getContextCraftingButton() const;
261
262 MCAPI ::std::string _getContextDescendButton() const;
263
264 MCAPI ::std::string _getContextDismountButton() const;
265
266 MCAPI ::std::string _getContextDropItemButton() const;
267
268 MCAPI ::std::string _getContextEmoteButton() const;
269
270 MCAPI ::std::string _getContextImmersiveReader() const;
271
272 MCAPI ::std::string _getContextInventoryButton() const;
273
274 MCAPI ::std::string _getContextJumpButton() const;
275
276 MCAPI ::std::string _getContextToggleFlight() const;
277
278 MCAPI ::std::string _getContextUseButton() const;
279
280 MCAPI void _getCustomizableOptionValues();
281
282 MCAPI ::ui::DirtyFlag _getDirtyFlag(::ui::DirtyFlag returnValue);
283
284 MCAPI ::std::string _getEmoteName(int slot);
285
286 MCAPI void _getFloatCustomizableOptionValue(::OptionID optionID);
287
288 MCAPI ::Keymapping const& _getGamepadMapping(::Remapping::ActionEnum action) const;
289
290 MCAPI float _getHudAlpha();
291
292 MCAPI ::Keymapping const& _getKeyboardMapping(::Remapping::ActionEnum action) const;
293
294 MCAPI ::Keymapping const& _getMapping(::Remapping::ActionEnum action, ::RemappingLayout const& layout) const;
295
296 MCAPI void _handleChatMessages();
297
298 MCAPI void _handleClearTitle();
299
300 MCAPI void _handleNewActionBarMessage();
301
302 MCAPI void _handleNewPopupItemText();
303
304 MCAPI void _handleNewSubtitleText();
305
306 MCAPI void _handleNewTipText();
307
308 MCAPI void _handleSlotSelection(int slot, ::ContainerID containerId);
309
310 MCAPI void _handleSubtitleMessages();
311
312 MCAPI bool _isAutoSaveIconVisible();
313
314 MCAPI bool
315 _isToolTipsHidden(::HudScreenController::Tooltips tooltipType, ::HudScreenController::Tooltip const* tip) const;
316
317 MCAPI bool _isTouchActive() const;
318
319 MCAPI void _leaveControlCustomizationScreen();
320
321 MCAPI void _onBossEvent(::BossEventUpdateType type, ::ActorUniqueID const& id, ::BossEventPacket const& packet);
322
323 MCAPI void _onSoundEvent(
324 ::std::string const& name,
325 ::std::optional<::std::string> subtitle,
326 ::Vec3 const& pos,
327 float volume,
328 ::Vec3 const& forward,
329 ::Vec3 const& up,
330 bool isLocalPlayer
331 );
332
333 MCAPI void _pushExistingChatMessages();
334
335 MCAPI void _pushNewChatMessage(::std::string const& message, float time);
336
337 MCAPI void _pushNewSubtitleMessage(
338 ::std::string const& message,
339 float timeSec,
340 ::SoundDirection direction,
341 bool isLocalPlayer
342 );
343
344 MCAPI void _recreateSubtitleContainer();
345
346 MCAPI void _refreshChatMessages();
347
348 MCAPI void _refreshSubtitleMessages();
349
350 MCAPI void _registerEventHandlers();
351
352 MCAPI void _registerSubControllers();
353
354 MCAPI void _registerTooltips();
355
356 MCAPI bool _shouldShowLocatorBar() const;
357
358 MCAPI bool _shouldShowTags() const;
359
360 MCAPI bool _showClassicUI() const;
361
362 MCAPI bool _showPaperDoll() const;
363
364 MCAPI bool _showPocketUI() const;
365
366 MCAPI bool _showSurvivalUI() const;
367
368 MCAPI void _updateTitleText();
369
370 MCAPI void
371 addBossUI(::ActorUniqueID const& id, ::Bedrock::Safety::RedactableString name, float percent, ::BossBarColor color);
372
373 MCAPI void displayOpenEmoteInstructions(::HudScreenController::ButtonLists const& buttonLists) const;
374
375 MCAPI ::HudScreenController::ButtonLists const getButtonLists() const;
376
377 MCAPI ::std::string const getFormattedOpenChatMessage(::std::vector<::std::string> const& buttonList) const;
378
379 MCAPI ::std::string const getFormattedOpenEmoteMessage(::std::vector<::std::string> const& buttonList) const;
380
381 MCAPI ::HudScreenController::ButtonLists const getGamepadEmoteButtonLists() const;
382
383 MCAPI ::HudScreenController::ButtonLists const getKeyboardEmoteButtonLists() const;
384
385 MCAPI void onRouteChanged(
386 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
387 ::std::optional<::OreUI::RouterLocation> const& currentLocation,
388 ::OreUI::RouterAction
389 );
390
391 MCAPI void setupControlCustomizationCallbacksForOptions(::ControlOptionType controlOptionType);
392 // NOLINTEND
393
394public:
395 // static functions
396 // NOLINTBEGIN
397 MCAPI static bool _shouldShowDefaultUseTooltip(::Block const& block);
398 // NOLINTEND
399
400public:
401 // static variables
402 // NOLINTBEGIN
403 MCAPI static char const*& ROOT_CONTROL_NAME();
404
405 MCAPI static char const*& ROOT_CONTROL_NAME_INCLUDING_NAMESPACE();
406 // NOLINTEND
407
408public:
409 // constructor thunks
410 // NOLINTBEGIN
411 MCAPI void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model);
412 // NOLINTEND
413
414public:
415 // destructor thunk
416 // NOLINTBEGIN
417 MCAPI void $dtor();
418 // NOLINTEND
419
420public:
421 // virtual function thunks
422 // NOLINTBEGIN
423 MCAPI ::ui::DirtyFlag $tick();
424
425 MCAPI bool $bind(
426 ::std::string const& collectionName,
427 uint collectionNameHash,
428 int collectionIndex,
429 ::std::string const& bindingName,
430 uint bindingNameHash,
431 ::std::string const& bindingNameOverride,
432 ::UIPropertyBag& bag
433 );
434
435 MCAPI bool $bind(
436 ::std::string const& bindingName,
437 uint bindingNameHash,
438 ::std::string const& bindingNameOverride,
439 ::UIPropertyBag& bag
440 );
441
442 MCAPI ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
443
444 MCAPI void $onInit();
445
446 MCAPI void $onOpen();
447
448 MCAPI void $onScreenPushedAbove();
449
450 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
451
452 MCFOLD ::ui::SceneType $getSceneType() const;
453
454 MCAPI bool $_isStillValid() const;
455 // NOLINTEND
456
457public:
458 // vftables
459 // NOLINTBEGIN
461
462 MCNAPI static void** $vftableForScreenController();
463 // NOLINTEND
464};
Definition RedactableString.h:10
Definition Block.h:69
Definition BossEventPacket.h:23
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition GameTipScreenController.h:5
Definition HudContainerManagerController.h:14
Definition HudScreenController.h:5
static MCAPI void ** $vftableForScreenController()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
Definition Value.h:16
Definition Keymapping.h:5
Definition RouterLocation.h:7
Definition RemappingLayout.h:5
Definition ScoreboardScreenController.h:5
Definition UIPropertyBag.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition ActorUniqueID.h:10
Definition HudScreenController.h:16
Definition HudScreenController.h:18