3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/game/CoordinateCaptureType.h"
7#include "mc/client/game/IConfigListener.h"
8#include "mc/client/gui/GuiMessage.h"
9#include "mc/client/gui/ScreenSizeData.h"
10#include "mc/client/gui/SoundDirection.h"
11#include "mc/client/gui/TitleMessage.h"
12#include "mc/client/gui/screens/MenuPointer.h"
13#include "mc/deps/application/AppPlatformListener.h"
14#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
15#include "mc/deps/core/utility/NonOwnerPointer.h"
16#include "mc/deps/core/utility/pub_sub/Publisher.h"
17#include "mc/deps/core_graphics/math/Rect.h"
18#include "mc/deps/input/RectangleArea.h"
19#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
20#include "mc/deps/minecraft_renderer/renderer/Mesh.h"
21#include "mc/platform/threading/Mutex.h"
22#include "mc/util/HudElement.h"
23#include "mc/util/HudVisibility.h"
24#include "mc/util/ProfanityFilterContext.h"
25#include "mc/world/ContainerID.h"
26#include "mc/world/actor/player/PlayerInventorySlotData.h"
40namespace Bedrock::PubSub::ThreadModel {
struct MultiThreaded; }
55 ::ll::TypedStorage<4, 4, ::GuiMessage::MessageType> messageType;
56 ::ll::TypedStorage<8, 32, ::std::string> username;
57 ::ll::TypedStorage<8, 32, ::std::string> message;
58 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> filteredMessage;
59 ::ll::TypedStorage<8, 32, ::std::string> ttsMessage;
60 ::ll::TypedStorage<4, 4, float> lifeTime;
61 ::ll::TypedStorage<1, 1, bool> forceVisible;
62 ::ll::TypedStorage<1, 1, bool> ttsRequired;
63 ::ll::TypedStorage<8, 32, ::std::string> xuid;
64 ::ll::TypedStorage<8, 32, ::std::string const> platformId;
65 ::ll::TypedStorage<1, 1, bool> enableEmoticonify;
70 MessageConfig& operator=(MessageConfig
const&);
76 MCAPI MessageConfig(::GuiData::MessageConfig
const&);
79 ::GuiMessage::MessageType _messageType,
80 ::std::string
const& _username,
81 ::std::string
const& _message,
82 ::std::optional<::std::string>
const& _filteredMessage,
83 ::std::string
const& _ttsMessage,
87 ::std::string
const& _xuid,
88 ::std::string
const& _platformId
91 MCAPI ~MessageConfig();
97 MCAPI
void* $ctor(::GuiData::MessageConfig
const&);
100 ::GuiMessage::MessageType _messageType,
101 ::std::string
const& _username,
102 ::std::string
const& _message,
103 ::std::optional<::std::string>
const& _filteredMessage,
104 ::std::string
const& _ttsMessage,
108 ::std::string
const& _xuid,
109 ::std::string
const& _platformId
123 ::ll::TypedStorage<4, 24, ::ScreenSizeData> mScreenSizeData;
124 ::ll::TypedStorage<1, 1, bool> mScreenSizeDataValid;
125 ::ll::TypedStorage<4, 4, float> mGuiScale;
126 ::ll::TypedStorage<4, 4, float> mInvGuiScale;
127 ::ll::TypedStorage<1, 1, bool> mOverlappingControlsExist;
128 ::ll::TypedStorage<1, 1, bool> mIsCurrentlyActive;
129 ::ll::TypedStorage<8, 16, ::std::set<int>> mPostedErrors;
130 ::ll::TypedStorage<1, 1, ::MenuPointer> mMenuPointer;
131 ::ll::TypedStorage<2, 2, short> mPointerX;
132 ::ll::TypedStorage<2, 2, short> mPointerY;
133 ::ll::TypedStorage<1, 1, bool> mHasShowPreexistingMessages;
134 ::ll::TypedStorage<1, 1, bool> mToolbarWasRendered;
135 ::ll::TypedStorage<4, 4, int> mPrevSelectedSlot;
136 ::ll::TypedStorage<1, 1, ::ContainerID> mPrevSelectedInventoryContainer;
137 ::ll::TypedStorage<4, 4, int> mFlashSlotId;
138 ::ll::TypedStorage<8, 8, double> mFlashSlotStartTime;
139 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
140 ::ll::TypedStorage<4, 16, ::RectangleArea> mToolbarArea;
141 ::ll::TypedStorage<4, 16, ::RectangleArea> mToolbarAreaContainer;
142 ::ll::TypedStorage<8, 32, ::std::string> mLastPopupText;
143 ::ll::TypedStorage<8, 32, ::std::string> mLastPopupSubtitleText;
144 ::ll::TypedStorage<8, 32, ::std::string> mLastJukeboxPopupText;
145 ::ll::TypedStorage<8, 32, ::std::string> mLastJukeboxPopupSubtitleText;
146 ::ll::TypedStorage<4, 4, int> mTickCount;
147 ::ll::TypedStorage<4, 4, float> mItemNameOverlayTime;
148 ::ll::TypedStorage<4, 4, float> mJukeboxNameOverlayTime;
149 ::ll::TypedStorage<1, 1, bool> mPopupNoticeDirty;
150 ::ll::TypedStorage<1, 1, bool> mJukeboxPopupNoticeDirty;
151 ::ll::TypedStorage<8, 24, ::std::vector<::GuiMessage>> mGuiMessages;
152 ::ll::TypedStorage<8, 24, ::std::vector<::GuiMessage>> mSubtitleMessages;
153 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mDevConsoleMessages;
154 ::ll::TypedStorage<4, 4, int> mMaxDevConsoleMessages;
155 ::ll::TypedStorage<8, 24, ::std::vector<::ContentLogMessage>> mContentLogMessages;
156 ::ll::TypedStorage<8, 8, uint64> mContentLogErrorCount;
157 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mPerfTurtleMessages;
158 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleMessage;
159 ::ll::TypedStorage<4, 52, ::std::array<::HudVisibility, 13>> mHudVisibilityState;
160 ::ll::TypedStorage<4, 4, uint> mServerSettingsId;
161 ::ll::TypedStorage<8, 32, ::std::string> mServerSettings;
162 ::ll::TypedStorage<1, 1, bool> mMuteChat;
163 ::ll::TypedStorage<4, 4, float> mCurrentDropTicks;
164 ::ll::TypedStorage<4, 8, ::PlayerInventorySlotData> mCurrentDropSlot;
165 ::ll::TypedStorage<4, 8, ::PlayerInventorySlotData> mLastSelectedSlot;
166 ::ll::TypedStorage<1, 1, bool> mShowProgress;
167 ::ll::TypedStorage<8, 32, ::std::string> mTipMessage;
168 ::ll::TypedStorage<4, 4, float> mTipMessageLength;
169 ::ll::TypedStorage<8, 552, ::mce::Mesh> mRcFeedbackOuter;
170 ::ll::TypedStorage<8, 552, ::mce::Mesh> mRcFeedbackInner;
171 ::ll::TypedStorage<8, 552, ::mce::Mesh> mVignette;
172 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mInvFillMat;
173 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mCursorMat;
174 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::DevConsoleLogger>> mDevConsoleLogger;
175 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTickTime;
176 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::std::vector<::GuiMessage>>> mDelayedMessages;
177 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mQueuedDevConsoleMessages;
178 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mQueuedDevMessagesMutex;
179 ::ll::TypedStorage<1, 1, bool> mUseEditorGuiScale;
180 ::ll::TypedStorage<4, 16, ::RectangleArea> mHUDHotbarRectangle;
181 ::ll::TypedStorage<1, 1, ::CoordinateCaptureType> mCoordinateCaptureType;
182 ::ll::TypedStorage<8, 128, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
183 mOnGuiScaleUpdatedPublisher;
184 ::ll::TypedStorage<8, 128, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
185 mServerFormDataAvailable;
190 GuiData& operator=(GuiData
const&);
191 GuiData(GuiData
const&);
197 virtual void onConfigChanged(::Config
const&) ;
203 MCAPI
explicit GuiData(::IClientInstance& client);
205 MCAPI
void _addMessage(::GuiMessage message, ::ProfanityFilterContext profanityFilterContext);
207 MCAPI
void _addMessage(::GuiData::MessageConfig messageConfig, ::ProfanityFilterContext profanityFilterContext);
209 MCAPI
void _setSubtitleInternal(::std::string
const& subtitle, ::std::optional<::std::string> filteredSubtitle);
211 MCAPI
void _setTitleInternal(::std::string
const& title, ::std::optional<::std::string> filteredTitle);
213 MCAPI
void _tickDelayedMessages();
215 MCAPI
void _tickItemDrop();
217 MCAPI
void addContentLogMessage(::ContentLogMessage
const& message);
219 MCAPI
void addSubtitle(::std::string
const& message, ::SoundDirection direction,
bool isLocalPlayer);
221 MCAPI
float calculateGuiScale(
222 ::Vec2
const& totalScreenSize,
223 ::Vec2
const& safeZone,
224 float forcedGuiScale,
225 ::cg::math::Rect<float>
const& clientViewportModifiers
228 MCAPI
int calculateMaxGuiScaleIndex(::Vec2
const& screenSize)
const;
230 MCAPI
int calculateOptimalGuiScaleIndex(::Vec2
const& safezoneClientScreenSize)
const;
232 MCAPI
float ceilAlignToScreenPixel(
float v)
const;
234 MCAPI ::Vec2 ceilToGuiScale(::Vec2
const& screenSize)
const;
236 MCAPI
void clearContentLogMessages();
238 MCAPI
void clearDevConsoleScreenMessages();
240 MCAPI
void clearPlayerMessages();
242 MCAPI
void clearSessionState();
244 MCAPI
void clearTitle();
246 MCAPI
void clearTitleMessages();
248 MCAPI
void displayAnnouncementMessage(
249 ::std::string
const& author,
250 ::std::string
const& message,
251 ::std::optional<::std::string>
const& filteredMessage,
252 ::std::string
const& xuid,
253 ::std::string
const& platformId
256 MCAPI
void displayChatMessage(
257 ::std::string
const& author,
258 ::std::string
const& message,
259 ::std::optional<::std::string>
const& filteredMessage,
260 ::std::string
const& xuid,
261 ::std::string
const& platformId
264 MCAPI
void displayClientMessage(
265 ::std::string
const& message,
266 ::std::optional<::std::string>
const& filteredMessage,
270 MCAPI
void displayDevConsoleMessage(::std::string
const& messages);
272 MCAPI
void displayLocalizableMessage(
273 ::std::string
const& message,
274 ::std::optional<::std::string>
const& filteredMessage,
275 ::std::vector<::std::string>
const& params
279 displayLocalizedMessage(::std::string
const& message, ::std::optional<::std::string>
const& filteredMessage);
281 MCAPI
void displaySystemMessage(
282 ::std::string
const& message,
283 ::std::optional<::std::string>
const& filteredMessage,
284 ::std::string
const& ttsMessage,
285 ::ProfanityFilterContext profanityFilterContext
288 MCAPI
void displayTextObjectMessage(
289 ::TextObjectRoot
const& textObject,
290 ::std::string
const& xuid,
291 ::std::string
const& platformId
294 MCAPI
void displayTextObjectWhisperMessage(
295 ::std::string
const& message,
296 ::std::string
const& xuid,
297 ::std::string
const& platformId
300 MCAPI
void displayTextObjectWhisperMessage(
301 ::TextObjectRoot
const& textObject,
302 ::std::string
const& xuid,
303 ::std::string
const& platformId
306 MCAPI
void displayWhisperMessage(
307 ::std::string
const& author,
308 ::std::string
const& message,
309 ::std::optional<::std::string>
const& filteredMessage,
310 ::std::string
const& xuid,
311 ::std::string
const& platformId
314 MCAPI
void flashSlot(
int slotId);
316 MCAPI
float floorAlignToScreenPixel(
float v)
const;
318 MCAPI
void flushQueuedDevConsoleMessages();
320 MCAPI
int getClampedGuiScaleOffset()
const;
322 MCAPI ::Vec2 getClientWindowOffset()
const;
324 MCFOLD ::std::vector<::ContentLogMessage>
const& getContentLogMessages()
const;
326 MCAPI ::CoordinateCaptureType getCoordinateCaptureType()
const;
328 MCAPI ::PlayerInventorySlotData getCurrentDropSlot()
const;
330 MCAPI
float getCurrentDropTicks()
const;
332 MCFOLD ::mce::MaterialPtr
const& getCursorMat()
const;
334 MCFOLD ::std::vector<::std::string>
const& getDevConsoleScreenMessages();
336 MCAPI
float getGuiScale()
const;
338 MCAPI ::RectangleArea
const& getHUDHotbarRectangle()
const;
340 MCFOLD ::std::array<::HudVisibility, 13>
const& getHudVisibilityState()
const;
342 MCAPI ::mce::MaterialPtr
const& getInvFillMat()
const;
344 MCFOLD
float getInvGuiScale()
const;
346 MCAPI ::std::string
const& getLastChatMessage();
348 MCAPI ::std::string
const& getLastContentLogMessage()
const;
350 MCAPI ::std::string
const& getLastDevConsoleMessage();
352 MCAPI ::std::string
const getLastFilteredChatMessage();
354 MCAPI ::RectangleArea getLayoutCustomizationMainPanelRectangle()
const;
356 MCAPI ::RectangleArea getLayoutCustomizationSubPanelRectangle()
const;
358 MCFOLD ::std::vector<::GuiMessage>& getMessageList();
360 MCAPI
bool getNewJukeboxPopupNotice(::std::string& message, ::std::string& subtitle);
362 MCAPI
bool getNewPopupNotice(::std::string& message, ::std::string& subtitle);
364 MCFOLD uint64 getNumContentLogErrors()
const;
366 MCFOLD
int getNumSlots()
const;
368 MCAPI ::IOptionRegistry
const& getOptions()
const;
370 MCAPI
short getPointerX()
const;
372 MCAPI
short getPointerY()
const;
374 MCAPI ::std::vector<::GuiMessage> getPreexistingMessages();
376 MCAPI ::mce::Mesh& getRcFeedbackInner();
378 MCFOLD ::mce::Mesh& getRcFeedbackOuter();
380 MCAPI ::RectangleArea getSafeScreenZoneArea()
const;
382 MCFOLD ::ScreenSizeData
const& getScreenSizeData()
const;
384 MCFOLD ::std::string
const& getServerSettings();
386 MCAPI uint getServerSettingsId();
388 MCFOLD
bool getShowProgress()
const;
390 MCFOLD ::std::vector<::GuiMessage>& getSubtitleList();
392 MCAPI
bool getTipMessage(::std::string& message);
394 MCFOLD ::TitleMessage
const& getTitleMessage()
const;
396 MCAPI ::mce::Mesh& getVignette();
398 MCAPI ::RectangleArea getWYSIWYGBottomHudReservedArea()
const;
400 MCAPI ::RectangleArea getWYSIWYGBottomReservedArea()
const;
402 MCAPI ::RectangleArea getWYSIWYGLeftReservedArea()
const;
404 MCAPI ::RectangleArea getWYSIWYGRightReservedArea()
const;
406 MCAPI ::RectangleArea getWYSIWYGSafeScreenZoneArea()
const;
408 MCAPI ::RectangleArea getWYSIWYGTopReservedArea()
const;
410 MCAPI
float getXToScreenRatio(
float x)
const;
412 MCAPI
float getYToScreenRatio(
float y)
const;
414 MCAPI
bool handleClick();
416 MCAPI
bool isHudElementVisible(::HudElement hudElement)
const;
418 MCFOLD
bool isMuteChat()
const;
420 MCAPI
bool isOddGuiScale()
const;
422 MCFOLD
void onLevelGenerated();
424 MCAPI
void postError(
int errCode);
426 MCAPI ::RectangleArea
const& recomputeHUDHotbarRectangle(
float scale);
428 MCAPI ::Bedrock::PubSub::Subscription registerToGuiScaleChangedEvent(::std::function<
void()> callback);
430 MCAPI ::Bedrock::PubSub::Subscription registerToServerFormDataAvailableEvent(::std::function<
void()> callback);
432 MCAPI
void resetTitle();
434 MCFOLD
bool screenSizeDataValid()
const;
436 MCAPI
void setActionBarMessage(::std::string
const& message, ::std::optional<::std::string>
const& filteredMessage);
438 MCAPI
void setCoordinateCaptureType(::CoordinateCaptureType coordinateCaptureType);
440 MCAPI
void setGuiScale(
float scale);
442 MCAPI
void setHudVisibilityState(::std::vector<::HudElement>
const& hudElements, ::HudVisibility hudVisibility);
444 MCAPI
void setLastSelectedSlot(
int slot, ::ContainerID containerId);
446 MCAPI
void setMenuPointerPressed(
bool pressed);
448 MCAPI
void setMuteChat(
bool isMuted);
450 MCFOLD
void setOverlappingControlsExist(
bool overlappingControlsExist);
452 MCAPI
void setScreenSizeData(::ScreenSizeData
const& screenSizeData);
454 MCAPI
void setServerSettings(uint
id, ::std::string
const& settings);
456 MCAPI
void setShowProgress(
bool value);
458 MCAPI
void setSubtitle(::std::string
const& subtitle, ::std::optional<::std::string> filteredSubtitle);
460 MCAPI
void setTextToSpeechEnabled(
bool enabled);
462 MCAPI
void setTitle(::std::string
const& title, ::std::optional<::std::string> filteredTitle);
464 MCAPI
void setTitleAnimationTimes(
int fadeInTime,
int stayTime,
int fadeOutTime);
466 MCAPI ::RectangleArea setTouchToolbarArea(::RectangleArea
const& toolbarArea);
468 MCAPI
void showJukeboxPopupNotice(::std::string
const& message, ::std::string
const& subtitle);
470 MCAPI
void showPopupNotice(::ItemStackBase
const& item);
472 MCAPI
void showPopupNotice(::std::string
const& message, ::std::string
const& subtitle);
474 MCAPI
void showTipMessage(::std::string
const& message);
478 MCAPI
void toggleMuteChat();
480 MCAPI
void updateGuiScaleAndScreenSize(
481 ::Vec2
const& totalScreenSize,
482 ::Vec2
const& safeZone,
483 float forcedGuiScale,
484 ::Vec2
const& clientScreenSize,
485 ::cg::math::Rect<float>
const& clientViewportModifiers
488 MCAPI
void updatePointerLocation(
short x,
short y);
490 MCAPI
void useEditorGuiScale(
bool shouldUse);
492 MCAPI
bool wasToolbarClicked()
const;
498 MCAPI
static int calculateMinimumAllowedScale(
int maxScale);
500 MCAPI
static float resolveGuiScale(
int index);
506 MCAPI
static float const& BUTTONS_TRANSPARENCY();
508 MCAPI
static float const& DropTicks();
510 MCAPI static ::std::array<float, 8>
const& GUI_SCALE_VALUES();
516 MCAPI
void* $ctor(::IClientInstance& client);
522 MCAPI
void $onConfigChanged(::Config
const&);
Definition EnableNonOwnerReferences.h:7
Definition Subscription.h:10
Definition DevConsoleLogger.h:5
static MCAPI void ** $vftableForAppPlatformListener()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForIConfigListener()
Definition GuiMessage.h:5
Definition IClientInstance.h:5
Definition IConfigListener.h:5
Definition IOptionRegistry.h:5
Definition ItemStackBase.h:52
Definition TextObjectRoot.h:17
Definition MultiThreaded.h:7
Definition ContentLogMessage.h:5