mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
another cleanup
This commit is contained in:
parent
8750c5b5b9
commit
428127f620
1 changed files with 3 additions and 6 deletions
|
|
@ -32,10 +32,7 @@ using namespace scripting;
|
|||
static DocumentNode get_document_node_impl(
|
||||
lua::State*, const std::string& name, const std::string& nodeName, bool throwable=true
|
||||
) {
|
||||
if (engine->isHeadless()) {
|
||||
throw std::runtime_error("not available in headless mode");
|
||||
}
|
||||
auto doc = engine->getAssets()->get<UiDocument>(name);
|
||||
auto doc = engine->requireAssets().get<UiDocument>(name);
|
||||
if (doc == nullptr) {
|
||||
if (throwable) {
|
||||
throw std::runtime_error("document '" + name + "' not found");
|
||||
|
|
@ -1029,7 +1026,7 @@ static int l_gui_str(lua::State* L) {
|
|||
|
||||
static int l_gui_reindex(lua::State* L) {
|
||||
auto name = lua::require_string(L, 1);
|
||||
auto doc = engine->getAssets()->get<UiDocument>(name);
|
||||
auto doc = engine->requireAssets().get<UiDocument>(name);
|
||||
if (doc == nullptr) {
|
||||
throw std::runtime_error(
|
||||
"document '" + std::string(name) + "' not found"
|
||||
|
|
@ -1127,7 +1124,7 @@ static int l_gui_load_document(lua::State* L) {
|
|||
engine->getGUI(), std::move(env), alias, filename, filename.string()
|
||||
);
|
||||
auto document = documentPtr.get();
|
||||
engine->getAssets()->store(std::move(documentPtr), alias);
|
||||
engine->requireAssets().store(std::move(documentPtr), alias);
|
||||
|
||||
// namespace extension
|
||||
if (lua::istable(L, 4)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue