refactor: switch RAGE_JOAAT with string literal functions (#2806)
Why? Shorter to write and removes the macro usage I used the following regex to find all occurrences: ```r RAGE_JOAAT\("(.*?)"\) ``` then the following to replace it all: ```r "$1"_J ```
This commit is contained in:
@ -11,19 +11,19 @@ namespace big
|
||||
|
||||
ImGui::PushID(1);
|
||||
components::button("VIEW_NET_MISSIONS_START_EVENT"_T, [] {
|
||||
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
|
||||
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
|
||||
if (scripts::force_host("am_cp_collection"_J))
|
||||
if (auto script = gta_util::find_script_thread("am_cp_collection"_J))
|
||||
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(667).as<int*>() = 0;
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("VIEW_NET_MISSIONS_FINISH_EVENT"_T, [] {
|
||||
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
|
||||
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
|
||||
if (scripts::force_host("am_cp_collection"_J))
|
||||
if (auto script = gta_util::find_script_thread("am_cp_collection"_J))
|
||||
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(661).as<int*>() = 0;
|
||||
});
|
||||
ImGui::PopID();
|
||||
components::button("VIEW_NET_MISSIONS_WIN_EVENT"_T, [] {
|
||||
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
|
||||
if (auto checkpoints = gta_util::find_script_thread("am_cp_collection"_J))
|
||||
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::player_broadcast_idx)
|
||||
.at(((CGameScriptHandlerNetComponent*)checkpoints->m_net_component)->m_local_participant_index, 5)
|
||||
.at(4)
|
||||
@ -31,9 +31,9 @@ namespace big
|
||||
|
||||
script::get_current()->yield(1s);
|
||||
|
||||
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
|
||||
if (scripts::force_host("am_cp_collection"_J))
|
||||
{
|
||||
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
|
||||
if (auto checkpoints = gta_util::find_script_thread("am_cp_collection"_J))
|
||||
{
|
||||
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(708).as<int*>() = 0;
|
||||
}
|
||||
@ -52,9 +52,9 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
|
||||
if (scripts::force_host("am_cp_collection"_J))
|
||||
{
|
||||
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
|
||||
if (auto checkpoints = gta_util::find_script_thread("am_cp_collection"_J))
|
||||
{
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
@ -65,4 +65,4 @@ namespace big
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user