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