3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/interface/IUIDefRepository.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/json/Value.h"
9#include "mc/platform/threading/SharedLock.h"
10#include "mc/resources/ResourceLoadType.h"
34 ::ll::TypedStorage<8, 32, ::std::string> mName;
35 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::Json::Value>> mDefs;
41 MCAPI ~UIDefNamespace();
55 ::ll::TypedStorage<4, 4, int> collectionIndex;
56 ::ll::TypedStorage<8, 32, ::std::string> ns;
57 ::ll::TypedStorage<8, 32, ::std::string> name;
58 ::ll::TypedStorage<8, 32, ::std::string> refNs;
59 ::ll::TypedStorage<8, 32, ::std::string> refName;
60 ::ll::TypedStorage<8, 16, ::Json::Value> jsonVal;
65 DefEntry& operator=(DefEntry
const&);
66 DefEntry(DefEntry
const&);
72 MCAPI DefEntry(::UIDefRepository::DefEntry&&);
80 MCAPI
void* $ctor(::UIDefRepository::DefEntry&&);
90 using VisitNodeFunc = ::std::function<
91 ::Json::Value&(::std::string
const&, ::std::string
const&, ::std::string
const&, ::Json::Value&)>;
93 using DefEntriesPtr = ::std::shared_ptr<::std::vector<::UIDefRepository::DefEntry>>;
95 using ReportsPtr = ::std::shared_ptr<::std::vector<::PackReport>>;
97 using UIDefNamespaceMap = ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>;
102 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
103 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::UIDefRepository::UIDefNamespace>> mDefNamespaces;
104 ::ll::TypedStorage<8, 16, ::Json::Value> mGlobalVariables;
105 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mMutex;
115 virtual void loadDefsList(
116 ::ResourceLocation
const& defsListFile,
117 ::ResourcePackStack
const& packStack,
118 ::std::function<
void(::std::vector<::PackReport>&)> onReportsReady
121 virtual void validateDefEntries(
122 ::ResourceLocation
const& defsListFile,
123 ::std::shared_ptr<::ResourcePackStack const> packStack,
124 ::std::function<
void(::std::vector<::PackReport>&)> onReportsReady
127 virtual ::Json::Value
const& findDef(::std::string
const& defNamespace, ::std::string
const& defName)
const
130 virtual ::Bedrock::Threading::SharedLock<::std::shared_mutex> acquireSharedLock() const ;
132 virtual
void syncUILoad() ;
134 virtual
void syncUILoadDefinitions() ;
136 virtual
void syncUILoadDefinitionReferences() ;
138 virtual
void cancelUIValidation() ;
140 virtual
bool isLoadingDone() const ;
142 virtual
bool isUILoadingDone() const ;
144 virtual
bool isUIValidationDone() const ;
147 forEachControl(::std::function<
void(::Json::Value const&, ::std::
string const&)> callback) ;
149 virtual ::Json::Value const& getGlobalVariables() const ;
151 virtual
void translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry) ;
153 virtual ~UIDefRepository() ;
159 MCAPI explicit UIDefRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
161 MCAPI
void _applyGlobalColorFormat();
163 MCAPI
void _collectAllDefEntries(
164 ::ResourceLoadType loadType,
165 ::ResourceLocation const& defsListFile,
166 ::ResourcePackStack const& packStack,
167 ::std::shared_ptr<::std::vector<::UIDefRepository::
DefEntry>> allDefEntries,
168 ::std::shared_ptr<::std::vector<::PackReport>> packReports
171 MCAPI
void _forEachControl(
172 ::Json::Value const& value,
173 ::std::
string const& namePath,
174 ::std::function<
void(::Json::Value const&, ::std::
string const&)> callback
177 MCAPI
void _queueFinishLoad(
178 ::std::shared_ptr<::std::unordered_map<::std::
string, ::UIDefRepository::
UIDefNamespace>> defNamespaces,
179 ::std::shared_ptr<::std::vector<::PackReport>> packReportsPtr,
180 ::ResourcePackStack const& packStack,
181 ::std::function<
void(::std::vector<::PackReport>&)> onReportsReady
184 MCAPI
void _readGlobalVariables(::ResourcePackStack const& packStack);
190 MCAPI static
void _resolveReferences(
191 ::UIDefRepository::
DefEntry& defEntry,
192 ::std::vector<::UIDefRepository::
DefEntry> const& allDefEntries,
193 ::std::vector<
int> const& sortedDefEntries,
194 ::std::unordered_set<
int>& visitedRefs,
195 ::std::vector<
bool>& resolved
202 MCAPI
void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager);
214 MCAPI
void $loadDefsList(
215 ::ResourceLocation const& defsListFile,
216 ::ResourcePackStack const& packStack,
217 ::std::function<
void(::std::vector<::PackReport>&)> onReportsReady
220 MCAPI
void $validateDefEntries(
221 ::ResourceLocation const& defsListFile,
222 ::std::shared_ptr<::ResourcePackStack const> packStack,
223 ::std::function<
void(::std::vector<::PackReport>&)> onReportsReady
226 MCAPI ::Json::Value const& $findDef(::std::
string const& defNamespace, ::std::
string const& defName) const;
228 MCAPI ::Bedrock::Threading::SharedLock<::std::shared_mutex> $acquireSharedLock() const;
230 MCAPI
void $syncUILoad();
232 MCAPI
void $syncUILoadDefinitions();
234 MCAPI
void $syncUILoadDefinitionReferences();
236 MCAPI
void $cancelUIValidation();
238 MCAPI
bool $isLoadingDone() const;
240 MCAPI
bool $isUILoadingDone() const;
242 MCAPI
bool $isUIValidationDone() const;
244 MCAPI
void $forEachControl(::std::function<
void(::Json::Value const&, ::std::
string const&)> callback);
246 MCFOLD ::Json::Value const& $getGlobalVariables() const;
248 MCAPI
void $translateLegacyItemIdsInRepository(::ItemRegistryRef const itemRegistry);
Definition IUIDefRepository.h:5
Definition ItemRegistryRef.h:36
Definition PackReport.h:16
Definition ResourceLoadManager.h:19
Definition ResourceLocation.h:15
Definition ResourcePackStack.h:25
Definition UIDefRepository.h:14
Definition UIDefRepository.h:5
static MCAPI void ** $vftable()
Definition UIDefRepository.h:16