LeviLamina
Loading...
Searching...
No Matches
ResourcePack.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/screens/controllers/PackCategory.h"
7#include "mc/deps/core/file/PathBuffer.h"
8#include "mc/deps/core/resource/PackOrigin.h"
9#include "mc/deps/core/resource/ResourceFileSystem.h"
10#include "mc/resources/PackIconType.h"
11#include "mc/resources/PackReport.h"
12#include "mc/resources/ResourceSignature.h"
13
14// auto generated forward declare list
15// clang-format off
16class Pack;
18class PackManifest;
19class SemVersion;
20struct PackIdVersion;
21struct SubpackInfo;
22namespace Bedrock::Resources { class PreloadedPathHandle; }
23namespace Core { class Path; }
24namespace Json { class Value; }
25namespace mce { class UUID; }
26// clang-format on
27
28class ResourcePack {
29public:
30 // ResourcePack inner types define
31 using Callback = ::std::function<void(::Core::Path const&)>;
32
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<1, 1, bool> mHidden;
37 ::ll::TypedStorage<1, 1, bool> mError;
38 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::Pack>>> mPack;
39 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PackAccessStrategy>> mSubpackAccessStrategy;
40 ::ll::TypedStorage<8, 248, ::PackReport> mPackReport;
41 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::Pack>>> mSubPacks;
42 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ResourcePack>>> mSubResourcePacks;
43 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mIconPath;
44 ::ll::TypedStorage<8, 8, double> mLoadTime;
45 ::ll::TypedStorage<1, 1, bool> mIsBaseGamePack;
46 ::ll::TypedStorage<1, 1, bool> mIsSlicePack;
47 ::ll::TypedStorage<8, 64, ::ResourceSignature> mResourceSignature;
48 ::ll::TypedStorage<1, 1, bool> mIsMarkedForRemoval;
49 // NOLINTEND
50
51public:
52 // prevent constructor by default
53 ResourcePack();
54
55public:
56 // member functions
57 // NOLINTBEGIN
58 MCAPI explicit ResourcePack(::gsl::not_null<::std::shared_ptr<::Pack>> pack);
59
60 MCAPI void _createSubpack(::SubpackInfo const& subpackInfo);
61
62 MCAPI void _createSubpacks();
63
64 MCAPI void _generateIconPath();
65
66 MCAPI bool _supportsPreload() const;
67
68 MCAPI bool areKnownFilesValid();
69
70 MCAPI void forEachIn(
71 ::Core::Path const& filePath,
72 ::std::function<void(::Core::Path const&)> callback,
73 int subpackIndex,
74 bool recurseAnyways
75 ) const;
76
77 MCAPI void generateAssetSet();
78
79#ifdef LL_PLAT_C
80 MCAPI ::ResourceFileSystem getIconFileSytem() const;
81
82 MCAPI ::Core::PathBuffer<::std::string> getIconPath(::PackIconType iconType) const;
83
84 MCAPI ::Core::PathBuffer<::std::string> const& getIconZipPath() const;
85#endif
86
87 MCAPI ::PackManifest const& getManifest() const;
88
89#ifdef LL_PLAT_C
90 MCAPI ::PackCategory getPackCategory() const;
91
92 MCFOLD ::mce::UUID const& getPackId() const;
93
94 MCFOLD ::PackIdVersion const& getPackIdentity() const;
95
96 MCAPI ::PackOrigin getPackOrigin() const;
97#endif
98
99 MCAPI bool getResource(::Core::Path const& resourceName, ::std::string& resourceStream, int subpackIndex) const;
100
101#ifdef LL_PLAT_C
102 MCAPI ::Json::Value getTexturesList(int subpackIndex) const;
103
104 MCAPI ::SemVersion const& getVersion() const;
105
106 MCAPI bool hasExtraResourcesForLocale(::std::string const& code, int subpackIndex) const;
107
108 MCAPI bool hasIcon(::PackIconType iconType) const;
109#endif
110
111 MCAPI bool hasResource(::Core::Path const& resourceName, int subpackIndex) const;
112
113 MCAPI bool isAssetExtractionViable() const;
114
115#ifdef LL_PLAT_C
116 MCFOLD bool isMarkedForRemoval() const;
117#endif
118
119 MCAPI ::Bedrock::Resources::PreloadedPathHandle
120 preloadArchive(::Core::Path const& packRelativePath, int subpackIndex) const;
121
122 MCAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
123 preloadPath(::Core::Path const& packRelativePath, int subpackIndex, bool) const;
124
125#ifdef LL_PLAT_C
126 MCAPI void regenerateAssetSet();
127#endif
128
129 MCAPI void setAsSlicePack();
130
131#ifdef LL_PLAT_C
132 MCAPI void setError();
133#endif
134
135 MCAPI void setLocale(::std::string const& code);
136
137 MCAPI ~ResourcePack();
138 // NOLINTEND
139
140public:
141 // static variables
142 // NOLINTBEGIN
143 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_BUG_ICON_PATH();
144
145 MCAPI static ::Core::PathBuffer<::std::string> const& RESOURCE_PACK_ICON_PATH();
146
147 MCAPI static ::Core::PathBuffer<::std::string> const& TEXTURES_LIST_PATH();
148 // NOLINTEND
149
150public:
151 // constructor thunks
152 // NOLINTBEGIN
153 MCAPI void* $ctor(::gsl::not_null<::std::shared_ptr<::Pack>> pack);
154 // NOLINTEND
155
156public:
157 // destructor thunk
158 // NOLINTBEGIN
159 MCAPI void $dtor();
160 // NOLINTEND
161};
Definition PreloadedPathHandle.h:16
Definition Path.h:12
Definition Value.h:16
Definition PackAccessStrategy.h:26
Definition PackManifest.h:38
Definition Pack.h:28
Definition SemVersion.h:15
Definition UUID.h:7
Definition PackIdVersion.h:10
Definition SubpackInfo.h:5
Definition code.h:5