2022-05-04 19:16:40 +02:00
|
|
|
#include "core/data/speedo_meters.hpp"
|
2022-05-09 08:59:38 -04:00
|
|
|
#include "fiber_pool.hpp"
|
2022-05-04 19:16:40 +02:00
|
|
|
#include "gui/handling/handling_tabs.hpp"
|
|
|
|
#include "script.hpp"
|
|
|
|
#include "util/vehicle.hpp"
|
2022-05-09 08:59:38 -04:00
|
|
|
#include "views/view.hpp"
|
2022-07-12 22:42:07 +08:00
|
|
|
#include "util/mobile.hpp"
|
2022-05-09 22:58:53 +02:00
|
|
|
|
2022-05-04 19:16:40 +02:00
|
|
|
namespace big
|
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
void view::vehicle()
|
|
|
|
{
|
|
|
|
components::button("MMI Fix All PV", [] {
|
|
|
|
int amount_fixed = mobile::mors_mutual::fix_all();
|
|
|
|
g_notification_service->push("Mobile",
|
|
|
|
fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have")
|
|
|
|
);
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::button("Repair", [] {
|
|
|
|
vehicle::repair(self::veh);
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
components::button("Teleport to PV", [] {
|
|
|
|
Vehicle veh = globals::get_personal_vehicle();
|
|
|
|
teleport::into_vehicle(veh);
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::button("Bring PV", [] {
|
|
|
|
Vehicle veh = globals::get_personal_vehicle();
|
|
|
|
vehicle::bring(veh, self::pos, true);
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::button("Bring Closest Vehicle", [] {
|
|
|
|
Vehicle veh = vehicle::get_closest_to_location(self::pos, 200);
|
|
|
|
vehicle::bring(veh, self::pos, true, -1);
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
components::small_text("General");
|
|
|
|
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::BeginGroup();
|
|
|
|
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
|
|
|
|
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);
|
2022-06-27 15:42:53 +02:00
|
|
|
ImGui::Checkbox("Vehicle Jump", &g->vehicle.vehicle_jump);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
2022-05-09 08:59:38 -04:00
|
|
|
ImGui::Checkbox("Instant Brake", &g->vehicle.instant_brake);
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water);
|
|
|
|
|
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
2022-05-16 15:33:43 -04:00
|
|
|
ImGui::Checkbox("Seatbelt", &g->vehicle.seatbelt);
|
2022-05-22 20:00:23 -04:00
|
|
|
ImGui::Checkbox("Turn Signals", &g->vehicle.turn_signals);
|
|
|
|
if (g->vehicle.turn_signals)
|
|
|
|
{
|
|
|
|
ImGui::Checkbox("Fully Automatic Signal", &g->vehicle.auto_turn_signals);
|
|
|
|
}
|
|
|
|
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::EndGroup();
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
components::small_text("Proofs");
|
2022-05-24 15:59:25 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
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;
|
|
|
|
}
|
2022-05-24 15:59:25 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::SameLine();
|
2022-05-24 15:59:25 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Button("Uncheck all"))
|
2022-05-09 08:59:38 -04:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
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;
|
2022-05-09 08:59:38 -04:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::BeginGroup();
|
2022-05-09 08:59:38 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Checkbox("Bullet", &g->vehicle.proof_bullet);
|
|
|
|
ImGui::Checkbox("Fire", &g->vehicle.proof_fire);
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::EndGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
ImGui::SameLine();
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
|
|
|
ImGui::Checkbox("Collision", &g->vehicle.proof_collision);
|
|
|
|
ImGui::Checkbox("Melee", &g->vehicle.proof_melee);
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::EndGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
ImGui::SameLine();
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::BeginGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Checkbox("Explosion", &g->vehicle.proof_explosion);
|
|
|
|
ImGui::Checkbox("Steam", &g->vehicle.proof_steam);
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Checkbox("Water", &g->vehicle.proof_water);
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::EndGroup();
|
2022-05-04 19:16:40 +02:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
components::small_text("Speedo Meter");
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
SpeedoMeter* speed_meter_type_ptr = &g->vehicle.speedo_meter.type;
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::BeginCombo("Format", speedo_meters[(int)*speed_meter_type_ptr].name))
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
for (const auto& speedo : speedo_meters)
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Selectable(speedo.name, speedo.id == *speed_meter_type_ptr))
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
*speed_meter_type_ptr = speedo.id;
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (speedo.id == *speed_meter_type_ptr)
|
|
|
|
{
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::SetItemDefaultFocus();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::EndCombo();
|
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (*speed_meter_type_ptr != SpeedoMeter::DISABLED)
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Text("Position (X, 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];
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side);
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
g->vehicle.proof_mask = 0;
|
|
|
|
if (g->vehicle.god_mode)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::GOD);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_bullet)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::BULLET);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_fire)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::FIRE);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_collision)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::COLLISION);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_melee)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::MELEE);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_explosion)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::EXPLOSION);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_steam)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::STEAM);
|
|
|
|
}
|
|
|
|
if (g->vehicle.proof_water)
|
|
|
|
{
|
|
|
|
g->vehicle.proof_mask |= static_cast<int>(eEntityProofs::WATER);
|
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
2022-05-09 22:58:53 +02:00
|
|
|
}
|