mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
update Assets container - template-based now
This commit is contained in:
parent
848d121099
commit
d54b6b2e58
20 changed files with 68 additions and 143 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue