(feat) Add passive toggle switch button and hotkey (#2015)
* (fix) Disable looped "time to end passive" in weaponized vehicles
This commit is contained in:
parent
5f1b13d0dc
commit
e1a2ee21ea
24
src/backend/looped/self/toggle_passive.cpp
Normal file
24
src/backend/looped/self/toggle_passive.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "backend/looped_command.hpp"
|
||||
#include "script_global.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class toggle_passive : looped_command
|
||||
{
|
||||
using looped_command::looped_command;
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
*script_global(1574582+1).as<bool*>() = true;
|
||||
*script_global(1574582).as<bool*>() = true;
|
||||
}
|
||||
|
||||
virtual void on_disable() override
|
||||
{
|
||||
*script_global(1574582+1).as<bool*>() = false;
|
||||
*script_global(1574582).as<bool*>() = false;
|
||||
}
|
||||
};
|
||||
|
||||
toggle_passive g_toggle_passive("passive", "PASSIVE", "PASSIVE_DESC", g.self.passive);
|
||||
}
|
@ -309,6 +309,7 @@ namespace big
|
||||
|
||||
bool clean_player = false;
|
||||
bool force_wanted_level = false;
|
||||
bool passive = false;
|
||||
bool free_cam = false;
|
||||
bool invisibility = false;
|
||||
bool local_visibility = true;
|
||||
@ -367,7 +368,7 @@ namespace big
|
||||
// do not save below entries
|
||||
bool dance_mode = false;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, noclip_aim_speed_multiplier, noclip_speed_multiplier, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop, prompt_ambient_animations, persist_outfit, persist_outfits_mis)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, passive, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, noclip_aim_speed_multiplier, noclip_speed_multiplier, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop, prompt_ambient_animations, persist_outfit, persist_outfits_mis)
|
||||
} self{};
|
||||
|
||||
struct session
|
||||
@ -448,6 +449,7 @@ namespace big
|
||||
int skip_cutscene = 0;
|
||||
int freecam = 0;
|
||||
int superrun = 0;
|
||||
int passive = 0;
|
||||
int superjump = 0;
|
||||
int beastjump = 0;
|
||||
int invisveh = 0;
|
||||
@ -460,7 +462,7 @@ namespace big
|
||||
int clear_wanted = 0;
|
||||
int random_ped_components = 0;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(hotkeys, editing_menu_toggle, menu_toggle, teleport_waypoint, teleport_objective, teleport_selected, teleport_pv, noclip, vehicle_flymode, bringvehicle, invis, heal, fill_inventory, skip_cutscene, freecam, superrun, superjump, beastjump, invisveh, localinvisveh, fill_ammo, fast_quit, cmd_excecutor, repairpv, open_vehicle_controller, clear_wanted, random_ped_components)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(hotkeys, editing_menu_toggle, menu_toggle, teleport_waypoint, teleport_objective, teleport_selected, teleport_pv, noclip, vehicle_flymode, bringvehicle, invis, heal, fill_inventory, skip_cutscene, freecam, superrun, passive, superjump, beastjump, invisveh, localinvisveh, fill_ammo, fast_quit, cmd_excecutor, repairpv, open_vehicle_controller, clear_wanted, random_ped_components)
|
||||
} hotkeys{};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(settings, hotkeys, dev_dlc)
|
||||
|
@ -28,6 +28,7 @@ namespace big
|
||||
register_hotkey("noclip", g.settings.hotkeys.noclip, RAGE_JOAAT("noclip"));
|
||||
register_hotkey("objective", g.settings.hotkeys.teleport_objective, RAGE_JOAAT("objectivetp"));
|
||||
register_hotkey("pvtp", g.settings.hotkeys.teleport_pv, RAGE_JOAAT("pvtp"));
|
||||
register_hotkey("passive", g.settings.hotkeys.passive, RAGE_JOAAT("passive"));
|
||||
register_hotkey("repairpv", g.settings.hotkeys.repairpv, RAGE_JOAAT("repairpv"));
|
||||
register_hotkey("skipcutscene", g.settings.hotkeys.skip_cutscene, RAGE_JOAAT("skipcutscene"));
|
||||
register_hotkey("superjump", g.settings.hotkeys.superjump, RAGE_JOAAT("superjump"));
|
||||
|
@ -41,6 +41,8 @@ namespace big
|
||||
if (g.self.invisibility)
|
||||
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
|
||||
|
||||
components::command_checkbox<"passive">();
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
@ -26,6 +26,8 @@ namespace big
|
||||
g_hotkey_service->update_hotkey("bringpv", g.settings.hotkeys.bringvehicle);
|
||||
if (ImGui::Hotkey("Toggle invisibility", &g.settings.hotkeys.invis))
|
||||
g_hotkey_service->update_hotkey("invis", g.settings.hotkeys.invis);
|
||||
if (ImGui::Hotkey("Toggle passive mode", &g.settings.hotkeys.passive))
|
||||
g_hotkey_service->update_hotkey("passive", g.settings.hotkeys.passive);
|
||||
if (ImGui::Hotkey("Heal", &g.settings.hotkeys.heal))
|
||||
g_hotkey_service->update_hotkey("heal", g.settings.hotkeys.heal);
|
||||
if (ImGui::Hotkey("Fill Snacks", &g.settings.hotkeys.fill_inventory))
|
||||
|
Reference in New Issue
Block a user