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