-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lua: completly butchered but seemingly working barebone implementation
- Loading branch information
1 parent
6d97562
commit 1df8d10
Showing
9 changed files
with
291 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,6 @@ | ||
#include "sgg_lua.hpp" | ||
|
||
#include "threads/util.hpp" | ||
|
||
#include <hooks/hooking.hpp> | ||
#include <lua/lua_manager.hpp> | ||
#include <memory/gm_address.hpp> | ||
#include <pointers.hpp> | ||
|
||
namespace big | ||
{ | ||
static std::unique_ptr<lua_manager> lua_manager_instance; | ||
|
||
void hook_luaL_checkversion_(lua_State* L, lua_Number ver) | ||
{ | ||
} | ||
|
||
void hook_sgg_ScriptManager_Clear() | ||
{ | ||
threads::suspend_all_but_one(); | ||
|
||
lua_manager_instance.reset(); | ||
LOG(INFO) << "Lua manager reset."; | ||
|
||
big::g_hooking->get_original<hook_sgg_ScriptManager_Clear>()(); | ||
} | ||
|
||
void hook_InitLua() | ||
{ | ||
big::g_hooking->get_original<hook_InitLua>()(); | ||
|
||
lua_manager_instance = std::make_unique<lua_manager>(*g_pointers->m_hades2.m_lua_state, | ||
g_file_manager.get_project_folder("config"), | ||
g_file_manager.get_project_folder("plugins_data"), | ||
g_file_manager.get_project_folder("plugins")); | ||
LOG(INFO) << "Lua manager initialized."; | ||
|
||
threads::resume_all(); | ||
} | ||
} // namespace big |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.