26 lines
779 B
C++
26 lines
779 B
C++
![]() |
#pragma once
|
||
|
#include <script/scrProgram.hpp>
|
||
|
#include "memory/pattern.hpp"
|
||
|
#include "script_patch.hpp"
|
||
|
#include "script_data.hpp"
|
||
|
|
||
|
namespace big
|
||
|
{
|
||
|
class script_patcher_service
|
||
|
{
|
||
|
std::vector<script_patch> m_script_patches;
|
||
|
std::unordered_map<rage::joaat_t, std::unique_ptr<script_data>> m_script_data;
|
||
|
script_data* get_data_for_script(rage::joaat_t script);
|
||
|
bool does_script_have_patches(rage::joaat_t script);
|
||
|
void create_data_for_script(rage::scrProgram* program);
|
||
|
void update_all_patches_for_script(rage::joaat_t script);
|
||
|
|
||
|
public:
|
||
|
void add_patch(script_patch&& patch);
|
||
|
void on_script_load(rage::scrProgram* program);
|
||
|
std::uint8_t** get_script_bytecode(rage::joaat_t script);
|
||
|
void update();
|
||
|
};
|
||
|
|
||
|
inline script_patcher_service g_script_patcher_service;
|
||
|
}
|