Lua: refactor script api, more doc, add button for Open Lua Scripts Folder (#1588)

* lua manager: pass down the scripts folder to the instance instead of hard coding calls to the file manager everywhere
* lua: add open lua scripts folder button
* lua api: change script binding so that user cannot by mistake try to sleep or yield in a non script context
This commit is contained in:
Quentin
2023-07-03 13:01:12 +02:00
committed by GitHub
parent 7c927e0cfb
commit 6d6848c2fb
8 changed files with 186 additions and 58 deletions

View File

@ -20,11 +20,13 @@ namespace big
static constexpr std::chrono::seconds m_delay_between_changed_scripts_check = 3s;
std::chrono::high_resolution_clock::time_point m_wake_time_changed_scripts_check;
folder m_scripts_folder;
public:
bool m_schedule_reload_modules;
public:
lua_manager();
lua_manager(folder scripts_folder);
~lua_manager();
void load_all_modules();
@ -35,6 +37,11 @@ namespace big
return m_modules.size();
}
inline const folder& get_scripts_folder() const
{
return m_scripts_folder;
}
void draw_gui(rage::joaat_t tab_hash);
void unload_module(rage::joaat_t module_id);