refactor!: globals (#717)
* refactor(globals): use macro's for to_json/from_json * refactor(globals): switch from global pointer to global instance
This commit is contained in:
@ -20,7 +20,7 @@ namespace big
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Keep Vehicle Repaired", &g->vehicle.keep_vehicle_repaired);
|
||||
ImGui::Checkbox("Keep Vehicle Repaired", &g.vehicle.keep_vehicle_repaired);
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
@ -45,8 +45,8 @@ namespace big
|
||||
vehicle::set_engine_state(
|
||||
self::veh,
|
||||
true,
|
||||
g->vehicle.change_engine_state_immediately,
|
||||
g->vehicle.disable_engine_auto_start
|
||||
g.vehicle.change_engine_state_immediately,
|
||||
g.vehicle.disable_engine_auto_start
|
||||
);
|
||||
});
|
||||
ImGui::SameLine();
|
||||
@ -54,42 +54,42 @@ namespace big
|
||||
vehicle::set_engine_state(
|
||||
self::veh,
|
||||
false,
|
||||
g->vehicle.change_engine_state_immediately,
|
||||
g->vehicle.disable_engine_auto_start
|
||||
g.vehicle.change_engine_state_immediately,
|
||||
g.vehicle.disable_engine_auto_start
|
||||
);
|
||||
});
|
||||
ImGui::Checkbox("Disable Engine Auto Start", &g->vehicle.disable_engine_auto_start);
|
||||
ImGui::Checkbox("Disable Engine Auto Start", &g.vehicle.disable_engine_auto_start);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Change State Immediately", &g->vehicle.change_engine_state_immediately);
|
||||
ImGui::Checkbox("Change State Immediately", &g.vehicle.change_engine_state_immediately);
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
components::sub_title("General");
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
|
||||
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);
|
||||
ImGui::Checkbox("Vehicle Jump", &g->vehicle.vehicle_jump);
|
||||
ImGui::Checkbox("God Mode", &g.vehicle.god_mode);
|
||||
ImGui::Checkbox("Horn Boost", &g.vehicle.horn_boost);
|
||||
ImGui::Checkbox("Vehicle Jump", &g.vehicle.vehicle_jump);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Instant Brake", &g->vehicle.instant_brake);
|
||||
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
|
||||
ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water);
|
||||
ImGui::Checkbox("Instant Brake", &g.vehicle.instant_brake);
|
||||
ImGui::Checkbox("Can Be Targeted", &g.vehicle.is_targetable);
|
||||
ImGui::Checkbox("Drive On Water", &g.vehicle.drive_on_water);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Seatbelt", &g->vehicle.seatbelt);
|
||||
ImGui::Checkbox("Turn Signals", &g->vehicle.turn_signals);
|
||||
if (g->vehicle.turn_signals)
|
||||
ImGui::Checkbox("Seatbelt", &g.vehicle.seatbelt);
|
||||
ImGui::Checkbox("Turn Signals", &g.vehicle.turn_signals);
|
||||
if (g.vehicle.turn_signals)
|
||||
{
|
||||
ImGui::Checkbox("Fully Automatic Signal", &g->vehicle.auto_turn_signals);
|
||||
ImGui::Checkbox("Fully Automatic Signal", &g.vehicle.auto_turn_signals);
|
||||
}
|
||||
ImGui::Checkbox("No Water Collision", &g->vehicle.no_water_collision);
|
||||
ImGui::Checkbox("No Water Collision", &g.vehicle.no_water_collision);
|
||||
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
@ -100,52 +100,52 @@ namespace big
|
||||
{
|
||||
if (ImGui::Button("Check all"))
|
||||
{
|
||||
g->vehicle.proof_bullet = true;
|
||||
g->vehicle.proof_fire = true;
|
||||
g->vehicle.proof_collision = true;
|
||||
g->vehicle.proof_melee = true;
|
||||
g->vehicle.proof_explosion = true;
|
||||
g->vehicle.proof_steam = true;
|
||||
g->vehicle.proof_water = true;
|
||||
g.vehicle.proof_bullet = true;
|
||||
g.vehicle.proof_fire = true;
|
||||
g.vehicle.proof_collision = true;
|
||||
g.vehicle.proof_melee = true;
|
||||
g.vehicle.proof_explosion = true;
|
||||
g.vehicle.proof_steam = true;
|
||||
g.vehicle.proof_water = true;
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Uncheck all"))
|
||||
{
|
||||
g->vehicle.proof_bullet = false;
|
||||
g->vehicle.proof_fire = false;
|
||||
g->vehicle.proof_collision = false;
|
||||
g->vehicle.proof_melee = false;
|
||||
g->vehicle.proof_explosion = false;
|
||||
g->vehicle.proof_steam = false;
|
||||
g->vehicle.proof_water = false;
|
||||
g.vehicle.proof_bullet = false;
|
||||
g.vehicle.proof_fire = false;
|
||||
g.vehicle.proof_collision = false;
|
||||
g.vehicle.proof_melee = false;
|
||||
g.vehicle.proof_explosion = false;
|
||||
g.vehicle.proof_steam = false;
|
||||
g.vehicle.proof_water = false;
|
||||
}
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Bullet", &g->vehicle.proof_bullet);
|
||||
ImGui::Checkbox("Fire", &g->vehicle.proof_fire);
|
||||
ImGui::Checkbox("Bullet", &g.vehicle.proof_bullet);
|
||||
ImGui::Checkbox("Fire", &g.vehicle.proof_fire);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Collision", &g->vehicle.proof_collision);
|
||||
ImGui::Checkbox("Melee", &g->vehicle.proof_melee);
|
||||
ImGui::Checkbox("Collision", &g.vehicle.proof_collision);
|
||||
ImGui::Checkbox("Melee", &g.vehicle.proof_melee);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Explosion", &g->vehicle.proof_explosion);
|
||||
ImGui::Checkbox("Steam", &g->vehicle.proof_steam);
|
||||
ImGui::Checkbox("Explosion", &g.vehicle.proof_explosion);
|
||||
ImGui::Checkbox("Steam", &g.vehicle.proof_steam);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Water", &g->vehicle.proof_water);
|
||||
ImGui::Checkbox("Water", &g.vehicle.proof_water);
|
||||
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
@ -156,19 +156,19 @@ namespace big
|
||||
{
|
||||
ImGui::RadioButton(
|
||||
speed_unit_strings[(int)SpeedUnit::KMPH].c_str(),
|
||||
(int*)&g->vehicle.speed_unit,
|
||||
(int*)&g.vehicle.speed_unit,
|
||||
(int)SpeedUnit::KMPH
|
||||
);
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton(
|
||||
speed_unit_strings[(int)SpeedUnit::MIPH].c_str(),
|
||||
(int*)&g->vehicle.speed_unit,
|
||||
(int*)&g.vehicle.speed_unit,
|
||||
(int)SpeedUnit::MIPH
|
||||
);
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton(
|
||||
speed_unit_strings[(int)SpeedUnit::MPS].c_str(),
|
||||
(int*)&g->vehicle.speed_unit,
|
||||
(int*)&g.vehicle.speed_unit,
|
||||
(int)SpeedUnit::MPS
|
||||
);
|
||||
}
|
||||
@ -177,58 +177,58 @@ namespace big
|
||||
|
||||
components::sub_title("Speedo Meter");
|
||||
{
|
||||
ImGui::Checkbox("Enabled", &g->vehicle.speedo_meter.enabled);
|
||||
ImGui::Checkbox("Enabled", &g.vehicle.speedo_meter.enabled);
|
||||
|
||||
if (g->vehicle.speedo_meter.enabled)
|
||||
if (g.vehicle.speedo_meter.enabled)
|
||||
{
|
||||
ImGui::Text("Position (X, Y)");
|
||||
|
||||
float pos[2] = { g->vehicle.speedo_meter.x, g->vehicle.speedo_meter.y };
|
||||
float pos[2] = { g.vehicle.speedo_meter.x, g.vehicle.speedo_meter.y };
|
||||
|
||||
if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f"))
|
||||
{
|
||||
g->vehicle.speedo_meter.x = pos[0];
|
||||
g->vehicle.speedo_meter.y = pos[1];
|
||||
g.vehicle.speedo_meter.x = pos[0];
|
||||
g.vehicle.speedo_meter.y = pos[1];
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side);
|
||||
ImGui::Checkbox("Left Sided", &g.vehicle.speedo_meter.left_side);
|
||||
}
|
||||
}
|
||||
|
||||
g->vehicle.proof_mask = 0;
|
||||
if (g->vehicle.god_mode)
|
||||
g.vehicle.proof_mask = 0;
|
||||
if (g.vehicle.god_mode)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::GOD);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::GOD);
|
||||
}
|
||||
if (g->vehicle.proof_bullet)
|
||||
if (g.vehicle.proof_bullet)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::BULLET);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::BULLET);
|
||||
}
|
||||
if (g->vehicle.proof_fire)
|
||||
if (g.vehicle.proof_fire)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::FIRE);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::FIRE);
|
||||
}
|
||||
if (g->vehicle.proof_collision)
|
||||
if (g.vehicle.proof_collision)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::COLLISION);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::COLLISION);
|
||||
}
|
||||
if (g->vehicle.proof_melee)
|
||||
if (g.vehicle.proof_melee)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::MELEE);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::MELEE);
|
||||
}
|
||||
if (g->vehicle.proof_explosion)
|
||||
if (g.vehicle.proof_explosion)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::EXPLOSION);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::EXPLOSION);
|
||||
}
|
||||
if (g->vehicle.proof_steam)
|
||||
if (g.vehicle.proof_steam)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::STEAM);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::STEAM);
|
||||
}
|
||||
if (g->vehicle.proof_water)
|
||||
if (g.vehicle.proof_water)
|
||||
{
|
||||
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::WATER);
|
||||
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::WATER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user