2023-06-06 07:40:40 +00:00
|
|
|
#pragma once
|
|
|
|
#include "bindings/gui/gui_element.hpp"
|
|
|
|
#include "lua_patch.hpp"
|
|
|
|
#include "sol.hpp"
|
2023-07-02 00:59:02 +02:00
|
|
|
#include "core/data/menu_event.hpp"
|
2023-06-06 07:40:40 +00:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
class script;
|
|
|
|
|
|
|
|
class lua_module
|
|
|
|
{
|
|
|
|
sol::state m_state;
|
|
|
|
std::string m_module_name;
|
|
|
|
rage::joaat_t m_module_id;
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::vector<script*> m_registered_scripts;
|
|
|
|
std::vector<std::shared_ptr<lua_patch>> m_registered_patches;
|
|
|
|
std::unordered_map<rage::joaat_t, std::vector<std::shared_ptr<lua::gui::gui_element>>> m_gui;
|
2023-07-02 00:59:02 +02:00
|
|
|
std::unordered_map<menu_event, std::vector<sol::function>> m_event_callbacks;
|
2023-06-06 07:40:40 +00:00
|
|
|
std::vector<void*> m_allocated_memory;
|
|
|
|
|
|
|
|
lua_module(std::string module_name);
|
|
|
|
~lua_module();
|
2023-06-27 20:13:05 +02:00
|
|
|
|
2023-06-06 07:40:40 +00:00
|
|
|
rage::joaat_t module_id();
|
|
|
|
const std::string& module_name();
|
2023-06-27 20:13:05 +02:00
|
|
|
|
|
|
|
// used for adding our own paths to the search paths of the lua require function
|
|
|
|
void add_folder_to_require_available_paths(const big::folder& scripts_folder);
|
|
|
|
|
|
|
|
void init_lua_api();
|
2023-06-06 07:40:40 +00:00
|
|
|
};
|
|
|
|
}
|