3#include "mc/_HeaderOutputPredefine.h"
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"
37namespace Json {
class Value; }
39namespace mce {
class Color; }
51 enum class Tooltips : uchar {
61 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> chatbuttonList;
62 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> ttsButtonList;
81 enum class Type : uchar {
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;
98 Tooltip(Tooltip
const&);
104 MCAPI Tooltip(::HudScreenController::Tooltip&&);
106 MCAPI ::HudScreenController::Tooltip& operator=(::HudScreenController::Tooltip
const&);
114 MCAPI
void* $ctor(::HudScreenController::Tooltip&&);
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;
176 HudScreenController();
181 virtual ~HudScreenController() ;
183 virtual ::ui::DirtyFlag tick() ;
186 ::std::string
const& collectionName,
187 uint collectionNameHash,
189 ::std::string
const& bindingName,
190 uint bindingNameHash,
191 ::std::string
const& bindingNameOverride,
196 ::std::string
const& bindingName,
197 uint bindingNameHash,
198 ::std::string
const& bindingNameOverride,
202 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) ;
204 virtual void onInit() ;
206 virtual void onOpen() ;
208 virtual void onScreenPushedAbove() ;
210 virtual void addStaticScreenVars(::Json::Value& globalVars) ;
212 virtual ::ui::SceneType getSceneType() const ;
214 virtual
bool _isStillValid() const ;
220 MCAPI explicit HudScreenController(::std::shared_ptr<::ClientInstanceScreenModel> model);
222 MCAPI
void _bindActionIconForGamepad(
223 ::Remapping::ActionEnum action,
224 ::std::
string const& bindingNameOverride,
228 MCAPI
void _bindInventoryPromptsFlyout(
229 uint bindingNameHash,
230 ::std::
string const& bindingNameOverride,
234 MCAPI
bool _bindKeyboardTooltip(
235 ::HudScreenController::
Tooltip const& tip,
236 uint bindingNameHash,
237 ::std::
string const& bindingNameOverride,
242 _bindMenuPromptsFlyout(uint bindingNameHash, ::std::
string const& bindingNameOverride, ::UIPropertyBag& bag) const;
244 MCAPI
void _bindTooltipCollection(
245 ::std::vector<::HudScreenController::
Tooltip> const& tooltips,
247 uint bindingNameHash,
248 ::std::
string const& bindingNameOverride,
249 ::UIPropertyBag& bag,
250 ::HudScreenController::Tooltips tooltipType
254 _bindTooltipFlyout(uint bindingNameHash, ::std::
string const& bindingNameOverride, ::UIPropertyBag& bag) const;
256 MCAPI
void _checkEduDiscoveryReachable();
258 MCAPI
void _fireInitialControlTipsActivationEvent() const;
260 MCAPI ::std::
string _formatButtonList(::std::vector<::std::
string> buttonList) const;
262 MCAPI ::mce::Color _getBossColorValue(::BossBarColor barColor) const;
264 MCAPI ::std::
string _getContextAttackButton() const;
266 MCAPI ::std::
string _getContextChat() const;
268 MCAPI ::std::
string _getContextCodeBuilder() const;
270 MCAPI ::std::
string _getContextCraftingButton() const;
272 MCAPI ::std::
string _getContextDescendButton() const;
274 MCAPI ::std::
string _getContextDismountButton() const;
276 MCAPI ::std::
string _getContextDropItemButton() const;
278 MCAPI ::std::
string _getContextEmoteButton() const;
280 MCAPI ::std::
string _getContextImmersiveReader() const;
282 MCAPI ::std::
string _getContextInventoryButton() const;
284 MCAPI ::std::
string _getContextJumpButton() const;
286 MCAPI ::std::
string _getContextToggleFlight() const;
288 MCAPI ::std::
string _getContextUseButton() const;
290 MCAPI
void _getCustomizableOptionValues();
292 MCAPI ::ui::DirtyFlag _getDirtyFlag(::ui::DirtyFlag returnValue);
294 MCAPI ::std::
string _getEmoteName(
int slot);
296 MCAPI
void _getFloatCustomizableOptionValue(::OptionID optionID);
298 MCAPI ::GamePadRemappingLayout const& _getGamepadLayout() const;
300 MCAPI ::Keymapping const& _getGamepadMapping(::Remapping::ActionEnum action) const;
302 MCAPI
float _getHudAlpha();
304 MCAPI ::Keymapping const& _getKeyboardMapping(::Remapping::ActionEnum action) const;
306 MCAPI ::Keymapping const& _getMapping(::Remapping::ActionEnum action, ::RemappingLayout const& layout) const;
308 MCAPI
void _handleChatMessages();
310 MCAPI
void _handleClearTitle();
312 MCAPI
void _handleNewActionBarMessage();
314 MCAPI
void _handleNewPopupItemText();
316 MCAPI
void _handleNewTipText();
318 MCAPI
void _handleSlotSelection(
int slot, ::ContainerID containerId);
320 MCAPI
void _handleSubtitleMessages();
322 MCAPI
bool _isHudHidden() const;
325 _isToolTipsHidden(::HudScreenController::Tooltips tooltipType, ::HudScreenController::
Tooltip const* tip) const;
327 MCAPI
bool _isTouchActive() const;
329 MCAPI
void _leaveControlCustomizationScreen();
331 MCAPI
void _onBossEvent(::BossEventUpdateType type, ::ActorUniqueID const&
id, ::BossEventPacket const& packet);
333 MCAPI
void _onSoundEvent(
334 ::std::
string const& name,
335 ::std::optional<::std::
string> subtitle,
338 ::Vec3 const& forward,
342 MCAPI
void _pushExistingChatMessages();
344 MCAPI
void _pushNewChatMessage(::std::
string const& message,
float time);
346 MCAPI
void _pushNewSubtitleMessage(::std::
string const& message,
float time, ::SoundDirection direction);
348 MCAPI
void _refreshChatMessages();
350 MCAPI
void _refreshSubtitleMessages();
352 MCAPI
void _registerEventHandlers();
354 MCAPI
void _registerSubControllers();
356 MCAPI
void _registerTooltips();
358 MCAPI
bool _shouldShowControlTips() const;
360 MCAPI
bool _shouldShowLocatorBar() const;
362 MCAPI
bool _shouldShowTags() const;
364 MCAPI
bool _showClassicUI() const;
366 MCAPI
bool _showPaperDoll() const;
368 MCAPI
bool _showPocketUI() const;
370 MCAPI
bool _showPopUpItemText() const;
372 MCAPI
bool _showSurvivalUI() const;
374 MCAPI
void _updateTitleText();
377 addBossUI(::ActorUniqueID const&
id, ::Bedrock::Safety::RedactableString name,
float percent, ::BossBarColor color);
379 MCAPI
void displayOpenEmoteInstructions(::HudScreenController::
ButtonLists const& buttonLists) const;
381 MCAPI ::HudScreenController::
ButtonLists const getButtonLists() const;
383 MCAPI ::std::
string const getFormattedOpenChatMessage(::std::vector<::std::
string> const& buttonList) const;
385 MCAPI ::std::
string const getFormattedOpenEmoteMessage(::std::vector<::std::
string> const& buttonList) const;
387 MCAPI ::HudScreenController::
ButtonLists const getGamepadEmoteButtonLists() const;
389 MCAPI ::HudScreenController::
ButtonLists const getKeyboardEmoteButtonLists() const;
391 MCAPI
void onRouteChanged(
392 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
393 ::std::optional<::OreUI::RouterLocation> const& currentLocation,
394 ::OreUI::RouterAction
397 MCAPI
void setupControlCustomizationCallbacksForOptions(::ControlOptionType controlOptionType);
399 MCAPI
bool shouldChatAndEmoteInfoBeDisplayed() const;
405 MCAPI
void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model);
417 MCAPI ::ui::DirtyFlag $tick();
420 ::std::
string const& collectionName,
421 uint collectionNameHash,
423 ::std::
string const& bindingName,
424 uint bindingNameHash,
425 ::std::
string const& bindingNameOverride,
430 ::std::
string const& bindingName,
431 uint bindingNameHash,
432 ::std::
string const& bindingNameOverride,
436 MCAPI ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
438 MCAPI
void $onInit();
440 MCAPI
void $onOpen();
442 MCAPI
void $onScreenPushedAbove();
444 MCAPI
void $addStaticScreenVars(::Json::Value& globalVars);
446 MCFOLD ::ui::SceneType $getSceneType() const;
448 MCAPI
bool $_isStillValid() const;
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 Keymapping.h:5
Definition RouterLocation.h:7
Definition RemappingLayout.h:5
Definition ScoreboardScreenController.h:5
Definition UIPropertyBag.h:5
Definition ActorUniqueID.h:5