Skip to content
LeviMC
English
AutoLightDark
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/services/clubs/ClubModel.h"
16#include "mc/world/level/storage/GameRules.h"
17
18// auto generated forward declare list
19// clang-format off
20class DlcUIWrapper;
21class IContentManager;
27class TaskGroup;
28struct GameRuleId;
29struct PackContentItem;
31namespace Realms { class ContentService; }
32namespace Realms { struct Content; }
33namespace Realms { struct InviteLink; }
34namespace Realms { struct ServerRegion; }
35// clang-format on
36
38public:
39 // RealmsSettingsScreenController inner types declare
40 // clang-format off
41 struct SaveStatusTracker;
42 struct RealmsVersionState;
44 // clang-format on
45
46 // RealmsSettingsScreenController inner types define
47 enum class PurchaseIntent : int {
48 Unsupported = 0,
49 ManageSubscription = 1,
50 RenewSubscription = 2,
51 ExtendConsumable = 3,
52 RenewConsumable = 4,
53 };
54
55 struct SaveStatusTracker {
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<1, 1, bool> mRealmsSaveInProgress;
60 ::ll::TypedStorage<1, 1, bool> mClubsSaveInProgress;
61 ::ll::TypedStorage<1, 1, bool> mRealmsSaveSuccess;
62 // NOLINTEND
63 };
64
65 struct RealmsVersionState {
66 public:
67 // RealmsVersionState inner types define
68 using Version = ::Realms::ConfigInfo::Version;
69
70 public:
71 // member variables
72 // NOLINTBEGIN
73 ::ll::TypedStorage<4, 4, int> mPageIndex;
74 ::ll::TypedStorage<1, 1, bool> mAwaitingResponse;
75 ::ll::TypedStorage<8, 32, ::std::string> mPendingRef;
76 ::ll::TypedStorage<8, 32, ::std::string> mLastFilter;
77 ::ll::TypedStorage<8, 56, ::Realms::ConfigInfo> mConfigInfo;
78 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ConfigInfo::Version>> mFilteredVersions;
79 ::ll::TypedStorage<8, 104, ::Realms::ConfigInfo::Version> mMatchingVersion;
80 // NOLINTEND
81 };
82
84 public:
85 // member variables
86 // NOLINTBEGIN
87 ::ll::TypedStorage<8, 368, ::ModalScreenData> screenData;
88 ::ll::TypedStorage<8, 64, ::std::function<void(::ModalScreenButtonId)>> callback;
89 // NOLINTEND
90 };
91
92 using PackContentItemPtr = ::std::shared_ptr<::PackContentItem>;
93
94 using ConstPackContentItemPtr = ::std::shared_ptr<::PackContentItem const>;
95
96public:
97 // member variables
98 // NOLINTBEGIN
99 ::ll::TypedStorage<8, 80, ::std::mutex> mClubModelMutex;
100 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mClubModel;
101 ::ll::TypedStorage<8, 128, ::Clubs::ClubModel> mUpdatedClubModel;
102 ::ll::TypedStorage<8, 720, ::Realms::World> mWorld;
103 ::ll::TypedStorage<8, 720, ::Realms::World> mUpdatedWorld;
104 ::ll::TypedStorage<8, 112, ::Realms::SubscriptionInfo> mSubscription;
105 ::ll::TypedStorage<1, 1, bool> mIsInitialWorldLoadComplete;
106 ::ll::TypedStorage<1, 1, bool> mRefreshWorldAndSubscriptionInfoOnOpen;
107 ::ll::TypedStorage<4, 4, ::RealmsSettingsScreenController::PurchaseIntent> mPurchaseIntent;
108 ::ll::TypedStorage<8, 32, ::std::string> mSelectedSectionTitle;
109 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RealmsAllowListScreenController>> mRealmsAllowListScreenController;
110 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ResourcePacksScreenController>> mBehaviorPacksScreenController;
111 ::ll::TypedStorage<4, 4, int> mActiveTabIndex;
112 ::ll::TypedStorage<1, 1, bool> mHasSubscriptionInfoBeenReceived;
113 ::ll::TypedStorage<1, 1, bool> mRefreshScreen;
114 ::ll::TypedStorage<1, 1, bool> mIsUploadingPacks;
115 ::ll::TypedStorage<1, 1, bool> mRealmsSelectedContentInitialized;
116 ::ll::TypedStorage<1, 1, bool> mDidReplaceWorld;
117 ::ll::TypedStorage<1, 1, bool> mRefreshingWorldInfo;
118 ::ll::TypedStorage<1, 1, bool> mScreenHasRefreshed;
119 ::ll::TypedStorage<1, 1, bool> mRealmDescriptionEdited;
120 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlatformMultiplayerRestrictions>> mPlatformMultiplayerRestrictions;
121 ::ll::TypedStorage<8, 8, ::IContentManager&> mContentManager;
122 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DlcUIWrapper>> mDlcUIWrapper;
123 ::ll::TypedStorage<8, 8, ::Realms::ContentService&> mContentService;
124 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IContentManagerContext>> mContentManagerContext;
125 ::ll::TypedStorage<8, 8, ::MultiplayerLockState> mMultiplayerState;
126 ::ll::TypedStorage<8, 8, ::PackManagerContentSource*> mRealmContentSource;
127 ::ll::TypedStorage<8, 32, ::std::string> mInitialPackId;
128 ::ll::TypedStorage<8, 8, uint64> mLoadedItemsCount;
129 ::ll::TypedStorage<1, 3, ::RealmsSettingsScreenController::SaveStatusTracker> mSaveStatusTracker;
130 ::ll::TypedStorage<8, 32, ::std::string> mNewSlotWorldName;
131 ::ll::TypedStorage<1, 1, bool> mIsFetchingInviteLinkInfo;
132 ::ll::TypedStorage<1, 1, bool> mHasInviteLinkInfoErrored;
133 ::ll::TypedStorage<1, 1, bool> mIsPostingInviteLink;
134 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::InviteLink>> mInviteLinks;
135 ::ll::TypedStorage<1, 1, bool> mRefetchInviteLinksOnOpen;
136 ::ll::TypedStorage<1, 1, bool> mActiveDropdown;
137 ::ll::TypedStorage<4, 4, int> mRegionSelectedIndex;
138 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::ServerRegion>> mRegionData;
139 ::ll::TypedStorage<1, 1, bool> mIsFetchingPreferredRegions;
140 ::ll::TypedStorage<1, 1, bool> mHasPreferredRegionsErrored;
141 ::ll::TypedStorage<8, 256, ::RealmsSettingsScreenController::RealmsVersionState> mRealmsVersionState;
142 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsSettingsScreenController::DelayedStandardModalScreenData>>
143 mDelayedStandardModalPopups;
144 ::ll::TypedStorage<4, 4, int> mPlayerSleepPercentInt;
145 ::ll::TypedStorage<8, 32, ::std::string> mRespawnRadiusString;
146 ::ll::TypedStorage<8, 32, ::std::string> mRandomTickSpeedString;
147 ::ll::TypedStorage<8, 192, ::GameRules> mGameRules;
148 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
149 // NOLINTEND
150
151public:
152 // prevent constructor by default
153 RealmsSettingsScreenController& operator=(RealmsSettingsScreenController const&);
154 RealmsSettingsScreenController(RealmsSettingsScreenController const&);
155 RealmsSettingsScreenController();
156
157public:
158 // virtual functions
159 // NOLINTBEGIN
160 virtual ~RealmsSettingsScreenController() /*override*/ = default;
161
162 virtual void onOpen() /*override*/;
163
164 virtual void onCreation() /*override*/;
165
166 virtual ::ui::DirtyFlag tick() /*override*/;
167
168 virtual ::std::string getAdditionalScreenInfo() const /*override*/;
169
170 virtual void addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const
171 /*override*/;
172 // NOLINTEND
173
174public:
175 // member functions
176 // NOLINTBEGIN
177 MCNAPI RealmsSettingsScreenController(
178 ::std::shared_ptr<::MainMenuScreenModel> model,
179 ::Realms::World const& world,
180 ::std::string const& initialPackId
181 );
182
184 ::std::vector<::std::shared_ptr<::PackContentItem>> contentToUpload,
185 ::std::shared_ptr<::std::vector<::Realms::Content>> contentToApply,
186 int index,
187 ::std::function<void(::std::vector<::Realms::Content>)> completeUploadCallback,
188 ::std::function<void(::std::vector<::std::shared_ptr<::PackContentItem>>, int)> failedUploadCallback
189 );
190
191 MCNAPI void _applyPacks(::std::function<void()> packsApplyCallback);
192
193 MCNAPI bool _canChangeCheatGameRules() const;
194
196 ::std::string const& title,
197 ::std::string const& message,
198 ::std::function<void(::ModalScreenButtonId)> callback,
199 ::std::string const& leftButtonLabel,
200 ::std::string const& middleButtonLabel,
201 ::std::string const& rightButtonLabel,
202 ::ModalScreenButtonMode buttonNumber,
203 ::std::string const& telemetryOverride
204 );
205
206 MCNAPI void _fetchAppliedContent();
207
208 MCNAPI void _fetchInviteLinks();
209
210 MCNAPI bool _hasGameRulesChanged();
211
212 MCNAPI bool _hasSingleGameRuleChanged(::GameRuleId const& rule);
213
214 MCNAPI bool _hasSlotInfoChanged();
215
216 MCNAPI bool _hasWorldInfoChanged();
217
218 MCNAPI bool _isStoreMismatch() const;
219
220 MCNAPI void _openCloseRealm(bool isRequestToOpen);
221
223
224 MCNAPI void _refreshWorldInfo(bool refreshSubscriptionInfo);
225
227
228 MCNAPI void _renewRealmHandler();
229
230 MCNAPI void _saveSettings(bool showRealmsLoadingLevelProgressHandler, ::std::function<void(bool)> actionAfterSave);
231
233 ::std::vector<::std::pair<::std::string, ::GameRuleId>> const& rules,
234 ::std::function<bool()> enabledFunction
235 );
236
237 MCNAPI void _showErrorPopup(::std::string titleId, ::std::string contentId, ::std::function<void(bool)> action);
238
239 MCNAPI void _updateRealmBranchConfig(::std::string const& ref);
240
241 MCNAPI void _updateVersionsModel(::std::string const& filter, bool forceUpdate);
242
243 MCNAPI void activateInitialPack();
244 // NOLINTEND
245
246public:
247 // constructor thunks
248 // NOLINTBEGIN
249 MCNAPI void* $ctor(
250 ::std::shared_ptr<::MainMenuScreenModel> model,
251 ::Realms::World const& world,
252 ::std::string const& initialPackId
253 );
254 // NOLINTEND
255
256public:
257 // virtual function thunks
258 // NOLINTBEGIN
259 MCNAPI void $onOpen();
260
261 MCNAPI void $onCreation();
262
263 MCNAPI ::ui::DirtyFlag $tick();
264
265 MCNAPI ::std::string $getAdditionalScreenInfo() const;
266
267 MCNAPI void $addEventProperties(::std::unordered_map<::std::string, ::std::string>& eventProperties) const;
268 // NOLINTEND
269};
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
MCAPI void _openCloseRealm(bool isRequestToOpen)
MCAPI void _applyPacks(::std::function< void()> packsApplyCallback)
MCAPI void _addContentToBeAppliedAndUploadIfNeeded(::std::vector<::std::shared_ptr<::PackContentItem > > contentToUpload, ::std::shared_ptr<::std::vector<::Realms::Content > > contentToApply, int index, ::std::function< void(::std::vector<::Realms::Content >)> completeUploadCallback, ::std::function< void(::std::vector<::std::shared_ptr<::PackContentItem > >, int)> failedUploadCallback)
MCAPI void * $ctor(::std::shared_ptr<::MainMenuScreenModel > model, ::Realms::World const &world, ::std::string const &initialPackId)
MCAPI void _setUpCallbacksBooleanGameRuleSettings(::std::vector<::std::pair<::std::string, ::GameRuleId > > const &rules, ::std::function< bool()> enabledFunction)
MCAPI::std::string $getAdditionalScreenInfo() const
MCAPI::ui::DirtyFlag $tick()
MCAPI bool _canChangeCheatGameRules() const
MCAPI void _updateRealmBranchConfig(::std::string const &ref)
MCAPI void _updateVersionsModel(::std::string const &filter, bool forceUpdate)
MCAPI void _refreshWorldInfo(bool refreshSubscriptionInfo)
MCAPI void _showErrorPopup(::std::string titleId, ::std::string contentId, ::std::function< void(bool)> action)
MCAPI void _saveSettings(bool showRealmsLoadingLevelProgressHandler, ::std::function< void(bool)> actionAfterSave)
MCAPI void _displayModalPopup(::std::string const &title, ::std::string const &message, ::std::function< void(::ModalScreenButtonId)> callback, ::std::string const &leftButtonLabel, ::std::string const &middleButtonLabel, ::std::string const &rightButtonLabel, ::ModalScreenButtonMode buttonNumber, ::std::string const &telemetryOverride)
MCAPI bool _isStoreMismatch() const
MCAPI bool _hasSingleGameRuleChanged(::GameRuleId const &rule)
MCAPI void $addEventProperties(::std::unordered_map<::std::string, ::std::string > &eventProperties) const
Definition ContentService.h:7
Definition ResourcePacksScreenController.h:5
Definition SettingsScreenControllerBase.h:5
Definition TaskGroup.h:85
STL namespace.
Definition GameRuleId.h:8
Definition PackContentItem.h:5
Definition PackManagerContentSource.h:5
Definition RealmsSettingsScreenController.h:21
Definition RealmsSettingsScreenController.h:19
Definition RealmsSettingsScreenController.h:17
Definition Content.h:7
Definition ServerRegion.h:7