mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
rename on_content_loading to on_scripts_loading
This commit is contained in:
parent
61625ffe00
commit
89a6747c21
4 changed files with 8 additions and 6 deletions
|
|
@ -497,7 +497,7 @@ void ContentLoader::loadWorldScript(ContentPackRuntime& runtime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentLoader::loadScripts(Content& content) {
|
void ContentLoader::loadScripts(Content& content) {
|
||||||
scripting::on_content_loading();
|
scripting::on_scripts_loading();
|
||||||
load_scripts(content, content.blocks);
|
load_scripts(content, content.blocks);
|
||||||
load_scripts(content, content.items);
|
load_scripts(content, content.items);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,9 @@ struct WorldFuncsSet {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MainFuncsSet {
|
struct MainFuncsSet {
|
||||||
bool oncontentloading;
|
bool oncontentinitialization;
|
||||||
|
bool onscriptsloading;
|
||||||
|
bool oncontentloaded;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ContentPackRuntime {
|
class ContentPackRuntime {
|
||||||
|
|
|
||||||
|
|
@ -637,11 +637,11 @@ void scripting::on_content_initialization() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scripting::on_content_loading() {
|
void scripting::on_scripts_loading() {
|
||||||
auto L = lua::get_main_state();
|
auto L = lua::get_main_state();
|
||||||
|
|
||||||
for (auto& pack : content_control->getAllContentPacks()) {
|
for (auto& pack : content_control->getAllContentPacks()) {
|
||||||
lua::emit_event(L, pack.id + ":.oncontentloading", [](auto L) {
|
lua::emit_event(L, pack.id + ":.onscriptsloading", [](auto L) {
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -804,7 +804,7 @@ void scripting::load_main_script(
|
||||||
lua::pop(lua::get_main_state(), load_script(env, "main", file, fileName));
|
lua::pop(lua::get_main_state(), load_script(env, "main", file, fileName));
|
||||||
|
|
||||||
register_event(env, "on_content_initialization", prefix + ":.oncontentinitialization");
|
register_event(env, "on_content_initialization", prefix + ":.oncontentinitialization");
|
||||||
register_event(env, "on_content_loading", prefix + ":.oncontentloading");
|
register_event(env, "on_scripts_loading", prefix + ":.onscriptsloading");
|
||||||
register_event(env, "on_content_loaded", prefix + ":.oncontentloaded");
|
register_event(env, "on_content_loaded", prefix + ":.oncontentloaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ namespace scripting {
|
||||||
void on_content_initialization();
|
void on_content_initialization();
|
||||||
|
|
||||||
/// @brief Called on Content loading
|
/// @brief Called on Content loading
|
||||||
void on_content_loading();
|
void on_scripts_loading();
|
||||||
|
|
||||||
/// @brief Called on Content loading finish
|
/// @brief Called on Content loading finish
|
||||||
void on_content_loaded();
|
void on_content_loaded();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue