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:
@ -85,32 +85,32 @@ namespace big
|
||||
|
||||
components::sub_title("Auto Drive");
|
||||
{
|
||||
float auto_drive_speed_user_unit = vehicle::mps_to_speed(g->vehicle.auto_drive_speed, g->vehicle.speed_unit);
|
||||
float auto_drive_speed_user_unit = vehicle::mps_to_speed(g.vehicle.auto_drive_speed, g.vehicle.speed_unit);
|
||||
if (ImGui::SliderFloat(
|
||||
std::format("Top Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(),
|
||||
std::format("Top Speed({})", speed_unit_strings[(int)g.vehicle.speed_unit]).c_str(),
|
||||
&auto_drive_speed_user_unit,
|
||||
vehicle::mps_to_speed(0.f, g->vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(150.f, g->vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
|
||||
"%.1f"
|
||||
)) {
|
||||
g->vehicle.auto_drive_speed = vehicle::speed_to_mps(auto_drive_speed_user_unit, g->vehicle.speed_unit);
|
||||
g.vehicle.auto_drive_speed = vehicle::speed_to_mps(auto_drive_speed_user_unit, g.vehicle.speed_unit);
|
||||
}
|
||||
|
||||
static constexpr char const* driving_style_names[] = { "Law-Abiding", "The Road Is Yours" };
|
||||
if (ImGui::BeginCombo("Driving Style", driving_style_names[(int)g->vehicle.auto_drive_style]))
|
||||
if (ImGui::BeginCombo("Driving Style", driving_style_names[(int)g.vehicle.auto_drive_style]))
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (ImGui::Selectable(driving_style_names[i], g->vehicle.auto_drive_style == (AutoDriveStyle)i))
|
||||
if (ImGui::Selectable(driving_style_names[i], g.vehicle.auto_drive_style == (AutoDriveStyle)i))
|
||||
{
|
||||
g->vehicle.auto_drive_style = (AutoDriveStyle)i;
|
||||
g.vehicle.auto_drive_style = (AutoDriveStyle)i;
|
||||
g_notification_service->push_warning(
|
||||
"Auto Drive",
|
||||
std::format("Driving style set to {}.", driving_style_names[i])
|
||||
);
|
||||
}
|
||||
|
||||
if (g->vehicle.auto_drive_style == (AutoDriveStyle)i)
|
||||
if (g.vehicle.auto_drive_style == (AutoDriveStyle)i)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
@ -120,19 +120,19 @@ namespace big
|
||||
}
|
||||
|
||||
if (components::button("To Objective")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::OBJECTITVE;
|
||||
g.vehicle.auto_drive_destination = AutoDriveDestination::OBJECTITVE;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("To Waypoint")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::WAYPOINT;
|
||||
g.vehicle.auto_drive_destination = AutoDriveDestination::WAYPOINT;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("Wander")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::WANDER;
|
||||
g.vehicle.auto_drive_destination = AutoDriveDestination::WANDER;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("Emergency Stop")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::EMERGENCY_STOP;
|
||||
g.vehicle.auto_drive_destination = AutoDriveDestination::EMERGENCY_STOP;
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
@ -140,26 +140,26 @@ namespace big
|
||||
|
||||
components::sub_title("Rainbow Paint");
|
||||
{
|
||||
ImGui::Checkbox("Primary", &g->vehicle.rainbow_paint.primary);
|
||||
ImGui::Checkbox("Primary", &g.vehicle.rainbow_paint.primary);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Secondary", &g->vehicle.rainbow_paint.secondary);
|
||||
ImGui::Checkbox("Secondary", &g.vehicle.rainbow_paint.secondary);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Neon", &g->vehicle.rainbow_paint.neon);
|
||||
ImGui::Checkbox("Neon", &g.vehicle.rainbow_paint.neon);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Smoke", &g->vehicle.rainbow_paint.smoke);
|
||||
ImGui::Checkbox("Smoke", &g.vehicle.rainbow_paint.smoke);
|
||||
|
||||
static constexpr char const* rgb_types[] = { "Off", "Fade", "Spasm" };
|
||||
|
||||
ImGui::SetNextItemWidth(120);
|
||||
if (ImGui::BeginCombo("RGB Type", rgb_types[(int)g->vehicle.rainbow_paint.type]))
|
||||
if (ImGui::BeginCombo("RGB Type", rgb_types[(int)g.vehicle.rainbow_paint.type]))
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
bool itemSelected = (int)g->vehicle.rainbow_paint.type == i;
|
||||
bool itemSelected = (int)g.vehicle.rainbow_paint.type == i;
|
||||
|
||||
if (ImGui::Selectable(rgb_types[i], itemSelected))
|
||||
{
|
||||
g->vehicle.rainbow_paint.type = (RainbowPaintType)i;
|
||||
g.vehicle.rainbow_paint.type = (RainbowPaintType)i;
|
||||
}
|
||||
|
||||
if (itemSelected)
|
||||
@ -170,25 +170,25 @@ namespace big
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
if (g->vehicle.rainbow_paint.type != RainbowPaintType::Off)
|
||||
if (g.vehicle.rainbow_paint.type != RainbowPaintType::Off)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(150);
|
||||
ImGui::SliderInt("RGB Speed", &g->vehicle.rainbow_paint.speed, 1, 10);
|
||||
ImGui::SliderInt("RGB Speed", &g.vehicle.rainbow_paint.speed, 1, 10);
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
static constexpr char const* boost_behaviors[] = { "Default", "Instant Refill", "Infinite" };
|
||||
if (ImGui::BeginCombo("Boost Behavior", boost_behaviors[static_cast<int>(g->vehicle.boost_behavior)]))
|
||||
if (ImGui::BeginCombo("Boost Behavior", boost_behaviors[static_cast<int>(g.vehicle.boost_behavior)]))
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
bool itemSelected = g->vehicle.boost_behavior == static_cast<eBoostBehaviors>(i);
|
||||
bool itemSelected = g.vehicle.boost_behavior == static_cast<eBoostBehaviors>(i);
|
||||
|
||||
if (ImGui::Selectable(boost_behaviors[i], itemSelected))
|
||||
{
|
||||
g->vehicle.boost_behavior = static_cast<eBoostBehaviors>(i);
|
||||
g.vehicle.boost_behavior = static_cast<eBoostBehaviors>(i);
|
||||
}
|
||||
|
||||
if (itemSelected)
|
||||
@ -207,27 +207,27 @@ namespace big
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Enabled", &g->vehicle.fly.enabled);
|
||||
ImGui::Checkbox("Don't Stop", &g->vehicle.fly.dont_stop);
|
||||
ImGui::Checkbox("Enabled", &g.vehicle.fly.enabled);
|
||||
ImGui::Checkbox("Don't Stop", &g.vehicle.fly.dont_stop);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Disable Collision", &g->vehicle.fly.no_collision);
|
||||
ImGui::Checkbox("Stop On Exit", &g->vehicle.fly.stop_on_exit);
|
||||
ImGui::Checkbox("Disable Collision", &g.vehicle.fly.no_collision);
|
||||
ImGui::Checkbox("Stop On Exit", &g.vehicle.fly.stop_on_exit);
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
float fly_speed_user_unit = vehicle::mps_to_speed(g->vehicle.fly.speed, g->vehicle.speed_unit);
|
||||
float fly_speed_user_unit = vehicle::mps_to_speed(g.vehicle.fly.speed, g.vehicle.speed_unit);
|
||||
if (ImGui::SliderFloat(
|
||||
std::format("Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(),
|
||||
std::format("Speed({})", speed_unit_strings[(int)g.vehicle.speed_unit]).c_str(),
|
||||
&fly_speed_user_unit,
|
||||
vehicle::mps_to_speed(0.f, g->vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(150.f, g->vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
|
||||
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
|
||||
"%.1f"
|
||||
)) {
|
||||
g->vehicle.fly.speed = vehicle::speed_to_mps(fly_speed_user_unit, g->vehicle.speed_unit);
|
||||
g.vehicle.fly.speed = vehicle::speed_to_mps(fly_speed_user_unit, g.vehicle.speed_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ namespace big
|
||||
}
|
||||
|
||||
components::button("Start LS Customs", [] {
|
||||
g->vehicle.ls_customs = true;
|
||||
g.vehicle.ls_customs = true;
|
||||
});
|
||||
ImGui::SameLine();
|
||||
if (components::button("Max Vehicle"))
|
||||
|
@ -27,7 +27,7 @@ namespace big
|
||||
{
|
||||
g_notification_service->push_warning("Persist Car", "Vehicle failed to spawn, there is most likely too many spawned vehicles in the area");
|
||||
}
|
||||
else if (g->spawn_vehicle.spawn_inside)
|
||||
else if (g.spawn_vehicle.spawn_inside)
|
||||
teleport::into_vehicle(vehicle);
|
||||
|
||||
selected_vehicle_file.clear();
|
||||
|
@ -11,30 +11,30 @@ namespace big
|
||||
void view::pv() {
|
||||
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
|
||||
|
||||
if (ImGui::Checkbox("Preview", &g->clone_pv.preview_vehicle))
|
||||
if (ImGui::Checkbox("Preview", &g.clone_pv.preview_vehicle))
|
||||
{
|
||||
if (!g->clone_pv.preview_vehicle)
|
||||
if (!g.clone_pv.preview_vehicle)
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Spawn In", &g->clone_pv.spawn_inside);
|
||||
ImGui::Checkbox("Spawn In", &g.clone_pv.spawn_inside);
|
||||
ImGui::SameLine();
|
||||
|
||||
static char plate_buf[9] = { 0 };
|
||||
int num_of_rows = 3;
|
||||
|
||||
ImGui::Checkbox("Spawn Clone", &g->clone_pv.spawn_clone);
|
||||
if (g->clone_pv.spawn_clone)
|
||||
ImGui::Checkbox("Spawn Clone", &g.clone_pv.spawn_clone);
|
||||
if (g.clone_pv.spawn_clone)
|
||||
{
|
||||
num_of_rows = 5;
|
||||
|
||||
ImGui::Checkbox("Spawn Maxed", &g->clone_pv.spawn_maxed);
|
||||
ImGui::Checkbox("Spawn Maxed", &g.clone_pv.spawn_maxed);
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Clone PV Plate", &g->clone_pv.clone_plate);
|
||||
if (g->clone_pv.clone_plate)
|
||||
ImGui::Checkbox("Clone PV Plate", &g.clone_pv.clone_plate);
|
||||
if (g.clone_pv.clone_plate)
|
||||
{
|
||||
num_of_rows = 4;
|
||||
}
|
||||
@ -42,9 +42,9 @@ namespace big
|
||||
{
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
|
||||
strncpy(plate_buf, g->clone_pv.plate.c_str(), 9);
|
||||
strncpy(plate_buf, g.clone_pv.plate.c_str(), 9);
|
||||
components::input_text_with_hint("Plate", "Plate Number", plate_buf, sizeof(plate_buf), ImGuiInputTextFlags_None, [] {
|
||||
g->clone_pv.plate = plate_buf;
|
||||
g.clone_pv.plate = plate_buf;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -116,16 +116,16 @@ namespace big
|
||||
|
||||
ImGui::PushID('v' << 24 & personal_veh->get_id());
|
||||
components::selectable(label, false, [&personal_veh] {
|
||||
if (g->clone_pv.spawn_clone)
|
||||
if (g.clone_pv.spawn_clone)
|
||||
{
|
||||
Vector3 spawn_location = vehicle::get_spawn_location(g->spawn_vehicle.spawn_inside);
|
||||
Vector3 spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
|
||||
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
|
||||
|
||||
auto vehicle_idx = personal_veh->get_vehicle_idx();
|
||||
auto owned_mods = vehicle::get_owned_mods_from_vehicle_idx(vehicle_idx);
|
||||
|
||||
const char* spawn_plate_buf = plate_buf;
|
||||
if (g->clone_pv.clone_plate)
|
||||
if (g.clone_pv.clone_plate)
|
||||
{
|
||||
spawn_plate_buf = personal_veh->get_plate();
|
||||
}
|
||||
@ -138,14 +138,14 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->clone_pv.spawn_maxed)
|
||||
if (g.clone_pv.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, spawn_plate_buf);
|
||||
|
||||
if (g->clone_pv.spawn_inside)
|
||||
if (g.clone_pv.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
@ -161,7 +161,7 @@ namespace big
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
if (!g->clone_pv.preview_vehicle || (g->clone_pv.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
if (!g.clone_pv.preview_vehicle || (g.clone_pv.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
@ -170,7 +170,7 @@ namespace big
|
||||
g_fiber_pool->queue_job([&personal_veh] {
|
||||
g_model_preview_service->show_vehicle(
|
||||
vehicle::get_owned_mods_from_vehicle_idx(personal_veh->get_vehicle_idx()),
|
||||
g->clone_pv.spawn_maxed
|
||||
g.clone_pv.spawn_maxed
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -11,24 +11,24 @@ namespace big
|
||||
{
|
||||
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
|
||||
|
||||
if (ImGui::Checkbox("Preview", &g->spawn_vehicle.preview_vehicle))
|
||||
if (ImGui::Checkbox("Preview", &g.spawn_vehicle.preview_vehicle))
|
||||
{
|
||||
if (!g->spawn_vehicle.preview_vehicle)
|
||||
if (!g.spawn_vehicle.preview_vehicle)
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Spawn In", &g->spawn_vehicle.spawn_inside);
|
||||
ImGui::Checkbox("Spawn In", &g.spawn_vehicle.spawn_inside);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Spawn Maxed", &g->spawn_vehicle.spawn_maxed);
|
||||
ImGui::Checkbox("Spawn Maxed", &g.spawn_vehicle.spawn_maxed);
|
||||
|
||||
static char plate_buf[9] = { 0 };
|
||||
strncpy(plate_buf, g->spawn_vehicle.plate.c_str(), 9);
|
||||
strncpy(plate_buf, g.spawn_vehicle.plate.c_str(), 9);
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
components::input_text_with_hint("Plate", "Plate Number", plate_buf, sizeof(plate_buf), ImGuiInputTextFlags_None, [] {
|
||||
g->spawn_vehicle.plate = plate_buf;
|
||||
g.spawn_vehicle.plate = plate_buf;
|
||||
});
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ namespace big
|
||||
components::selectable(std::format("Current Vehicle [{}]", item.m_display_name), false, [] {
|
||||
if (self::veh)
|
||||
{
|
||||
Vector3 spawn_location = vehicle::get_spawn_location(g->spawn_vehicle.spawn_inside);
|
||||
Vector3 spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
|
||||
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
|
||||
|
||||
auto owned_mods = vehicle::get_owned_mods_from_vehicle(self::veh);
|
||||
@ -96,14 +96,14 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->spawn_vehicle.spawn_maxed)
|
||||
if (g.spawn_vehicle.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, plate_buf);
|
||||
|
||||
if (g->spawn_vehicle.spawn_inside)
|
||||
if (g.spawn_vehicle.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
@ -113,7 +113,7 @@ namespace big
|
||||
g_model_preview_service->stop_preview();
|
||||
});
|
||||
|
||||
if (!g->spawn_vehicle.preview_vehicle || (g->spawn_vehicle.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
if (!g.spawn_vehicle.preview_vehicle || (g.spawn_vehicle.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
@ -122,7 +122,7 @@ namespace big
|
||||
g_fiber_pool->queue_job([] {
|
||||
g_model_preview_service->show_vehicle(
|
||||
vehicle::get_owned_mods_from_vehicle(self::veh),
|
||||
g->spawn_vehicle.spawn_maxed
|
||||
g.spawn_vehicle.spawn_maxed
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -155,7 +155,7 @@ namespace big
|
||||
ImGui::PushID(vehicle.m_hash);
|
||||
components::selectable(vehicle.m_display_name, false, [&vehicle]
|
||||
{
|
||||
const auto spawn_location = vehicle::get_spawn_location(g->spawn_vehicle.spawn_inside);
|
||||
const auto spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
|
||||
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
|
||||
|
||||
const auto veh = vehicle::spawn(vehicle.m_hash, spawn_location, spawn_heading);
|
||||
@ -166,14 +166,14 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->spawn_vehicle.spawn_maxed)
|
||||
if (g.spawn_vehicle.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, plate_buf);
|
||||
|
||||
if (g->spawn_vehicle.spawn_inside)
|
||||
if (g.spawn_vehicle.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
@ -183,13 +183,13 @@ namespace big
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
if (!g->spawn_vehicle.preview_vehicle || (g->spawn_vehicle.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
if (!g.spawn_vehicle.preview_vehicle || (g.spawn_vehicle.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
else if (ImGui::IsItemHovered())
|
||||
{
|
||||
g_model_preview_service->show_vehicle(vehicle.m_hash, g->spawn_vehicle.spawn_maxed);
|
||||
g_model_preview_service->show_vehicle(vehicle.m_hash, g.spawn_vehicle.spawn_maxed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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