3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/controls/renderers/UIThumbnailAtlasRenderer.h"
7#include "mc/client/gui/oreui/resources/AtlasIndex.h"
8#include "mc/deps/core/string/HashedString.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/deps/game_refs/EnableGetWeakRef.h"
20namespace mce {
class Color; }
27 public ::std::enable_shared_from_this<::OreUI::UIBlockThumbnailAtlasManager> {
39 ::ll::TypedStorage<8, 48, ::HashedString> name;
40 ::ll::TypedStorage<2, 2, ushort> u;
41 ::ll::TypedStorage<2, 2, ushort> v;
42 ::ll::TypedStorage<2, 2, ushort> rows;
43 ::ll::TypedStorage<2, 2, ushort> cols;
44 ::ll::TypedStorage<2, 2, ushort> maxCols;
45 ::ll::TypedStorage<8, 8, uint64> count;
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIThumbnailAtlasRenderer::AtlasInfo>> mAtlasInfo;
47 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::cg::ImageBuffer>> mImageBuffer;
57 MCAPI
explicit AtlasData(::HashedString name);
59 MCAPI AtlasData(::HashedString name, ::std::unique_ptr<::UIThumbnailAtlasRenderer::AtlasInfo>&& atlasInfo);
65 MCAPI
void* $ctor(::HashedString name);
67 MCAPI
void* $ctor(::HashedString name, ::std::unique_ptr<::UIThumbnailAtlasRenderer::AtlasInfo>&& atlasInfo);
71 using AtlasInfo = ::UIThumbnailAtlasRenderer::AtlasInfo;
73 using ItemAtlasInfo = ::std::pair<::UIThumbnailAtlasRenderer::AtlasInfo, ::OreUI::AtlasIndex::ItemEntry>;
75 using SubstitutionMap = ::std::unordered_map<::HashedString, ::HashedString>;
78 ::std::unordered_map<::HashedString, ::std::unique_ptr<::OreUI::UIBlockThumbnailAtlasManager::AtlasData>>;
83 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IClientInstance>> mClientInstance;
84 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::HashedString>> mSubstitutions;
85 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::std::shared_ptr<::OreUI::AtlasIndex>>>
90 ::std::unordered_map<::HashedString, ::std::unique_ptr<::OreUI::UIBlockThumbnailAtlasManager::AtlasData>>>
92 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mAvailableSemaphore;
93 ::ll::TypedStorage<4, 4, uint> mAtlasIndex;
94 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::mce::Color>> mBlockAverageColorMap;
99 UIBlockThumbnailAtlasManager();
104 MCAPI UIBlockThumbnailAtlasManager(
105 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> primaryClientInstance,
106 ::std::unordered_map<::HashedString, ::HashedString> substitutionMap
109 MCAPI
bool _buildThumbnailAtlas(::TaskGroup& taskGroup,
bool isResume);
111 MCAPI
void _generateItemIndex(
bool stripVanillaNamespace);
113 MCAPI ::OreUI::UIBlockThumbnailAtlasManager::AtlasData& _getAtlasData(::std::string_view atlasName);
115 MCAPI ::mce::TexturePtr _getAtlasTexture(::ItemStack
const& item, ::ItemGraphics
const& itemGraphics);
117 MCAPI ::OreUI::UIBlockThumbnailAtlasManager::AtlasData&
118 _getOrCreateAtlasData(::std::string_view atlasName, ::mce::TexturePtr
const& texturePtr);
120 MCAPI ::mce::TexturePtr _getShulkerBoxTexture(::ItemStack
const& item)
const;
122 MCAPI
void _unloadAtlasTextures();
124 MCAPI
bool buildThumbnailAtlas(
bool isResume);
126 MCAPI ::std::optional<::std::pair<::UIThumbnailAtlasRenderer::AtlasInfo, ::OreUI::AtlasIndex::ItemEntry>>
127 findItemAndAtlasInfo(::std::string_view name)
const;
129 MCFOLD ::std::map<::std::string, ::mce::Color>
const& getBlockAverageColorMap();
131 MCAPI ::std::shared_ptr<::OreUI::AtlasIndex> getIndex(::std::string_view atlasName)
const;
133 MCAPI
bool isThumbnailAtlasEnabled()
const;
135 MCAPI
void onAppResume();
137 MCAPI
bool rebuildThumbnailAtlas(
bool isResume);
139 MCAPI ~UIBlockThumbnailAtlasManager();
146 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> primaryClientInstance,
147 ::std::unordered_map<::HashedString, ::HashedString> substitutionMap
Definition IClientInstance.h:5
Definition ItemGraphics.h:5
Definition ItemStack.h:35
Definition UIBlockThumbnailAtlasManager.h:7
Definition TaskGroup.h:55
Definition ImageBuffer.h:16
Definition TexturePtr.h:7
Definition AtlasIndex.h:7
Definition UIBlockThumbnailAtlasManager.h:15