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/HudVisibility.h"
23#include "mc/util/ProfanityFilterContext.h"
24#include "mc/world/ContainerID.h"
25#include "mc/world/actor/player/PlayerInventorySlotData.h"
26
27// auto generated forward declare list
28// clang-format off
29class Config;
31class GuiMessage;
32class IClientInstance;
33class ItemStackBase;
34class TextObjectRoot;
35class Vec2;
37namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
38// clang-format on
39
41public:
42 // GuiData inner types declare
43 // clang-format off
44 struct MessageConfig;
45 // clang-format on
46
47 // GuiData inner types define
48 struct MessageConfig {
49 public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<4, 4, ::GuiMessage::MessageType> messageType;
53 ::ll::TypedStorage<8, 32, ::std::string> username;
54 ::ll::TypedStorage<8, 32, ::std::string> message;
55 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> filteredMessage;
56 ::ll::TypedStorage<8, 32, ::std::string> ttsMessage;
57 ::ll::TypedStorage<4, 4, float> lifeTime;
58 ::ll::TypedStorage<1, 1, bool> forceVisible;
59 ::ll::TypedStorage<1, 1, bool> ttsRequired;
60 ::ll::TypedStorage<8, 32, ::std::string> xuid;
61 ::ll::TypedStorage<8, 32, ::std::string const> platformId;
62 ::ll::TypedStorage<1, 1, bool> enableEmoticonify;
63 // NOLINTEND
64
65 public:
66 // prevent constructor by default
67 MessageConfig& operator=(MessageConfig const&);
68 MessageConfig();
69
70 public:
71 // member functions
72 // NOLINTBEGIN
73 MCAPI MessageConfig(::GuiData::MessageConfig const&);
74
75 MCAPI ~MessageConfig();
76 // NOLINTEND
77
78 public:
79 // constructor thunks
80 // NOLINTBEGIN
81 MCAPI void* $ctor(::GuiData::MessageConfig const&);
82 // NOLINTEND
83
84 public:
85 // destructor thunk
86 // NOLINTBEGIN
87 MCAPI void $dtor();
88 // NOLINTEND
89 };
90
91public:
92 // member variables
93 // NOLINTBEGIN
94 ::ll::TypedStorage<4, 24, ::ScreenSizeData> mScreenSizeData;
95 ::ll::TypedStorage<1, 1, bool> mScreenSizeDataValid;
96 ::ll::TypedStorage<4, 4, float> mGuiScale;
97 ::ll::TypedStorage<4, 4, float> mInvGuiScale;
98 ::ll::TypedStorage<1, 1, bool> mOverlappingControlsExist;
99 ::ll::TypedStorage<1, 1, bool> mIsCurrentlyActive;
100 ::ll::TypedStorage<8, 16, ::std::set<int>> mPostedErrors;
101 ::ll::TypedStorage<1, 1, ::MenuPointer> mMenuPointer;
102 ::ll::TypedStorage<2, 2, short> mPointerX;
103 ::ll::TypedStorage<2, 2, short> mPointerY;
104 ::ll::TypedStorage<1, 1, bool> mHasShowPreexistingMessages;
105 ::ll::TypedStorage<1, 1, bool> mToolbarWasRendered;
106 ::ll::TypedStorage<4, 4, int> mPrevSelectedSlot;
107 ::ll::TypedStorage<1, 1, ::ContainerID> mPrevSelectedInventoryContainer;
108 ::ll::TypedStorage<4, 4, int> mFlashSlotId;
109 ::ll::TypedStorage<8, 8, double> mFlashSlotStartTime;
110 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
111 ::ll::TypedStorage<4, 16, ::RectangleArea> mToolbarArea;
112 ::ll::TypedStorage<4, 16, ::RectangleArea> mToolbarAreaContainer;
113 ::ll::TypedStorage<8, 32, ::std::string> mLastPopupText;
114 ::ll::TypedStorage<8, 32, ::std::string> mLastPopupSubtitleText;
115 ::ll::TypedStorage<8, 32, ::std::string> mLastJukeboxPopupText;
116 ::ll::TypedStorage<8, 32, ::std::string> mLastJukeboxPopupSubtitleText;
117 ::ll::TypedStorage<4, 4, int> mTickCount;
118 ::ll::TypedStorage<4, 4, float> mItemNameOverlayTime;
119 ::ll::TypedStorage<4, 4, float> mJukeboxNameOverlayTime;
120 ::ll::TypedStorage<1, 1, bool> mPopupNoticeDirty;
121 ::ll::TypedStorage<1, 1, bool> mJukeboxPopupNoticeDirty;
122 ::ll::TypedStorage<8, 24, ::std::vector<::GuiMessage>> mGuiMessages;
123 ::ll::TypedStorage<8, 24, ::std::vector<::GuiMessage>> mSubtitleMessages;
124 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mDevConsoleMessages;
125 ::ll::TypedStorage<4, 4, int> mMaxDevConsoleMessages;
126 ::ll::TypedStorage<8, 24, ::std::vector<::ContentLogMessage>> mContentLogMessages;
127 ::ll::TypedStorage<8, 8, uint64> mContentLogErrorCount;
128 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mPerfTurtleMessages;
129 ::ll::TypedStorage<8, 232, ::TitleMessage> mTitleMessage;
130 ::ll::TypedStorage<4, 52, ::std::array<::HudVisibility, 13>> mHudVisibilityState;
131 ::ll::TypedStorage<4, 4, uint> mServerSettingsId;
132 ::ll::TypedStorage<8, 32, ::std::string> mServerSettings;
133 ::ll::TypedStorage<1, 1, bool> mMuteChat;
134 ::ll::TypedStorage<4, 4, float> mCurrentDropTicks;
135 ::ll::TypedStorage<4, 8, ::PlayerInventorySlotData> mCurrentDropSlot;
136 ::ll::TypedStorage<4, 8, ::PlayerInventorySlotData> mLastSelectedSlot;
137 ::ll::TypedStorage<1, 1, bool> mShowProgress;
138 ::ll::TypedStorage<8, 32, ::std::string> mTipMessage;
139 ::ll::TypedStorage<4, 4, float> mTipMessageLength;
140 ::ll::TypedStorage<8, 528, ::mce::Mesh> mRcFeedbackOuter;
141 ::ll::TypedStorage<8, 528, ::mce::Mesh> mRcFeedbackInner;
142 ::ll::TypedStorage<8, 528, ::mce::Mesh> mVignette;
143 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mInvFillMat;
144 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mCursorMat;
145 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::DevConsoleLogger>> mDevConsoleLogger;
146 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTickTime;
147 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::std::vector<::GuiMessage>>> mDelayedMessages;
148 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mQueuedDevConsoleMessages;
149 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mQueuedDevMessagesMutex;
150 ::ll::TypedStorage<1, 1, bool> mUseEditorGuiScale;
151 ::ll::TypedStorage<4, 16, ::RectangleArea> mHUDHotbarRectangle;
152 ::ll::TypedStorage<1, 1, ::CoordinateCaptureType> mCoordinateCaptureType;
153 ::ll::TypedStorage<8, 128, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
154 mOnGuiScaleUpdatedPublisher;
155 ::ll::TypedStorage<8, 128, ::Bedrock::PubSub::Publisher<void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
156 mServerFormDataAvailable;
157 // NOLINTEND
158
159public:
160 // prevent constructor by default
161 GuiData& operator=(GuiData const&);
162 GuiData(GuiData const&);
163 GuiData();
164
165public:
166 // virtual functions
167 // NOLINTBEGIN
168 virtual void onConfigChanged(::Config const& c) /*override*/;
169
170 virtual ~GuiData() /*override*/;
171 // NOLINTEND
172
173public:
174 // member functions
175 // NOLINTBEGIN
176 MCAPI explicit GuiData(::IClientInstance& client);
177
178 MCAPI void _addMessage(::GuiMessage message, ::ProfanityFilterContext profanityFilterContext);
179
180 MCAPI void _addMessage(::GuiData::MessageConfig messageConfig, ::ProfanityFilterContext profanityFilterContext);
181
182 MCAPI void _setSubtitleInternal(::std::string const& subtitle, ::std::optional<::std::string> filteredSubtitle);
183
184 MCAPI void _setTitleInternal(::std::string const& title, ::std::optional<::std::string> filteredTitle);
185
186 MCAPI void _tickDelayedMessages();
187
188 MCAPI void _tickItemDrop();
189
190 MCAPI void addContentLogMessage(::ContentLogMessage const& message);
191
192 MCAPI void addSubtitle(::std::string const& message, ::SoundDirection direction);
193
194 MCAPI float calculateGuiScale(
195 ::Vec2 const& totalScreenSize,
196 ::Vec2 const& safeZone,
197 float forcedGuiScale,
198 ::cg::math::Rect<float> const& clientViewportModifiers
199 );
200
201 MCAPI int calculateOptimalGuiScaleIndex(::Vec2 const& safezoneClientScreenSize) const;
202
203 MCAPI void clearPlayerMessages();
204
205 MCAPI void clearSessionState();
206
207 MCAPI void displayAnnouncementMessage(
208 ::std::string const& author,
209 ::std::string const& message,
210 ::std::optional<::std::string> const& filteredMessage,
211 ::std::string const& xuid,
212 ::std::string const& platformId
213 );
214
215 MCAPI void displayChatMessage(
216 ::std::string const& author,
217 ::std::string const& message,
218 ::std::optional<::std::string> const& filteredMessage,
219 ::std::string const& xuid,
220 ::std::string const& platformId
221 );
222
223 MCAPI void displayClientMessage(
224 ::std::string const& message,
225 ::std::optional<::std::string> const& filteredMessage,
226 bool ttsRequired
227 );
228
229 MCAPI void displayDevConsoleMessage(::std::string const& messages);
230
231 MCAPI void displayLocalizableMessage(
232 ::std::string const& message,
233 ::std::optional<::std::string> const& filteredMessage,
234 ::std::vector<::std::string> const& params
235 );
236
237 MCAPI void
238 displayLocalizedMessage(::std::string const& message, ::std::optional<::std::string> const& filteredMessage);
239
240 MCAPI void displaySystemMessage(
241 ::std::string const& message,
242 ::std::optional<::std::string> const& filteredMessage,
243 ::std::string const& ttsMessage,
244 ::ProfanityFilterContext profanityFilterContext
245 );
246
247 MCAPI void displayTextObjectMessage(
248 ::TextObjectRoot const& textObject,
249 ::std::string const& xuid,
250 ::std::string const& platformId
251 );
252
253 MCAPI void displayTextObjectWhisperMessage(
254 ::std::string const& message,
255 ::std::string const& xuid,
256 ::std::string const& platformId
257 );
258
259 MCAPI void displayWhisperMessage(
260 ::std::string const& author,
261 ::std::string const& message,
262 ::std::optional<::std::string> const& filteredMessage,
263 ::std::string const& xuid,
264 ::std::string const& platformId
265 );
266
267 MCAPI float floorAlignToScreenPixel(float v) const;
268
269 MCAPI void flushQueuedDevConsoleMessages();
270
271 MCAPI float getGuiScale() const;
272
273 MCAPI ::RectangleArea getLayoutCustomizationMainPanelRectangle() const;
274
275 MCAPI ::std::vector<::GuiMessage> getPreexistingMessages();
276
277 MCAPI ::RectangleArea getSafeScreenZoneArea() const;
278
279 MCAPI ::RectangleArea getWYSIWYGBottomHudReservedArea() const;
280
281 MCAPI ::RectangleArea getWYSIWYGSafeScreenZoneArea() const;
282
283 MCAPI ::RectangleArea getWYSIWYGTopReservedArea() const;
284
285 MCAPI bool handleClick();
286
287 MCAPI bool isOddGuiScale() const;
288
289 MCAPI void postError(int errCode);
290
291 MCAPI ::RectangleArea const& recomputeHUDHotbarRectangle(float scale);
292
293 MCAPI void setActionBarMessage(::std::string const& message, ::std::optional<::std::string> const& filteredMessage);
294
295 MCAPI void setScreenSizeData(::ScreenSizeData const& screenSizeData);
296
297 MCAPI void setTextToSpeechEnabled(bool enabled);
298
299 MCAPI ::RectangleArea setTouchToolbarArea(::RectangleArea const& toolbarArea);
300
301 MCAPI void showPopupNotice(::ItemStackBase const& item);
302
303 MCAPI void showPopupNotice(::std::string const& message, ::std::string const& subtitle);
304
305 MCAPI void tick();
306 // NOLINTEND
307
308public:
309 // static functions
310 // NOLINTBEGIN
311 MCAPI static int getGuiScaleIndexForLargeScreen(::Vec2 const& screenSize);
312
313 MCAPI static int getGuiScaleIndexForSmallScreen(::Vec2 const& screenSize);
314
315 MCAPI static int getGuiScaleIndexForSplitscreenConsole(::Vec2 const& screenSize);
316 // NOLINTEND
317
318public:
319 // static variables
320 // NOLINTBEGIN
321 MCAPI static ::std::array<float, 8> const& GUI_SCALE_VALUES();
322 // NOLINTEND
323
324public:
325 // constructor thunks
326 // NOLINTBEGIN
327 MCAPI void* $ctor(::IClientInstance& client);
328 // NOLINTEND
329
330public:
331 // destructor thunk
332 // NOLINTBEGIN
333 MCAPI void $dtor();
334 // NOLINTEND
335
336public:
337 // virtual function thunks
338 // NOLINTBEGIN
339 MCAPI void $onConfigChanged(::Config const& c);
340 // NOLINTEND
341
342public:
343 // vftables
344 // NOLINTBEGIN
345 MCNAPI static void** $vftableForIConfigListener();
346
347 MCNAPI static void** $vftableForAppPlatformListener();
348
350 // NOLINTEND
351};
Definition AppPlatformListener.h:15
Definition EnableNonOwnerReferences.h:7
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
MCAPI void $dtor()
Definition ItemStackBase.h:44
Definition TextObjectRoot.h:14
Definition Vec2.h:5
Definition MultiThreaded.h:12
Definition ContentLogMessage.h:5
Definition GuiData.h:13