feat(Vehicle): Added checkbox to disable targetting

This commit is contained in:
Yimura 2022-02-22 01:39:09 +01:00
parent a2d9f04f1e
commit 9ecffc7d68
5 changed files with 16 additions and 3 deletions

View File

@ -70,6 +70,7 @@ namespace big
looped::vehicle_despawn_bypass();
looped::vehicle_god_mode();
looped::vehicle_horn_boost();
looped::vehicle_is_targetable();
looped::vehicle_speedo_meter();
}QUEUE_JOB_END_CLAUSE

View File

@ -30,6 +30,7 @@ namespace big
static void vehicle_despawn_bypass();
static void vehicle_god_mode();
static void vehicle_horn_boost();
static void vehicle_is_targetable();
static void vehicle_ls_customs();
static void vehicle_speedo_meter();

View File

@ -0,0 +1,10 @@
#include "backend/looped/looped.hpp"
namespace big
{
void looped::vehicle_is_targetable()
{
if (g_local_player && g_local_player->m_vehicle)
g_local_player->m_vehicle->m_is_targetable = g->vehicle.is_targetable;
}
}

View File

@ -110,6 +110,7 @@ namespace big
bool god_mode = false;
bool horn_boost = false;
bool is_targetable = true;
bool ls_customs = false; // don't save this to disk
bool pv_teleport_into = false;
speedo_meter speedo_meter{};
@ -211,6 +212,7 @@ namespace big
this->vehicle.god_mode = j["vehicle"]["god_mode"];
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
this->vehicle.is_targetable = j["vehicle"]["is_targetable"];
this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"];
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
@ -317,6 +319,7 @@ namespace big
"vehicle", {
{ "god_mode", this->vehicle.god_mode },
{ "horn_boost", this->vehicle.horn_boost },
{ "is_targetable", this->vehicle.is_targetable },
{ "pv_teleport_into", this->vehicle.pv_teleport_into },
{
"speedo_meter", {

View File

@ -2,9 +2,6 @@
#include "fiber_pool.hpp"
#include "main_tabs.hpp"
#include "script.hpp"
#include "util/blip.hpp"
#include "util/entity.hpp"
#include "util/notify.hpp"
#include "util/vehicle.hpp"
namespace big
@ -18,6 +15,7 @@ namespace big
if (ImGui::TreeNode("General"))
{
ImGui::BeginGroup();
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);