mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add on_hud_render event
This commit is contained in:
parent
247acb3687
commit
4aa76e35b7
4 changed files with 17 additions and 0 deletions
|
|
@ -28,6 +28,15 @@ void scripting::on_frontend_init(Hud* hud) {
|
|||
}
|
||||
}
|
||||
|
||||
void scripting::on_frontend_render() {
|
||||
for (auto& pack : engine->getContentPacks()) {
|
||||
lua::emit_event(lua::get_main_thread(), pack.id + ".hudrender",
|
||||
[&] (lua::State* L) {
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void scripting::on_frontend_close() {
|
||||
for (auto& pack : engine->getContentPacks()) {
|
||||
lua::emit_event(lua::get_main_thread(), pack.id + ".hudclose",
|
||||
|
|
@ -47,5 +56,6 @@ void scripting::load_hud_script(const scriptenv& senv, const std::string& packid
|
|||
|
||||
register_event(env, "init", packid+".init");
|
||||
register_event(env, "on_hud_open", packid+".hudopen");
|
||||
register_event(env, "on_hud_render", packid+".hudrender");
|
||||
register_event(env, "on_hud_close", packid+".hudclose");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue