update Assets container - template-based now

This commit is contained in:
MihailRis
2024-06-22 22:30:14 +03:00
parent 848d121099
commit d54b6b2e58
20 changed files with 68 additions and 143 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ static int l_hud_open_block(lua::State* L) {
}
auto def = content->getIndices()->getBlockDef(vox->id);
auto assets = engine->getAssets();
auto layout = assets->getLayout(def->uiLayout);
auto layout = assets->get<UiDocument>(def->uiLayout);
if (layout == nullptr) {
throw std::runtime_error("block '"+def->name+"' has no ui layout");
}
@@ -71,7 +71,7 @@ static int l_hud_show_overlay(lua::State* L) {
bool playerInventory = lua::toboolean(L, 2);
auto assets = engine->getAssets();
auto layout = assets->getLayout(name);
auto layout = assets->get<UiDocument>(name);
if (layout == nullptr) {
throw std::runtime_error("there is no ui layout "+util::quote(name));
}
@@ -81,7 +81,7 @@ static int l_hud_show_overlay(lua::State* L) {
static UiDocument* require_layout(const char* name) {
auto assets = engine->getAssets();
auto layout = assets->getLayout(name);
auto layout = assets->get<UiDocument>(name);
if (layout == nullptr) {
throw std::runtime_error("layout '"+std::string(name)+"' is not found");
}