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