Added script-listener to packs loading

This commit is contained in:
Xertis 2026-03-22 21:40:38 +03:00
parent b5f5aeb5c6
commit 61625ffe00
5 changed files with 92 additions and 1 deletions

View file

@ -27,6 +27,7 @@ struct BlockFuncNamesCache;
struct ItemFuncsSet;
struct ItemFuncNamesCache;
struct WorldFuncsSet;
struct MainFuncsSet;
struct UserComponent;
struct UiDocScript;
class BlocksController;
@ -160,6 +161,15 @@ namespace scripting {
/// @brief Called on UI view close
void on_ui_close(UiDocument* layout, Inventory* inventory);
/// @brief Called before loading
void on_content_initialization();
/// @brief Called on Content loading
void on_content_loading();
/// @brief Called on Content loading finish
void on_content_loaded();
/// @brief Load script associated with a Block
/// @param env environment
/// @param prefix pack id
@ -221,6 +231,14 @@ namespace scripting {
WorldFuncsSet& funcsset
);
void load_main_script(
const scriptenv& env,
const std::string& packid,
const io::path& file,
const std::string& fileName,
MainFuncsSet& funcsset
);
/// @brief Load script associated with an UiDocument
/// @param env environment
/// @param prefix pack id