LeviLamina
Loading...
Searching...
No Matches
RealmsSettingsScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/DirtyFlag.h"
7#include "mc/client/gui/screens/controllers/ModalScreenButtonId.h"
8#include "mc/client/gui/screens/controllers/ModalScreenButtonMode.h"
9#include "mc/client/gui/screens/controllers/ModalScreenData.h"
10#include "mc/client/gui/screens/controllers/MultiplayerLockState.h"
11#include "mc/client/gui/screens/controllers/SettingsScreenControllerBase.h"
12#include "mc/client/network/realms/ConfigInfo.h"
13#include "mc/client/network/realms/SubscriptionInfo.h"
14#include "mc/client/network/realms/World.h"
15#include "mc/client/network/realms/WorldBackupList.h"
16#include "mc/client/services/clubs/ClubModel.h"
17#include "mc/deps/core/resource/PackType.h"
18#include "mc/platform/threading/Mutex.h"
19#include "mc/world/level/storage/GameRules.h"
20
21// auto generated forward declare list
22// clang-format off
23class DlcUIWrapper;
24class IContentManager;
27class Pack;
31class UIPropertyBag;
32struct GameRuleId;
33struct PackContentItem;
35namespace Realms { class ContentService; }
36namespace Realms { struct Content; }
37namespace Realms { struct InviteLink; }
38namespace Realms { struct ServerRegion; }
39namespace Realms { struct WorldBackup; }
40// clang-format on
41
43public:
44 // RealmsSettingsScreenController inner types declare
45 // clang-format off
46 struct SaveStatusTracker;
47 struct RealmsVersionState;
49 // clang-format on
50
51 // RealmsSettingsScreenController inner types define
52 enum class PurchaseIntent : int {
53 Unsupported = 0,
54 ManageSubscription = 1,
55 RenewSubscription = 2,
56 ExtendConsumable = 3,
57 RenewConsumable = 4,
58 };
59
60 enum class SaveType : int {
61 Unknown = -1,
62 Manual = 0,
63 Automatic = 1,
64 };
65
66 enum class RealmsSaveAction : int {
67 Save = 0,
68 Restore = 1,
69 Download = 2,
70 Upload = 3,
71 Delete = 4,
72 };
73
74 struct SaveStatusTracker {
75 public:
76 // member variables
77 // NOLINTBEGIN
78 ::ll::TypedStorage<1, 1, bool> mRealmsSaveInProgress;
79 ::ll::TypedStorage<1, 1, bool> mClubsSaveInProgress;
80 ::ll::TypedStorage<1, 1, bool> mRealmsSaveSuccess;
81 // NOLINTEND
82 };
83
84 struct RealmsVersionState {
85 public:
86 // RealmsVersionState inner types define
87 using Version = ::Realms::ConfigInfo::Version;
88
89 public:
90 // member variables
91 // NOLINTBEGIN
92 ::ll::TypedStorage<4, 4, int> mPageIndex;
93 ::ll::TypedStorage<1, 1, bool> mAwaitingResponse;
94 ::ll::TypedStorage<8, 32, ::std::string> mPendingRef;
95 ::ll::TypedStorage<8, 32, ::std::string> mLastFilter;
96 ::ll::TypedStorage<8, 56, ::Realms::ConfigInfo> mConfigInfo;
97 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ConfigInfo::Version>> mFilteredVersions;
98 ::ll::TypedStorage<8, 104, ::Realms::ConfigInfo::Version> mMatchingVersion;
99 // NOLINTEND
100
101 public:
102 // member functions
103 // NOLINTBEGIN
104 MCAPI RealmsVersionState();
105
106 MCAPI ~RealmsVersionState();
107 // NOLINTEND
108
109 public:
110 // constructor thunks
111 // NOLINTBEGIN
112 MCAPI void* $ctor();
113 // NOLINTEND
114
115 public:
116 // destructor thunk
117 // NOLINTBEGIN
118 MCAPI void $dtor();
119 // NOLINTEND
120 };
121
123 public:
124 // member variables
125 // NOLINTBEGIN
126 ::ll::TypedStorage<8, 368, ::ModalScreenData> screenData;
127 ::ll::TypedStorage<8, 64, ::std::function<void(::ModalScreenButtonId)>> callback;
128 // NOLINTEND
129
130 public:
131 // prevent constructor by default
132 DelayedStandardModalScreenData& operator=(DelayedStandardModalScreenData const&);
133 DelayedStandardModalScreenData(DelayedStandardModalScreenData const&);
134 DelayedStandardModalScreenData();
135
136 public:
137 // member functions
138 // NOLINTBEGIN
139 MCAPI DelayedStandardModalScreenData(::RealmsSettingsScreenController::DelayedStandardModalScreenData&&);
140
141 MCAPI ~DelayedStandardModalScreenData();
142 // NOLINTEND
143
144 public:
145 // constructor thunks
146 // NOLINTBEGIN
147 MCAPI void* $ctor(::RealmsSettingsScreenController::DelayedStandardModalScreenData&&);
148 // NOLINTEND
149
150 public:
151 // destructor thunk
152 // NOLINTBEGIN
153 MCAPI void $dtor();
154 // NOLINTEND
155 };
156
157 using PackContentItemPtr = ::std::shared_ptr<::PackContentItem>;
158
159 using ConstPackContentItemPtr = ::std::shared_ptr<::PackContentItem const>;
160
161public:
162 // member variables
163 // NOLINTBEGIN
164 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mClubModelMutex;
165 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mClubModel;
166 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mUpdatedClubModel;
167 ::ll::TypedStorage<8, 656, ::Realms::World> mWorld;
168 ::ll::TypedStorage<8, 656, ::Realms::World> mUpdatedWorld;
169 ::ll::TypedStorage<8, 80, ::Realms::SubscriptionInfo> mSubscription;
170 ::ll::TypedStorage<1, 1, bool> mIsInitialWorldLoadComplete;
171 ::ll::TypedStorage<1, 1, bool> mRefreshWorldAndSubscriptionInfoOnOpen;
172 ::ll::TypedStorage<4, 4, ::RealmsSettingsScreenController::PurchaseIntent> mPurchaseIntent;
173 ::ll::TypedStorage<8, 32, ::std::string> mSelectedSectionTitle;
174 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RealmsAllowListScreenController>> mRealmsAllowListScreenController;
175 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ResourcePacksScreenController>> mBehaviorPacksScreenController;
176 ::ll::TypedStorage<4, 4, int> mActiveTabIndex;
177 ::ll::TypedStorage<1, 1, bool> mIsSlotsScreen;
178 ::ll::TypedStorage<1, 1, bool> mHasSubscriptionInfoBeenReceived;
179 ::ll::TypedStorage<1, 1, bool> mRefreshScreen;
180 ::ll::TypedStorage<1, 1, bool> mIsUploadingPacks;
181 ::ll::TypedStorage<1, 1, bool> mRealmsSelectedContentInitialized;
182 ::ll::TypedStorage<1, 1, bool> mDidReplaceWorld;
183 ::ll::TypedStorage<1, 1, bool> mRefreshingWorldInfo;
184 ::ll::TypedStorage<1, 1, bool> mScreenHasRefreshed;
185 ::ll::TypedStorage<1, 1, bool> mRealmDescriptionEdited;
186 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlatformMultiplayerRestrictions>> mPlatformMultiplayerRestrictions;
187 ::ll::TypedStorage<8, 8, ::IContentManager&> mContentManager;
188 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DlcUIWrapper>> mDlcUIWrapper;
189 ::ll::TypedStorage<8, 8, ::Realms::ContentService&> mContentService;
190 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IContentManagerContext>> mContentManagerContext;
191 ::ll::TypedStorage<8, 8, ::MultiplayerLockState> mMultiplayerState;
192 ::ll::TypedStorage<8, 8, ::PackManagerContentSource*> mRealmContentSource;
193 ::ll::TypedStorage<8, 32, ::std::string> mInitialPackId;
194 ::ll::TypedStorage<8, 8, uint64> mLoadedItemsCount;
195 ::ll::TypedStorage<1, 3, ::RealmsSettingsScreenController::SaveStatusTracker> mSaveStatusTracker;
196 ::ll::TypedStorage<8, 32, ::std::string> mNewSlotWorldName;
197 ::ll::TypedStorage<8, 64, ::Realms::WorldBackupList> mWorldBackupList;
198 ::ll::TypedStorage<1, 1, bool> mDidWorldBackupListReceiveNetworkError;
199 ::ll::TypedStorage<1, 1, bool> mHasLoadedWorldBackupList;
200 ::ll::TypedStorage<1, 1, bool> mHasLoadedActiveWorldSize;
201 ::ll::TypedStorage<1, 1, bool> mDidFetchActiveWorldSizeReceiveError;
202 ::ll::TypedStorage<4, 4, float> mStorageTotal;
203 ::ll::TypedStorage<4, 4, float> mStorageUsed;
204 ::ll::TypedStorage<8, 8, int64> mActiveWorldSizeBytes;
205 ::ll::TypedStorage<8, 32, ::std::vector<bool>> mManualSavesToggleStates;
206 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mBackupIdsToOverwrite;
207 ::ll::TypedStorage<4, 4, int> mActiveSavesTabIndex;
208 ::ll::TypedStorage<4, 4, int> mSelectedSaveIndex;
209 ::ll::TypedStorage<8, 32, ::std::string> mSelectedBackupId;
210 ::ll::TypedStorage<4, 4, ::RealmsSettingsScreenController::RealmsSaveAction> mLastSaveAction;
211 ::ll::TypedStorage<4, 8, ::std::optional<::RealmsSettingsScreenController::RealmsSaveAction>> mSaveAction;
212 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mBackupsToReplace;
213 ::ll::TypedStorage<8, 32, ::std::string> mLastFocusIdBeforeModalOpen;
214 ::ll::TypedStorage<1, 1, bool> mIsFetchingInviteLinkInfo;
215 ::ll::TypedStorage<1, 1, bool> mHasInviteLinkInfoErrored;
216 ::ll::TypedStorage<1, 1, bool> mIsPostingInviteLink;
217 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::InviteLink>> mInviteLinks;
218 ::ll::TypedStorage<1, 1, bool> mRefetchInviteLinksOnOpen;
219 ::ll::TypedStorage<1, 1, bool> mActiveDropdown;
220 ::ll::TypedStorage<4, 4, int> mRegionSelectedIndex;
221 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ServerRegion>> mRegionData;
222 ::ll::TypedStorage<1, 1, bool> mIsFetchingPreferredRegions;
223 ::ll::TypedStorage<1, 1, bool> mHasPreferredRegionsErrored;
224 ::ll::TypedStorage<8, 256, ::RealmsSettingsScreenController::RealmsVersionState> mRealmsVersionState;
225 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsSettingsScreenController::DelayedStandardModalScreenData>>
226 mDelayedStandardModalPopups;
227 ::ll::TypedStorage<4, 4, int> mPlayerSleepPercentInt;
228 ::ll::TypedStorage<8, 32, ::std::string> mRespawnRadiusString;
229 ::ll::TypedStorage<8, 32, ::std::string> mRandomTickSpeedString;
230 ::ll::TypedStorage<8, 192, ::GameRules> mGameRules;
231 // NOLINTEND
232
233public:
234 // prevent constructor by default
235 RealmsSettingsScreenController& operator=(RealmsSettingsScreenController const&);
236 RealmsSettingsScreenController(RealmsSettingsScreenController const&);
237 RealmsSettingsScreenController();
238
239public:
240 // virtual functions
241 // NOLINTBEGIN
242 virtual ~RealmsSettingsScreenController() /*override*/;
243
244 virtual void onOpen() /*override*/;
245
246 virtual void onCreation() /*override*/;
247
248 virtual ::ui::DirtyFlag tick() /*override*/;
249
250 virtual ::std::string getAdditionalScreenInfo() const /*override*/;
251
252 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const
253 /*override*/;
254 // NOLINTEND
255
256public:
257 // member functions
258 // NOLINTBEGIN
259 MCAPI RealmsSettingsScreenController(
260 ::std::shared_ptr<::MainMenuScreenModel> model,
261 ::Realms::World const& world,
262 ::std::string const& initialPackId
263 );
264
265 MCAPI void _addContentToBeAppliedAndUploadIfNeeded(
266 ::std::vector<::std::shared_ptr<::PackContentItem>> contentToUpload,
267 ::std::shared_ptr<::std::vector<::Realms::Content>> contentToApply,
268 int index,
269 ::std::function<void(::std::vector<::Realms::Content>)> completeUploadCallback,
270 ::std::function<void(::std::vector<::std::shared_ptr<::PackContentItem>>, int)> failedUploadCallback
271 );
272
273 MCAPI void _addInviteLink();
274
275 MCAPI void _applyPacks(::std::function<void()> packsApplyCallback);
276
277 MCAPI bool _canChangeCheatGameRules() const;
278
279 MCAPI bool _checkMultiplayerPrivileges();
280
281 MCAPI void _clearRealmsContentSelected();
282
283 MCAPI void _confirmCloseRealm();
284
285 MCAPI void _confirmResetRealm();
286
287 MCAPI bool _contentNeedApplication(::std::vector<::std::shared_ptr<::PackContentItem>> const& selectedContent);
288
289 MCAPI ::std::function<void(::std::vector<::Realms::Content>)>
290 _createApplyContentOnRealmProgressCallbackChain(::std::function<void()> packApplyCallback);
291
292 MCAPI ::std::unique_ptr<::Pack> _createUnknownPack(::Realms::Content const& content, ::PackType packType);
293
294 MCAPI void _deleteBackup();
295
296 MCAPI void _displayDelayedStandardModalPopups();
297
298 MCAPI void _displayFreeUpSpacePopup();
299
300 MCAPI void _displayModalPopup(
301 ::std::string const& title,
302 ::std::string const& message,
303 ::std::function<void(bool)> callback,
304 ::std::string const& leftButtonLabel,
305 ::std::string const& middleButtonLabel,
306 ::std::string const& rightButtonLabel,
307 ::ModalScreenButtonMode buttonNumber,
308 ::std::string const& telemetryOverride
309 );
310
311 MCAPI void _displayModalPopup(
312 ::std::string const& title,
313 ::std::string const& message,
314 ::std::function<void(::ModalScreenButtonId)> callback,
315 ::std::string const& leftButtonLabel,
316 ::std::string const& middleButtonLabel,
317 ::std::string const& rightButtonLabel,
318 ::ModalScreenButtonMode buttonNumber,
319 ::std::string const& telemetryOverride
320 );
321
322 MCAPI void _downloadMostRecentBackup();
323
324 MCAPI void _downloadRealmsBackupInContext();
325
326 MCAPI void _downloadRealmsWorld(
327 uint64 estimatedSize,
328 ::std::string const& backupId,
329 ::std::string const& time,
330 bool shouldCheckForSettingsChanged
331 );
332
333 MCAPI void _fetchActiveWorldSize();
334
335 MCAPI void _fetchAppliedContent();
336
337 MCAPI void _fetchInviteLinks();
338
339 MCAPI void _fetchWorldBackupList();
340
341 MCAPI ::std::vector<::std::shared_ptr<::PackContentItem>> _gatherSelectedContent();
342
343 MCAPI ::std::string _getConsumableToSubscriptionInfoText();
344
345 MCAPI ::std::string _getCurrentRealmsVersionReference();
346
347 MCAPI ::std::string _getDurationLabelText();
348
349 MCAPI ::std::string _getMaxPlayerLabelText();
350
351 MCAPI ::std::string _getPageLabel() const;
352
353 MCAPI void _getPreferredRegions();
354
355 MCAPI ::std::string _getRealmsVersionBranchName(int slot);
356
357 MCAPI ::std::string _getRealmsVersionReferenceId(int slot);
358
359 MCAPI ::std::string _getSubscriptionAddendumLabelText() const;
360
361 MCAPI ::std::string _getSubscriptionOriginMismatchLabelText();
362
363 MCAPI void _goToManageSubscriptionLink();
364
365 MCAPI void _handleRealmBranchButtonClick(::UIPropertyBag& bag);
366
367 MCAPI void _handleRealmInviteLinkButtonClick(::UIPropertyBag& bag);
368
369 MCAPI bool _hasGameRulesChanged();
370
371 MCAPI bool _hasSlotInfoChanged();
372
373 MCAPI bool _hasWorldInfoChanged();
374
375 MCAPI bool _isStoreMismatch() const;
376
377 MCAPI void _openCloseRealm(bool isRequestToOpen);
378
379 MCAPI void _queryRealmsConfigInfo();
380
381 MCAPI void _querySubscriptionInfo();
382
383 MCAPI bool _randomTickSpeedHelper(::std::string const& optionValue);
384
385 MCAPI void _refreshRealmsConfigDetails(::Realms::ConfigInfo& realmsConfigInfo);
386
387 MCAPI void _refreshWorldInfo(bool refreshSubscriptionInfo);
388
389 MCAPI void _registerBindings();
390
391 MCAPI void _registerEventHandlers();
392
393 MCAPI void _removeUnneededItemsFromRealmsUnknownContentSource();
394
395 MCAPI void _renewRealmHandler();
396
397 MCAPI void _resetRealm();
398
399 MCAPI bool _respawnRadiusHelper(::std::string const& optionValue);
400
401 MCAPI void _restoreBackup();
402
403 MCAPI void _saveAutoRealmWorldBackup();
404
405 MCAPI void _saveClubInfo();
406
407 MCAPI void _saveRealmWorldBackup();
408
409 MCAPI void _saveSettings(bool actionAfterSave, ::std::function<void(bool)>);
410
411 MCAPI void _saveSettingsAndExitScreen();
412
413 MCAPI void _setAllowCheatsWithConfirmation(bool value);
414
415 MCAPI void _setGameModeWithConfirmation(int value);
416
417 MCAPI void _setIsHardcore(bool isHardcore);
418
419 MCAPI void _setRealmsContentSelected();
420
421 MCAPI void _setUpCallbacksBooleanGameRuleSettings(
422 ::std::vector<::std::pair<::std::string, ::GameRuleId>> const& rules,
423 ::std::function<bool()> enabledFunction
424 );
425
426 MCAPI void _setupPacksScreen();
427
428 MCAPI void _showErrorPopup(::std::string titleId, ::std::string contentId, ::std::function<void(bool)> action);
429
430 MCAPI void _showErrorPopupAndExitScreenAfterDismissed(::std::string titleId, ::std::string contentId);
431
432 MCAPI void _showRefreshWorldInfoPopup();
433
434 MCAPI void _showSaveAndDeletePopup(int deleteQty);
435
436 MCAPI void _showSuccessPopup();
437
438 MCAPI void _updateRealmBranchConfig(::std::string const& ref);
439
440 MCAPI void _updateSubscriptionInformation(::Realms::SubscriptionInfo subscription);
441
442 MCAPI void _updateVersionsModel(::std::string const& filter, bool forceUpdate);
443
444 MCAPI void _updateWorld(::Realms::World& world);
445
446 MCAPI void _uploadWorld();
447
448 MCAPI void activateInitialPack();
449
450 MCAPI ::Realms::World const& getWorld() const;
451 // NOLINTEND
452
453public:
454 // static functions
455 // NOLINTBEGIN
456 MCAPI static ::std::string
457 _getDateAsFormattedStringForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
458
459 MCAPI static ::std::string
460 _getGameServerVersionForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
461
462 MCAPI static ::std::string
463 _getPacksListTextForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
464
465 MCAPI static ::std::string _getSizeForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
466
467 MCAPI static ::std::string
468 _getTimeAsFormattedStringForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
469
470 MCAPI static ::std::string
471 _getWorldNameForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
472 // NOLINTEND
473
474public:
475 // static variables
476 // NOLINTBEGIN
477 MCAPI static ::std::string const& DEFAULT_SAVES_TAB_FOCUS();
478
479 MCAPI static ::std::string const& SAVES_BUTTON_FOCUS_CONTROL();
480 // NOLINTEND
481
482public:
483 // constructor thunks
484 // NOLINTBEGIN
485 MCAPI void* $ctor(
486 ::std::shared_ptr<::MainMenuScreenModel> model,
487 ::Realms::World const& world,
488 ::std::string const& initialPackId
489 );
490 // NOLINTEND
491
492public:
493 // destructor thunk
494 // NOLINTBEGIN
495 MCAPI void $dtor();
496 // NOLINTEND
497
498public:
499 // virtual function thunks
500 // NOLINTBEGIN
501 MCAPI void $onOpen();
502
503 MCAPI void $onCreation();
504
505 MCAPI ::ui::DirtyFlag $tick();
506
507 MCAPI ::std::string $getAdditionalScreenInfo() const;
508
509 MCAPI void $addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
510 // NOLINTEND
511
512public:
513 // vftables
514 // NOLINTBEGIN
515 MCNAPI static void** $vftableForScreenController();
516
518 // NOLINTEND
519};
Definition DlcUIWrapper.h:5
Definition IContentManagerContext.h:5
Definition IContentManager.h:5
Definition MainMenuScreenModel.h:5
Definition Pack.h:28
Definition PlatformMultiplayerRestrictions.h:5
Definition RealmsAllowListScreenController.h:5
Definition RealmsSettingsScreenController.h:5
static MCAPI void ** $vftableForScreenController()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
Definition ContentService.h:7
Definition ResourcePacksScreenController.h:5
Definition SettingsScreenControllerBase.h:5
Definition UIPropertyBag.h:5
Definition GameRuleId.h:8
Definition PackContentItem.h:5
Definition PackManagerContentSource.h:5
Definition RealmsSettingsScreenController.h:25
Definition RealmsSettingsScreenController.h:23
Definition RealmsSettingsScreenController.h:21
Definition Content.h:7
Definition ServerRegion.h:7
Definition WorldBackup.h:7