mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
replace getContentPacks with getAllContentPacks in global events emitting
This commit is contained in:
parent
fb0f4bff52
commit
32ba027fac
2 changed files with 7 additions and 7 deletions
|
|
@ -209,21 +209,21 @@ void scripting::on_world_load(LevelController* controller) {
|
|||
lua::call_nothrow(L, 0, 0);
|
||||
}
|
||||
|
||||
for (auto& pack : scripting::engine->getContentPacks()) {
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldopen");
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_world_tick() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getContentPacks()) {
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldtick");
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_world_save() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getContentPacks()) {
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldsave");
|
||||
}
|
||||
if (lua::getglobal(L, "__vc_on_world_save")) {
|
||||
|
|
@ -233,7 +233,7 @@ void scripting::on_world_save() {
|
|||
|
||||
void scripting::on_world_quit() {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : scripting::engine->getContentPacks()) {
|
||||
for (auto& pack : scripting::engine->getAllContentPacks()) {
|
||||
lua::emit_event(L, pack.id + ":.worldquit");
|
||||
}
|
||||
if (lua::getglobal(L, "__vc_on_world_quit")) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) {
|
|||
lua::call_nothrow(L, 0, 0);
|
||||
}
|
||||
|
||||
for (auto& pack : engine->getContentPacks()) {
|
||||
for (auto& pack : engine->getAllContentPacks()) {
|
||||
lua::emit_event(
|
||||
lua::get_main_state(),
|
||||
pack.id + ":.hudopen",
|
||||
|
|
@ -54,7 +54,7 @@ void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) {
|
|||
}
|
||||
|
||||
void scripting::on_frontend_render() {
|
||||
for (auto& pack : engine->getContentPacks()) {
|
||||
for (auto& pack : engine->getAllContentPacks()) {
|
||||
lua::emit_event(
|
||||
lua::get_main_state(),
|
||||
pack.id + ":.hudrender",
|
||||
|
|
@ -64,7 +64,7 @@ void scripting::on_frontend_render() {
|
|||
}
|
||||
|
||||
void scripting::on_frontend_close() {
|
||||
for (auto& pack : engine->getContentPacks()) {
|
||||
for (auto& pack : engine->getAllContentPacks()) {
|
||||
lua::emit_event(
|
||||
lua::get_main_state(),
|
||||
pack.id + ":.hudclose",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue