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