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:
@ -9,21 +9,21 @@ namespace big
|
||||
components::sub_title("CRIMINAL_DAMAGE"_T);
|
||||
ImGui::PushID(2);
|
||||
components::button("VIEW_NET_MISSIONS_START_EVENT"_T, [] {
|
||||
if (scripts::force_host(RAGE_JOAAT("am_criminal_damage")))
|
||||
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
|
||||
if (scripts::force_host("am_criminal_damage"_J))
|
||||
if (auto script = gta_util::find_script_thread("am_criminal_damage"_J))
|
||||
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(43).as<int*>() = 0;
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("VIEW_NET_MISSIONS_FINISH_EVENT"_T, [] {
|
||||
if (scripts::force_host(RAGE_JOAAT("am_criminal_damage")))
|
||||
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
|
||||
if (scripts::force_host("am_criminal_damage"_J))
|
||||
if (auto script = gta_util::find_script_thread("am_criminal_damage"_J))
|
||||
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(39).as<int*>() = 0;
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
components::button("VIEW_NET_MISSIONS_MAX_SCORE"_T, [] {
|
||||
if (auto criminal_damage = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
|
||||
if (auto criminal_damage = gta_util::find_script_thread("am_criminal_damage"_J))
|
||||
*script_local(criminal_damage->m_stack, scr_locals::am_criminal_damage::score_idx).as<int*>() = 999'999'999;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user