2023-03-01 21:27:15 +00:00
|
|
|
#include "core/data/speed_units.hpp"
|
2022-05-09 08:59:38 -04:00
|
|
|
#include "fiber_pool.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "util/mobile.hpp"
|
2023-03-09 12:23:01 +00:00
|
|
|
#include "util/teleport.hpp"
|
2022-05-09 08:59:38 -04:00
|
|
|
#include "views/view.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()
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("MORS_FIX_ALL"_T, [] {
|
2022-07-12 22:42:07 +08:00
|
|
|
int amount_fixed = mobile::mors_mutual::fix_all();
|
2023-02-01 19:46:33 +01:00
|
|
|
g_notification_service->push("MOBILE"_T.data(),
|
2023-03-01 21:27:15 +00:00
|
|
|
std::vformat("VEHICLE_FIX_AMOUNT"_T.data(),
|
|
|
|
std::make_format_args(amount_fixed,
|
|
|
|
amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data())));
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("REPAIR"_T, [] {
|
2022-07-12 22:42:07 +08:00
|
|
|
vehicle::repair(self::veh);
|
|
|
|
});
|
|
|
|
|
2022-10-21 18:22:52 +03:00
|
|
|
ImGui::SameLine();
|
2022-12-22 21:23:32 +00:00
|
|
|
components::command_checkbox<"keepfixed">();
|
2022-10-21 18:22:52 +03:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Separator();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("TP_IN_PV"_T, [] {
|
2022-07-27 14:39:22 +02:00
|
|
|
Vehicle veh = mobile::mechanic::get_personal_vehicle();
|
2022-07-12 22:42:07 +08:00
|
|
|
teleport::into_vehicle(veh);
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("BRING_PV"_T, [] {
|
2022-07-27 14:39:22 +02:00
|
|
|
Vehicle veh = mobile::mechanic::get_personal_vehicle();
|
2022-07-12 22:42:07 +08:00
|
|
|
vehicle::bring(veh, self::pos, true);
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("BRING_CLOSEST_VEHICLE"_T, [] {
|
2022-07-12 22:42:07 +08:00
|
|
|
Vehicle veh = vehicle::get_closest_to_location(self::pos, 200);
|
|
|
|
vehicle::bring(veh, self::pos, true, -1);
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("TURN_ENGINE_ON"_T, [] {
|
2023-03-01 21:27:15 +00:00
|
|
|
vehicle::set_engine_state(self::veh, true, g.vehicle.change_engine_state_immediately, g.vehicle.disable_engine_auto_start);
|
2022-11-11 11:51:40 -06:00
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("TURN_ENGINE_OFF"_T, [] {
|
2023-03-01 21:27:15 +00:00
|
|
|
vehicle::set_engine_state(self::veh, false, g.vehicle.change_engine_state_immediately, g.vehicle.disable_engine_auto_start);
|
2022-11-11 11:51:40 -06:00
|
|
|
});
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("DISABLE_ENGINE_AUTO_START"_T.data(), &g.vehicle.disable_engine_auto_start);
|
2022-11-11 11:51:40 -06:00
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("CHANGE_STATE_IMMEDIATELY"_T.data(), &g.vehicle.change_engine_state_immediately);
|
2022-11-11 11:51:40 -06:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("GENERAL"_T);
|
2022-08-10 08:42:34 +08:00
|
|
|
{
|
|
|
|
ImGui::BeginGroup();
|
2022-12-22 21:23:32 +00:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("GOD_MODE"_T.data(), &g.vehicle.god_mode);
|
2022-12-22 21:23:32 +00:00
|
|
|
components::command_checkbox<"hornboost">();
|
|
|
|
components::command_checkbox<"vehjump">();
|
2023-01-08 15:27:23 -05:00
|
|
|
components::command_checkbox<"invisveh">();
|
|
|
|
if (g.vehicle.vehinvisibility)
|
|
|
|
{
|
|
|
|
components::command_checkbox<"localinvisveh">();
|
|
|
|
}
|
2023-02-28 20:42:23 +08:00
|
|
|
components::command_checkbox<"vehnocollision">();
|
|
|
|
components::command_checkbox<"vehallweapons">();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-12-22 21:23:32 +00:00
|
|
|
components::command_checkbox<"instantbrake">();
|
|
|
|
components::command_checkbox<"blockhoming">();
|
|
|
|
components::command_checkbox<"driveonwater">();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2022-12-22 21:23:32 +00:00
|
|
|
components::command_checkbox<"seatbelt">();
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("TURN_SIGNALS"_T.data(), &g.vehicle.turn_signals);
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.turn_signals)
|
2022-08-10 08:42:34 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("FULLY_AUTOMATIC_SIGNAL"_T.data(), &g.vehicle.auto_turn_signals);
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-12-22 21:23:32 +00:00
|
|
|
components::command_checkbox<"driveunder">();
|
2023-02-04 23:49:44 +01:00
|
|
|
components::command_checkbox<"keeponground">();
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
2022-05-22 20:00:23 -04:00
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::Separator();
|
|
|
|
|
2022-05-24 15:59:25 -04:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("PROOFS"_T);
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Button("CHECK_ALL"_T.data()))
|
2022-08-10 08:42:34 +08:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_bullet = true;
|
|
|
|
g.vehicle.proof_fire = true;
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_collision = true;
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_melee = true;
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_explosion = true;
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_steam = true;
|
|
|
|
g.vehicle.proof_water = true;
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-05-24 15:59:25 -04:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::SameLine();
|
2022-05-09 08:59:38 -04:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Button("UNCHECK_ALL"_T.data()))
|
2022-08-10 08:42:34 +08:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_bullet = false;
|
|
|
|
g.vehicle.proof_fire = false;
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_collision = false;
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_melee = false;
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_explosion = false;
|
2023-03-01 21:27:15 +00:00
|
|
|
g.vehicle.proof_steam = false;
|
|
|
|
g.vehicle.proof_water = false;
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-05-09 08:59:38 -04:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::BeginGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("BULLET"_T.data(), &g.vehicle.proof_bullet);
|
|
|
|
ImGui::Checkbox("FIRE"_T.data(), &g.vehicle.proof_fire);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("COLLISION"_T.data(), &g.vehicle.proof_collision);
|
|
|
|
ImGui::Checkbox("MELEE"_T.data(), &g.vehicle.proof_melee);
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("EXPLOSION"_T.data(), &g.vehicle.proof_explosion);
|
|
|
|
ImGui::Checkbox("STEAM"_T.data(), &g.vehicle.proof_steam);
|
2022-05-16 02:22:11 -04:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("WATER"_T.data(), &g.vehicle.proof_water);
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::EndGroup();
|
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("SPEED_UNIT"_T);
|
2022-08-10 08:42:34 +08:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::KMPH].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::KMPH);
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::SameLine();
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::MIPH].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::MIPH);
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::SameLine();
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::MPS].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::MPS);
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::Separator();
|
2022-05-04 19:16:40 +02:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("SPEEDO_METER"_T);
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("ENABLED"_T.data(), &g.vehicle.speedo_meter.enabled);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.speedo_meter.enabled)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Text("POS_X_Y"_T.data());
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
float pos[2] = {g.vehicle.speedo_meter.x, g.vehicle.speedo_meter.y};
|
2022-08-10 08:42:34 +08:00
|
|
|
|
|
|
|
if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f"))
|
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.speedo_meter.x = pos[0];
|
|
|
|
g.vehicle.speedo_meter.y = pos[1];
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
ImGui::SameLine();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("LEFT_SIDED"_T.data(), &g.vehicle.speedo_meter.left_side);
|
2022-08-10 08:42:34 +08:00
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask = 0;
|
|
|
|
if (g.vehicle.god_mode)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::GOD);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_bullet)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::BULLET);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_fire)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::FIRE);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_collision)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::COLLISION);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_melee)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::MELEE);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_explosion)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::EXPLOSION);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_steam)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::STEAM);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.vehicle.proof_water)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.proof_mask |= static_cast<int>(eEntityProofs::WATER);
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
2022-05-09 22:58:53 +02:00
|
|
|
}
|