TmpMenu/BigBaseV2/src/gui/window/main/tab_vehicle.cpp

73 lines
1.7 KiB
C++
Raw Normal View History

2021-05-19 18:11:19 +02:00
#include "core/data/speedo_meters.hpp"
#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"
2021-05-19 18:11:19 +02:00
namespace big
{
static char model[12];
void tab_main::tab_vehicle()
{
if (ImGui::BeginTabItem("Vehicle"))
{
if (ImGui::Button("Bring Personal Vehicle"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
Vector3 location;
if (!blip::get_blip_location(location, 225, 0)) return notify::above_map("No personal vehicle found, was it destroyed?");
Vehicle veh = vehicle::get_closest_to_location(location, 5.f);
if (veh == 0) return notify::above_map("Invalid vehicle handle...");
location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
vehicle::bring(veh, location);
}QUEUE_JOB_END_CLAUSE
}
2021-07-23 11:59:53 +02:00
ImGui::SameLine();
if (ImGui::Button("Repair"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
vehicle::repair(veh);
}QUEUE_JOB_END_CLAUSE
}
2021-05-19 18:11:19 +02:00
if (ImGui::TreeNode("Speedo Meter"))
{
SpeedoMeter selected = g.vehicle.speedo_meter;
2021-07-23 11:59:53 +02:00
if (ImGui::BeginCombo("###speedo_type", speedo_meters[(int)selected].name))
2021-05-19 18:11:19 +02:00
{
2021-07-23 11:59:53 +02:00
for (const speedo_meter &speedo : speedo_meters)
2021-05-19 18:11:19 +02:00
{
if (ImGui::Selectable(speedo.name, speedo.id == selected))
{
g.vehicle.speedo_meter = speedo.id;
}
if (speedo.id == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::TreePop();
}
2021-05-20 23:18:44 +02:00
ImGui::Checkbox("Horn Boost", &g.vehicle.horn_boost);
2021-05-19 18:11:19 +02:00
ImGui::EndTabItem();
}
}
}