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/world/level/storage/GameRules.h"
18
19// auto generated forward declare list
20// clang-format off
21class DlcUIWrapper;
22class IContentManager;
28struct GameRuleId;
29struct PackContentItem;
31namespace Realms { class ContentService; }
32namespace Realms { struct Content; }
33namespace Realms { struct InviteLink; }
34namespace Realms { struct ServerRegion; }
35namespace Realms { struct WorldBackup; }
36// clang-format on
37
39public:
40 // RealmsSettingsScreenController inner types declare
41 // clang-format off
42 struct SaveStatusTracker;
43 struct RealmsVersionState;
45 // clang-format on
46
47 // RealmsSettingsScreenController inner types define
48 enum class PurchaseIntent : int {
49 Unsupported = 0,
50 ManageSubscription = 1,
51 RenewSubscription = 2,
52 ExtendConsumable = 3,
53 RenewConsumable = 4,
54 };
55
56 enum class SaveType : int {
57 Unknown = -1,
58 Manual = 0,
59 Automatic = 1,
60 };
61
62 enum class RealmsSaveAction : int {
63 Save = 0,
64 Restore = 1,
65 Download = 2,
66 Upload = 3,
67 Delete = 4,
68 };
69
70 struct SaveStatusTracker {
71 public:
72 // member variables
73 // NOLINTBEGIN
74 ::ll::TypedStorage<1, 1, bool> mRealmsSaveInProgress;
75 ::ll::TypedStorage<1, 1, bool> mClubsSaveInProgress;
76 ::ll::TypedStorage<1, 1, bool> mRealmsSaveSuccess;
77 // NOLINTEND
78 };
79
80 struct RealmsVersionState {
81 public:
82 // RealmsVersionState inner types define
83 using Version = ::Realms::ConfigInfo::Version;
84
85 public:
86 // member variables
87 // NOLINTBEGIN
88 ::ll::TypedStorage<4, 4, int> mPageIndex;
89 ::ll::TypedStorage<1, 1, bool> mAwaitingResponse;
90 ::ll::TypedStorage<8, 32, ::std::string> mPendingRef;
91 ::ll::TypedStorage<8, 32, ::std::string> mLastFilter;
92 ::ll::TypedStorage<8, 56, ::Realms::ConfigInfo> mConfigInfo;
93 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ConfigInfo::Version>> mFilteredVersions;
94 ::ll::TypedStorage<8, 104, ::Realms::ConfigInfo::Version> mMatchingVersion;
95 // NOLINTEND
96 };
97
99 public:
100 // member variables
101 // NOLINTBEGIN
102 ::ll::TypedStorage<8, 368, ::ModalScreenData> screenData;
103 ::ll::TypedStorage<8, 64, ::std::function<void(::ModalScreenButtonId)>> callback;
104 // NOLINTEND
105 };
106
107 using PackContentItemPtr = ::std::shared_ptr<::PackContentItem>;
108
109 using ConstPackContentItemPtr = ::std::shared_ptr<::PackContentItem const>;
110
111public:
112 // member variables
113 // NOLINTBEGIN
114 ::ll::TypedStorage<8, 80, ::std::mutex> mClubModelMutex;
115 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mClubModel;
116 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mUpdatedClubModel;
117 ::ll::TypedStorage<8, 720, ::Realms::World> mWorld;
118 ::ll::TypedStorage<8, 720, ::Realms::World> mUpdatedWorld;
119 ::ll::TypedStorage<8, 112, ::Realms::SubscriptionInfo> mSubscription;
120 ::ll::TypedStorage<1, 1, bool> mIsInitialWorldLoadComplete;
121 ::ll::TypedStorage<1, 1, bool> mRefreshWorldAndSubscriptionInfoOnOpen;
122 ::ll::TypedStorage<4, 4, ::RealmsSettingsScreenController::PurchaseIntent> mPurchaseIntent;
123 ::ll::TypedStorage<8, 32, ::std::string> mSelectedSectionTitle;
124 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RealmsAllowListScreenController>> mRealmsAllowListScreenController;
125 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ResourcePacksScreenController>> mBehaviorPacksScreenController;
126 ::ll::TypedStorage<4, 4, int> mActiveTabIndex;
127 ::ll::TypedStorage<1, 1, bool> mIsSlotsScreen;
128 ::ll::TypedStorage<1, 1, bool> mHasSubscriptionInfoBeenReceived;
129 ::ll::TypedStorage<1, 1, bool> mRefreshScreen;
130 ::ll::TypedStorage<1, 1, bool> mIsUploadingPacks;
131 ::ll::TypedStorage<1, 1, bool> mRealmsSelectedContentInitialized;
132 ::ll::TypedStorage<1, 1, bool> mDidReplaceWorld;
133 ::ll::TypedStorage<1, 1, bool> mRefreshingWorldInfo;
134 ::ll::TypedStorage<1, 1, bool> mScreenHasRefreshed;
135 ::ll::TypedStorage<1, 1, bool> mRealmDescriptionEdited;
136 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlatformMultiplayerRestrictions>> mPlatformMultiplayerRestrictions;
137 ::ll::TypedStorage<8, 8, ::IContentManager&> mContentManager;
138 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DlcUIWrapper>> mDlcUIWrapper;
139 ::ll::TypedStorage<8, 8, ::Realms::ContentService&> mContentService;
140 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IContentManagerContext>> mContentManagerContext;
141 ::ll::TypedStorage<8, 8, ::MultiplayerLockState> mMultiplayerState;
142 ::ll::TypedStorage<8, 8, ::PackManagerContentSource*> mRealmContentSource;
143 ::ll::TypedStorage<8, 32, ::std::string> mInitialPackId;
144 ::ll::TypedStorage<8, 8, uint64> mLoadedItemsCount;
145 ::ll::TypedStorage<1, 3, ::RealmsSettingsScreenController::SaveStatusTracker> mSaveStatusTracker;
146 ::ll::TypedStorage<8, 32, ::std::string> mNewSlotWorldName;
147 ::ll::TypedStorage<8, 64, ::Realms::WorldBackupList> mWorldBackupList;
148 ::ll::TypedStorage<1, 1, bool> mDidWorldBackupListReceiveNetworkError;
149 ::ll::TypedStorage<1, 1, bool> mHasLoadedWorldBackupList;
150 ::ll::TypedStorage<1, 1, bool> mHasLoadedActiveWorldSize;
151 ::ll::TypedStorage<1, 1, bool> mDidFetchActiveWorldSizeReceiveError;
152 ::ll::TypedStorage<4, 4, float> mStorageTotal;
153 ::ll::TypedStorage<4, 4, float> mStorageUsed;
154 ::ll::TypedStorage<8, 8, int64> mActiveWorldSizeBytes;
155 ::ll::TypedStorage<8, 32, ::std::vector<bool>> mManualSavesToggleStates;
156 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mBackupIdsToOverwrite;
157 ::ll::TypedStorage<4, 4, int> mActiveSavesTabIndex;
158 ::ll::TypedStorage<4, 4, int> mSelectedSaveIndex;
159 ::ll::TypedStorage<8, 32, ::std::string> mSelectedBackupId;
160 ::ll::TypedStorage<4, 4, ::RealmsSettingsScreenController::RealmsSaveAction> mLastSaveAction;
161 ::ll::TypedStorage<4, 8, ::std::optional<::RealmsSettingsScreenController::RealmsSaveAction>> mSaveAction;
162 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mBackupsToReplace;
163 ::ll::TypedStorage<8, 32, ::std::string> mLastFocusIdBeforeModalOpen;
164 ::ll::TypedStorage<1, 1, bool> mIsFetchingInviteLinkInfo;
165 ::ll::TypedStorage<1, 1, bool> mHasInviteLinkInfoErrored;
166 ::ll::TypedStorage<1, 1, bool> mIsPostingInviteLink;
167 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::InviteLink>> mInviteLinks;
168 ::ll::TypedStorage<1, 1, bool> mRefetchInviteLinksOnOpen;
169 ::ll::TypedStorage<1, 1, bool> mActiveDropdown;
170 ::ll::TypedStorage<4, 4, int> mRegionSelectedIndex;
171 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ServerRegion>> mRegionData;
172 ::ll::TypedStorage<1, 1, bool> mIsFetchingPreferredRegions;
173 ::ll::TypedStorage<1, 1, bool> mHasPreferredRegionsErrored;
174 ::ll::TypedStorage<8, 256, ::RealmsSettingsScreenController::RealmsVersionState> mRealmsVersionState;
175 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsSettingsScreenController::DelayedStandardModalScreenData>>
176 mDelayedStandardModalPopups;
177 ::ll::TypedStorage<4, 4, int> mPlayerSleepPercentInt;
178 ::ll::TypedStorage<8, 32, ::std::string> mRespawnRadiusString;
179 ::ll::TypedStorage<8, 32, ::std::string> mRandomTickSpeedString;
180 ::ll::TypedStorage<8, 192, ::GameRules> mGameRules;
181 // NOLINTEND
182
183public:
184 // prevent constructor by default
185 RealmsSettingsScreenController& operator=(RealmsSettingsScreenController const&);
186 RealmsSettingsScreenController(RealmsSettingsScreenController const&);
187 RealmsSettingsScreenController();
188
189public:
190 // virtual functions
191 // NOLINTBEGIN
192 virtual ~RealmsSettingsScreenController() /*override*/ = default;
193
194 virtual void onOpen() /*override*/;
195
196 virtual void onCreation() /*override*/;
197
198 virtual ::ui::DirtyFlag tick() /*override*/;
199
200 virtual ::std::string getAdditionalScreenInfo() const /*override*/;
201
202 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const
203 /*override*/;
204 // NOLINTEND
205
206public:
207 // member functions
208 // NOLINTBEGIN
209 MCAPI RealmsSettingsScreenController(
210 ::std::shared_ptr<::MainMenuScreenModel> model,
211 ::Realms::World const& world,
212 ::std::string const& initialPackId
213 );
214
215 MCAPI void _addContentToBeAppliedAndUploadIfNeeded(
216 ::std::vector<::std::shared_ptr<::PackContentItem>> contentToUpload,
217 ::std::shared_ptr<::std::vector<::Realms::Content>> contentToApply,
218 int index,
219 ::std::function<void(::std::vector<::Realms::Content>)> completeUploadCallback,
220 ::std::function<void(::std::vector<::std::shared_ptr<::PackContentItem>>, int)> failedUploadCallback
221 );
222
223 MCAPI void _applyPacks(::std::function<void()> packsApplyCallback);
224
225 MCAPI bool _canChangeCheatGameRules() const;
226
227 MCAPI void _displayFreeUpSpacePopup();
228
229 MCAPI void _displayModalPopup(
230 ::std::string const& title,
231 ::std::string const& message,
232 ::std::function<void(::ModalScreenButtonId)> callback,
233 ::std::string const& leftButtonLabel,
234 ::std::string const& middleButtonLabel,
235 ::std::string const& rightButtonLabel,
236 ::ModalScreenButtonMode buttonNumber,
237 ::std::string const& telemetryOverride
238 );
239
240 MCAPI void _downloadMostRecentBackup();
241
242 MCAPI void _downloadRealmsWorld(
243 uint64 estimatedSize,
244 ::std::string const& backupId,
245 ::std::string const& time,
246 bool shouldCheckForSettingsChanged
247 );
248
249 MCAPI void _fetchActiveWorldSize();
250
251 MCAPI void _fetchAppliedContent();
252
253 MCAPI void _fetchInviteLinks();
254
255 MCAPI void _fetchWorldBackupList();
256
257 MCAPI bool _hasGameRulesChanged();
258
259 MCAPI bool _hasSingleGameRuleChanged(::GameRuleId const& rule);
260
261 MCAPI bool _hasSlotInfoChanged();
262
263 MCAPI bool _hasWorldInfoChanged();
264
265 MCAPI bool _isStoreMismatch() const;
266
267 MCAPI void _openCloseRealm(bool isRequestToOpen);
268
269 MCAPI void _querySubscriptionInfo();
270
271 MCAPI void _refreshWorldInfo(bool refreshSubscriptionInfo);
272
273 MCAPI void _registerEventHandlers();
274
275 MCAPI void _renewRealmHandler();
276
277 MCAPI void _saveAutoRealmWorldBackup();
278
279 MCAPI void _saveRealmWorldBackup();
280
281 MCAPI void _saveSettings(bool showRealmsLoadingLevelProgressHandler, ::std::function<void(bool)> actionAfterSave);
282
283 MCAPI void _setUpCallbacksBooleanGameRuleSettings(
284 ::std::vector<::std::pair<::std::string, ::GameRuleId>> const& rules,
285 ::std::function<bool()> enabledFunction
286 );
287
288 MCAPI void _showErrorPopup(::std::string titleId, ::std::string contentId, ::std::function<void(bool)> action);
289
290 MCAPI void _showErrorPopupAndExitScreenAfterDismissed(::std::string titleId, ::std::string contentId);
291
292 MCAPI void _showSuccessPopup();
293
294 MCAPI void _updateRealmBranchConfig(::std::string const& ref);
295
296 MCAPI void _updateVersionsModel(::std::string const& filter, bool forceUpdate);
297
298 MCAPI void activateInitialPack();
299 // NOLINTEND
300
301public:
302 // static functions
303 // NOLINTBEGIN
304 MCAPI static ::std::string
305 _getDateAsFormattedStringForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
306
307 MCAPI static ::std::string
308 _getGameServerVersionForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
309
310 MCAPI static ::std::string
311 _getPacksListTextForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
312
313 MCAPI static ::std::string
314 _getTimeAsFormattedStringForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
315
316 MCAPI static ::std::string
317 _getWorldNameForBackupByIndex(::std::vector<::Realms::WorldBackup> const& backups, int index);
318 // NOLINTEND
319
320public:
321 // static variables
322 // NOLINTBEGIN
323 MCAPI static ::std::string const& DEFAULT_SAVES_TAB_FOCUS();
324
325 MCAPI static ::std::string const& SAVES_BUTTON_FOCUS_CONTROL();
326 // NOLINTEND
327
328public:
329 // constructor thunks
330 // NOLINTBEGIN
331 MCAPI void* $ctor(
332 ::std::shared_ptr<::MainMenuScreenModel> model,
333 ::Realms::World const& world,
334 ::std::string const& initialPackId
335 );
336 // NOLINTEND
337
338public:
339 // virtual function thunks
340 // NOLINTBEGIN
341 MCAPI void $onOpen();
342
343 MCAPI void $onCreation();
344
345 MCAPI ::ui::DirtyFlag $tick();
346
347 MCAPI ::std::string $getAdditionalScreenInfo() const;
348
349 MCAPI void $addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
350 // NOLINTEND
351};
Definition DlcUIWrapper.h:5
Definition IContentManagerContext.h:5
Definition IContentManager.h:5
Definition MainMenuScreenModel.h:5
Definition PlatformMultiplayerRestrictions.h:5
Definition RealmsAllowListScreenController.h:5
Definition RealmsSettingsScreenController.h:5
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