LeviLamina
Loading...
Searching...
No Matches
GuiData.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
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"
27
28// auto generated forward declare list
29// clang-format off
30class Config;
32class GuiMessage;
33class IClientInstance;
34class IOptionRegistry;
35class ItemStackBase;
36class TextObjectRoot;
37class Vec2;
39namespace Bedrock::PubSub { class Subscription; }
40namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
41// clang-format on
42
44public:
45 // GuiData inner types declare
46 // clang-format off
47 struct MessageConfig;
48 // clang-format on
49
50 // GuiData inner types define
51 struct MessageConfig {
52 public:
53 // member variables
54 // NOLINTBEGIN
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;
66 // NOLINTEND
67
68 public:
69 // prevent constructor by default
70 MessageConfig& operator=(MessageConfig const&);
71 MessageConfig();
72
73 public:
74 // member functions
75 // NOLINTBEGIN
76 MCAPI MessageConfig(::GuiData::MessageConfig const&);
77
78 MCAPI MessageConfig(
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,
84 float _lifeTime,
85 bool _forceVisible,
86 bool _ttsRequired,
87 ::std::string const& _xuid,
88 ::std::string const& _platformId
89 );
90
91 MCAPI ~MessageConfig();
92 // NOLINTEND
93
94 public:
95 // constructor thunks
96 // NOLINTBEGIN
97 MCAPI void* $ctor(::GuiData::MessageConfig const&);
98
99 MCAPI void* $ctor(
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,
105 float _lifeTime,
106 bool _forceVisible,
107 bool _ttsRequired,
108 ::std::string const& _xuid,
109 ::std::string const& _platformId
110 );
111 // NOLINTEND
112
113 public:
114 // destructor thunk
115 // NOLINTBEGIN
116 MCAPI void $dtor();
117 // NOLINTEND
118 };
119
120public:
121 // member variables
122 // NOLINTBEGIN
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;
186 // NOLINTEND
187
188public:
189 // prevent constructor by default
190 GuiData& operator=(GuiData const&);
191 GuiData(GuiData const&);
192 GuiData();
193
194public:
195 // virtual functions
196 // NOLINTBEGIN
197 virtual void onConfigChanged(::Config const&) /*override*/;
198 // NOLINTEND
199
200public:
201 // member functions
202 // NOLINTBEGIN
203 MCAPI explicit GuiData(::IClientInstance& client);
204
205 MCAPI void _addMessage(::GuiMessage message, ::ProfanityFilterContext profanityFilterContext);
206
207 MCAPI void _addMessage(::GuiData::MessageConfig messageConfig, ::ProfanityFilterContext profanityFilterContext);
208
209 MCAPI void _setSubtitleInternal(::std::string const& subtitle, ::std::optional<::std::string> filteredSubtitle);
210
211 MCAPI void _setTitleInternal(::std::string const& title, ::std::optional<::std::string> filteredTitle);
212
213 MCAPI void _tickDelayedMessages();
214
215 MCAPI void _tickItemDrop();
216
217 MCAPI void addContentLogMessage(::ContentLogMessage const& message);
218
219 MCAPI void addSubtitle(::std::string const& message, ::SoundDirection direction, bool isLocalPlayer);
220
221 MCAPI float calculateGuiScale(
222 ::Vec2 const& totalScreenSize,
223 ::Vec2 const& safeZone,
224 float forcedGuiScale,
225 ::cg::math::Rect<float> const& clientViewportModifiers
226 );
227
228 MCAPI int calculateMaxGuiScaleIndex(::Vec2 const& screenSize) const;
229
230 MCAPI int calculateOptimalGuiScaleIndex(::Vec2 const& safezoneClientScreenSize) const;
231
232 MCAPI float ceilAlignToScreenPixel(float v) const;
233
234 MCAPI ::Vec2 ceilToGuiScale(::Vec2 const& screenSize) const;
235
236 MCAPI void clearContentLogMessages();
237
238 MCAPI void clearDevConsoleScreenMessages();
239
240 MCAPI void clearPlayerMessages();
241
242 MCAPI void clearSessionState();
243
244 MCAPI void clearTitle();
245
246 MCAPI void clearTitleMessages();
247
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
254 );
255
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
262 );
263
264 MCAPI void displayClientMessage(
265 ::std::string const& message,
266 ::std::optional<::std::string> const& filteredMessage,
267 bool ttsRequired
268 );
269
270 MCAPI void displayDevConsoleMessage(::std::string const& messages);
271
272 MCAPI void displayLocalizableMessage(
273 ::std::string const& message,
274 ::std::optional<::std::string> const& filteredMessage,
275 ::std::vector<::std::string> const& params
276 );
277
278 MCAPI void
279 displayLocalizedMessage(::std::string const& message, ::std::optional<::std::string> const& filteredMessage);
280
281 MCAPI void displaySystemMessage(
282 ::std::string const& message,
283 ::std::optional<::std::string> const& filteredMessage,
284 ::std::string const& ttsMessage,
285 ::ProfanityFilterContext profanityFilterContext
286 );
287
288 MCAPI void displayTextObjectMessage(
289 ::TextObjectRoot const& textObject,
290 ::std::string const& xuid,
291 ::std::string const& platformId
292 );
293
294 MCAPI void displayTextObjectWhisperMessage(
295 ::std::string const& message,
296 ::std::string const& xuid,
297 ::std::string const& platformId
298 );
299
300 MCAPI void displayTextObjectWhisperMessage(
301 ::TextObjectRoot const& textObject,
302 ::std::string const& xuid,
303 ::std::string const& platformId
304 );
305
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
312 );
313
314 MCAPI void flashSlot(int slotId);
315
316 MCAPI float floorAlignToScreenPixel(float v) const;
317
318 MCAPI void flushQueuedDevConsoleMessages();
319
320 MCAPI int getClampedGuiScaleOffset() const;
321
322 MCAPI ::Vec2 getClientWindowOffset() const;
323
324 MCFOLD ::std::vector<::ContentLogMessage> const& getContentLogMessages() const;
325
326 MCAPI ::CoordinateCaptureType getCoordinateCaptureType() const;
327
328 MCAPI ::PlayerInventorySlotData getCurrentDropSlot() const;
329
330 MCAPI float getCurrentDropTicks() const;
331
332 MCFOLD ::mce::MaterialPtr const& getCursorMat() const;
333
334 MCFOLD ::std::vector<::std::string> const& getDevConsoleScreenMessages();
335
336 MCAPI float getGuiScale() const;
337
338 MCAPI ::RectangleArea const& getHUDHotbarRectangle() const;
339
340 MCFOLD ::std::array<::HudVisibility, 13> const& getHudVisibilityState() const;
341
342 MCAPI ::mce::MaterialPtr const& getInvFillMat() const;
343
344 MCFOLD float getInvGuiScale() const;
345
346 MCAPI ::std::string const& getLastChatMessage();
347
348 MCAPI ::std::string const& getLastContentLogMessage() const;
349
350 MCAPI ::std::string const& getLastDevConsoleMessage();
351
352 MCAPI ::std::string const getLastFilteredChatMessage();
353
354 MCAPI ::RectangleArea getLayoutCustomizationMainPanelRectangle() const;
355
356 MCAPI ::RectangleArea getLayoutCustomizationSubPanelRectangle() const;
357
358 MCFOLD ::std::vector<::GuiMessage>& getMessageList();
359
360 MCAPI bool getNewJukeboxPopupNotice(::std::string& message, ::std::string& subtitle);
361
362 MCAPI bool getNewPopupNotice(::std::string& message, ::std::string& subtitle);
363
364 MCFOLD uint64 getNumContentLogErrors() const;
365
366 MCFOLD int getNumSlots() const;
367
368 MCAPI ::IOptionRegistry const& getOptions() const;
369
370 MCAPI short getPointerX() const;
371
372 MCAPI short getPointerY() const;
373
374 MCAPI ::std::vector<::GuiMessage> getPreexistingMessages();
375
376 MCAPI ::mce::Mesh& getRcFeedbackInner();
377
378 MCFOLD ::mce::Mesh& getRcFeedbackOuter();
379
380 MCAPI ::RectangleArea getSafeScreenZoneArea() const;
381
382 MCFOLD ::ScreenSizeData const& getScreenSizeData() const;
383
384 MCFOLD ::std::string const& getServerSettings();
385
386 MCAPI uint getServerSettingsId();
387
388 MCFOLD bool getShowProgress() const;
389
390 MCFOLD ::std::vector<::GuiMessage>& getSubtitleList();
391
392 MCAPI bool getTipMessage(::std::string& message);
393
394 MCFOLD ::TitleMessage const& getTitleMessage() const;
395
396 MCAPI ::mce::Mesh& getVignette();
397
398 MCAPI ::RectangleArea getWYSIWYGBottomHudReservedArea() const;
399
400 MCAPI ::RectangleArea getWYSIWYGBottomReservedArea() const;
401
402 MCAPI ::RectangleArea getWYSIWYGLeftReservedArea() const;
403
404 MCAPI ::RectangleArea getWYSIWYGRightReservedArea() const;
405
406 MCAPI ::RectangleArea getWYSIWYGSafeScreenZoneArea() const;
407
408 MCAPI ::RectangleArea getWYSIWYGTopReservedArea() const;
409
410 MCAPI float getXToScreenRatio(float x) const;
411
412 MCAPI float getYToScreenRatio(float y) const;
413
414 MCAPI bool handleClick();
415
416 MCAPI bool isHudElementVisible(::HudElement hudElement) const;
417
418 MCFOLD bool isMuteChat() const;
419
420 MCAPI bool isOddGuiScale() const;
421
422 MCFOLD void onLevelGenerated();
423
424 MCAPI void postError(int errCode);
425
426 MCAPI ::RectangleArea const& recomputeHUDHotbarRectangle(float scale);
427
428 MCAPI ::Bedrock::PubSub::Subscription registerToGuiScaleChangedEvent(::std::function<void()> callback);
429
430 MCAPI ::Bedrock::PubSub::Subscription registerToServerFormDataAvailableEvent(::std::function<void()> callback);
431
432 MCAPI void resetTitle();
433
434 MCFOLD bool screenSizeDataValid() const;
435
436 MCAPI void setActionBarMessage(::std::string const& message, ::std::optional<::std::string> const& filteredMessage);
437
438 MCAPI void setCoordinateCaptureType(::CoordinateCaptureType coordinateCaptureType);
439
440 MCAPI void setGuiScale(float scale);
441
442 MCAPI void setHudVisibilityState(::std::vector<::HudElement> const& hudElements, ::HudVisibility hudVisibility);
443
444 MCAPI void setLastSelectedSlot(int slot, ::ContainerID containerId);
445
446 MCAPI void setMenuPointerPressed(bool pressed);
447
448 MCAPI void setMuteChat(bool isMuted);
449
450 MCFOLD void setOverlappingControlsExist(bool overlappingControlsExist);
451
452 MCAPI void setScreenSizeData(::ScreenSizeData const& screenSizeData);
453
454 MCAPI void setServerSettings(uint id, ::std::string const& settings);
455
456 MCAPI void setShowProgress(bool value);
457
458 MCAPI void setSubtitle(::std::string const& subtitle, ::std::optional<::std::string> filteredSubtitle);
459
460 MCAPI void setTextToSpeechEnabled(bool enabled);
461
462 MCAPI void setTitle(::std::string const& title, ::std::optional<::std::string> filteredTitle);
463
464 MCAPI void setTitleAnimationTimes(int fadeInTime, int stayTime, int fadeOutTime);
465
466 MCAPI ::RectangleArea setTouchToolbarArea(::RectangleArea const& toolbarArea);
467
468 MCAPI void showJukeboxPopupNotice(::std::string const& message, ::std::string const& subtitle);
469
470 MCAPI void showPopupNotice(::ItemStackBase const& item);
471
472 MCAPI void showPopupNotice(::std::string const& message, ::std::string const& subtitle);
473
474 MCAPI void showTipMessage(::std::string const& message);
475
476 MCAPI void tick();
477
478 MCAPI void toggleMuteChat();
479
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
486 );
487
488 MCAPI void updatePointerLocation(short x, short y);
489
490 MCAPI void useEditorGuiScale(bool shouldUse);
491
492 MCAPI bool wasToolbarClicked() const;
493 // NOLINTEND
494
495public:
496 // static functions
497 // NOLINTBEGIN
498 MCAPI static int calculateMinimumAllowedScale(int maxScale);
499
500 MCAPI static float resolveGuiScale(int index);
501 // NOLINTEND
502
503public:
504 // static variables
505 // NOLINTBEGIN
506 MCAPI static float const& BUTTONS_TRANSPARENCY();
507
508 MCAPI static float const& DropTicks();
509
510 MCAPI static ::std::array<float, 8> const& GUI_SCALE_VALUES();
511 // NOLINTEND
512
513public:
514 // constructor thunks
515 // NOLINTBEGIN
516 MCAPI void* $ctor(::IClientInstance& client);
517 // NOLINTEND
518
519public:
520 // virtual function thunks
521 // NOLINTBEGIN
522 MCAPI void $onConfigChanged(::Config const&);
523 // NOLINTEND
524
525public:
526 // vftables
527 // NOLINTBEGIN
528 MCNAPI static void** $vftableForIConfigListener();
529
530 MCNAPI static void** $vftableForAppPlatformListener();
531
533 // NOLINTEND
534};
Definition AppPlatformListener.h:15
Definition EnableNonOwnerReferences.h:7
Definition Subscription.h:10
Definition Config.h:5
Definition DevConsoleLogger.h:5
Definition GuiData.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 Vec2.h:5
Definition ContentLogMessage.h:5
Definition GuiData.h:13