mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
refactor: add GUI instance reference to UI nodes
This commit is contained in:
parent
74a94f869c
commit
4c48afbb90
70 changed files with 1133 additions and 832 deletions
|
|
@ -268,21 +268,21 @@ void scripting::on_world_load(LevelController* controller) {
|
|||
lua::call_nothrow(L, 0, 0);
|
||||
}
|
||||
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
for (auto& pack : Engine::getInstance().getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldopen");
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_world_tick() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
for (auto& pack : Engine::getInstance().getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldtick");
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_world_save() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
for (auto& pack : Engine::getInstance().getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldsave");
|
||||
}
|
||||
if (lua::getglobal(L, "__vc_on_world_save")) {
|
||||
|
|
@ -292,7 +292,7 @@ void scripting::on_world_save() {
|
|||
|
||||
void scripting::on_world_quit() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
for (auto& pack : Engine::getInstance().getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldquit");
|
||||
}
|
||||
if (lua::getglobal(L, "__vc_on_world_quit")) {
|
||||
|
|
@ -308,7 +308,7 @@ void scripting::on_world_quit() {
|
|||
void scripting::cleanup() {
|
||||
auto L = lua::get_main_state();
|
||||
lua::requireglobal(L, "pack");
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
for (auto& pack : Engine::getInstance().getAllContentPacks()) {
|
||||
lua::requirefield(L, "unload");
|
||||
lua::pushstring(L, pack.id);
|
||||
lua::call_nothrow(L, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue