refactor!: Replace premake5 with CMake. (#551)
Co-authored-by: tupoy-ya <tupoy-ya@users.noreply.github.com>
This commit is contained in:
234
src/views/vehicle/view_fun_vehicle.cpp
Normal file
234
src/views/vehicle/view_fun_vehicle.cpp
Normal file
@ -0,0 +1,234 @@
|
||||
#include "core/enums.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "script.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
#include "util/mobile.hpp"
|
||||
#include "core/data/speed_units.hpp"
|
||||
#include "services/gta_data/gta_data_service.hpp"
|
||||
#include "services/model_preview/model_preview_service.hpp"
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::fun_vehicle()
|
||||
{
|
||||
components::sub_title("Seat Changer");
|
||||
{
|
||||
static std::map<int, bool> seats;
|
||||
static bool ready = true;
|
||||
|
||||
if (self::veh == 0)
|
||||
{
|
||||
seats.clear();
|
||||
}
|
||||
|
||||
if (self::veh != 0 && ready == true)
|
||||
{
|
||||
ready = false;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
|
||||
std::map<int, bool> tmp_seats;
|
||||
|
||||
int num_of_seats = VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(self::veh);
|
||||
|
||||
for (int i = -1; i < num_of_seats; i++)
|
||||
{
|
||||
tmp_seats[i] = VEHICLE::IS_VEHICLE_SEAT_FREE(self::veh, i, true);
|
||||
}
|
||||
|
||||
seats = tmp_seats;
|
||||
ready = true;
|
||||
});
|
||||
}
|
||||
|
||||
if (seats.size() == 0)
|
||||
{
|
||||
ImGui::Text("Please enter a vehicle.");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto& it : seats)
|
||||
{
|
||||
int idx = it.first;
|
||||
|
||||
if (!it.second)
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
|
||||
std::string name = "Driver";
|
||||
|
||||
if (idx >= 0)
|
||||
{
|
||||
name = "Seat " + std::to_string(idx + 1);
|
||||
}
|
||||
|
||||
if ((idx + 1) % 4 != 0) {
|
||||
ImGui::SameLine();
|
||||
}
|
||||
|
||||
components::button(name, [idx] {
|
||||
PED::SET_PED_INTO_VEHICLE(self::ped, self::veh, idx);
|
||||
});
|
||||
if (!it.second)
|
||||
{
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Auto Drive");
|
||||
{
|
||||
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(),
|
||||
&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),
|
||||
"%.1f"
|
||||
)) {
|
||||
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]))
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (ImGui::Selectable(driving_style_names[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)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
if (components::button("To Objective")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::OBJECTITVE;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("To Waypoint")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::WAYPOINT;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("Wander")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::WANDER;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (components::button("Emergency Stop")) {
|
||||
g->vehicle.auto_drive_destination = AutoDriveDestination::EMERGENCY_STOP;
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Rainbow Paint");
|
||||
{
|
||||
ImGui::Checkbox("Primary", &g->vehicle.rainbow_paint.primary);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Secondary", &g->vehicle.rainbow_paint.secondary);
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Neon", &g->vehicle.rainbow_paint.neon);
|
||||
ImGui::SameLine();
|
||||
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]))
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
bool itemSelected = (int)g->vehicle.rainbow_paint.type == i;
|
||||
|
||||
if (ImGui::Selectable(rgb_types[i], itemSelected))
|
||||
{
|
||||
g->vehicle.rainbow_paint.type = (RainbowPaintType)i;
|
||||
}
|
||||
|
||||
if (itemSelected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
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::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)]))
|
||||
{
|
||||
for (int i = 0; i < 3; 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);
|
||||
}
|
||||
|
||||
if (itemSelected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Vehicle Fly");
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
|
||||
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::EndGroup();
|
||||
|
||||
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(),
|
||||
&fly_speed_user_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
952
src/views/vehicle/view_lsc.cpp
Normal file
952
src/views/vehicle/view_lsc.cpp
Normal file
@ -0,0 +1,952 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "script.hpp"
|
||||
#include "services/vehicle_helper/vehicle_helper.hpp"
|
||||
#include "core/data/lsc_types.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::lsc()
|
||||
{
|
||||
static Vehicle player_vehicle = 0;
|
||||
static bool ready = true;
|
||||
|
||||
static std::map<int, int32_t> owned_mods;
|
||||
static std::map<int, std::string> slot_display_names;
|
||||
static std::map<int, std::map<int, std::string>> mod_display_names;
|
||||
static std::map<std::string, std::vector<int>> front_wheel_map;
|
||||
static std::map<std::string, std::vector<int>> rear_wheel_map;
|
||||
|
||||
static int selected_slot = -1;
|
||||
static bool is_bennys = false;
|
||||
static int front_wheel_stock_mod = -1;
|
||||
static int rear_wheel_stock_mod = -1;
|
||||
|
||||
if (self::veh == 0 || player_vehicle != self::veh)
|
||||
{
|
||||
if (self::veh == 0 )
|
||||
{
|
||||
owned_mods.clear();
|
||||
slot_display_names.clear();
|
||||
mod_display_names.clear();
|
||||
front_wheel_map.clear();
|
||||
rear_wheel_map.clear();
|
||||
player_vehicle = 0;
|
||||
|
||||
selected_slot = -1;
|
||||
ImGui::Text("Please enter a vehicle.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (player_vehicle != self::veh && ready == true)
|
||||
{
|
||||
ready = false;
|
||||
player_vehicle = self::veh;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
if (!HUD::HAS_THIS_ADDITIONAL_TEXT_LOADED("MOD_MNU", 10))
|
||||
{
|
||||
HUD::CLEAR_ADDITIONAL_TEXT(10, TRUE);
|
||||
HUD::REQUEST_ADDITIONAL_TEXT("MOD_MNU", 10);
|
||||
script::get_current()->yield();
|
||||
}
|
||||
|
||||
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
|
||||
|
||||
Hash model = ENTITY::GET_ENTITY_MODEL(player_vehicle);
|
||||
|
||||
owned_mods = vehicle::get_owned_mods_from_vehicle(player_vehicle);
|
||||
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
|
||||
|
||||
std::map<int, std::string> tmp_slot_display_names;
|
||||
std::map<int, std::map<int, std::string>> tmp_mod_display_names;
|
||||
std::map<std::string, std::vector<int>> tmp_front_wheel_map;
|
||||
std::map<std::string, std::vector<int>> tmp_rear_wheel_map;
|
||||
|
||||
tmp_slot_display_names[MOD_PLATE_STYLE] = "Plate Style";
|
||||
tmp_slot_display_names[MOD_WINDOW_TINT] = "Window Tint";
|
||||
tmp_slot_display_names[MOD_WHEEL_TYPE] = "Wheel Type";
|
||||
|
||||
tmp_mod_display_names[MOD_PLATE_STYLE].insert(lsc_plate_styles.begin(), lsc_plate_styles.end());
|
||||
tmp_mod_display_names[MOD_WINDOW_TINT].insert(lsc_window_tint_types.begin(), lsc_window_tint_types.end());
|
||||
tmp_mod_display_names[MOD_WHEEL_TYPE].insert(lsc_wheel_styles.begin(), lsc_wheel_styles.end());
|
||||
|
||||
is_bennys = owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_ORIGINAL ||
|
||||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_BESPOKE ||
|
||||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_OPEN_WHEEL ||
|
||||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_STREET ||
|
||||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_TRACK;
|
||||
|
||||
for (int slot = MOD_SPOILERS; slot <= MOD_LIGHTBAR; slot++)
|
||||
{
|
||||
int count = VEHICLE::GET_NUM_VEHICLE_MODS(player_vehicle, slot);
|
||||
if (count > 0)
|
||||
{
|
||||
int owner_mod = owned_mods[slot];
|
||||
|
||||
std::string slot_name = vehicle_helper::get_mod_slot_name(model, player_vehicle, slot);
|
||||
if (slot_name.empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
tmp_slot_display_names[slot] = slot_name;
|
||||
|
||||
std::map<int, std::string> mod_names;
|
||||
|
||||
for (int mod = -1; mod < count; mod++)
|
||||
{
|
||||
if (vehicle_helper::check_mod_blacklist(model, slot, mod))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool is_repeated = false;
|
||||
|
||||
std::string mod_name = vehicle_helper::get_mod_name(model, player_vehicle, slot, mod, count);
|
||||
|
||||
if (mod_name.empty() || mod_name == "NULL")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slot == MOD_FRONTWHEEL)
|
||||
{
|
||||
if (is_bennys)
|
||||
{
|
||||
if (mod_name.rfind("Chrome ", 0) == 0)
|
||||
{
|
||||
std::string new_mod_name = mod_name.substr(7);
|
||||
|
||||
if (tmp_front_wheel_map[new_mod_name].size() > 0)
|
||||
{
|
||||
mod_name = new_mod_name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tmp_front_wheel_map[mod_name].push_back(mod);
|
||||
|
||||
if (mod == owner_mod)
|
||||
{
|
||||
front_wheel_stock_mod = tmp_front_wheel_map[mod_name][0];
|
||||
}
|
||||
|
||||
if (tmp_front_wheel_map[mod_name].size() > 1)
|
||||
{
|
||||
is_repeated = true;
|
||||
}
|
||||
}
|
||||
else if(slot == MOD_REARWHEEL)
|
||||
{
|
||||
if (is_bennys)
|
||||
{
|
||||
if (mod_name.rfind("Chrome ", 0) == 0)
|
||||
{
|
||||
std::string new_mod_name = mod_name.substr(7);
|
||||
|
||||
if (tmp_rear_wheel_map[new_mod_name].size() > 0)
|
||||
{
|
||||
mod_name = new_mod_name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tmp_rear_wheel_map[mod_name].push_back(mod);
|
||||
|
||||
if (mod == owner_mod)
|
||||
{
|
||||
rear_wheel_stock_mod = tmp_rear_wheel_map[mod_name][0];
|
||||
}
|
||||
|
||||
if (tmp_rear_wheel_map[mod_name].size() > 1)
|
||||
{
|
||||
is_repeated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_repeated)
|
||||
{
|
||||
mod_names[mod] = mod_name;
|
||||
}
|
||||
}
|
||||
|
||||
tmp_mod_display_names[slot] = mod_names;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_mod_display_names.count(MOD_HORNS) > 0)
|
||||
{
|
||||
tmp_mod_display_names[MOD_HORNS].insert(lsc_missing_horns.begin(), lsc_missing_horns.end());
|
||||
}
|
||||
|
||||
slot_display_names = tmp_slot_display_names;
|
||||
mod_display_names = tmp_mod_display_names;
|
||||
front_wheel_map = tmp_front_wheel_map;
|
||||
rear_wheel_map = tmp_rear_wheel_map;
|
||||
|
||||
ready = true;
|
||||
});
|
||||
}
|
||||
|
||||
components::button("Start LS Customs", [] {
|
||||
g->vehicle.ls_customs = true;
|
||||
});
|
||||
ImGui::SameLine();
|
||||
if (components::button("Max Vehicle"))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
vehicle::max_vehicle(self::veh);
|
||||
|
||||
// refresh mod names
|
||||
player_vehicle = 0;
|
||||
});
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
static char plate[9];
|
||||
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
components::input_text_with_hint("##plate", "Plate Number", plate, sizeof(plate), ImGuiInputTextFlags_None);
|
||||
ImGui::SameLine();
|
||||
if (components::button("Change Plate Number"))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
vehicle::set_plate(self::veh, plate);
|
||||
});
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Mod Options");
|
||||
|
||||
bool is_bulletproof_tires = !owned_mods[MOD_TIRE_CAN_BURST];
|
||||
if (ImGui::Checkbox("Bulletproof Tires", (bool*)&is_bulletproof_tires))
|
||||
{
|
||||
g_fiber_pool->queue_job([is_bulletproof_tires] {
|
||||
owned_mods[MOD_TIRE_CAN_BURST] = (int32_t)!is_bulletproof_tires;
|
||||
VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(player_vehicle, owned_mods[MOD_TIRE_CAN_BURST]);
|
||||
});
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Low Grip Tires", (bool*)&owned_mods[MOD_DRIFT_TIRE]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_DRIFT_TYRES(player_vehicle, owned_mods[MOD_DRIFT_TIRE]);
|
||||
});
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Turbo", (bool*)&owned_mods[MOD_TURBO]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TURBO, owned_mods[MOD_TURBO]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Tiresmoke", (bool*)&owned_mods[MOD_TYRE_SMOKE]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TYRE_SMOKE, owned_mods[MOD_TYRE_SMOKE]);
|
||||
});
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Slot");
|
||||
if (ImGui::ListBoxHeader("##slot", ImVec2(200, 200)))
|
||||
{
|
||||
for (const auto& [slot, name] : slot_display_names)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), slot == selected_slot))
|
||||
{
|
||||
selected_slot = slot;
|
||||
}
|
||||
}
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
if (selected_slot != -1)
|
||||
{
|
||||
auto wheel_stock_mod = &front_wheel_stock_mod;
|
||||
auto wheel_custom = &owned_mods[MOD_FRONTWHEEL_VAR];
|
||||
bool is_wheel_mod = false;
|
||||
|
||||
if (selected_slot == MOD_FRONTWHEEL)
|
||||
{
|
||||
is_wheel_mod = true;
|
||||
}
|
||||
else if (selected_slot == MOD_REARWHEEL)
|
||||
{
|
||||
wheel_stock_mod = &rear_wheel_stock_mod;
|
||||
wheel_custom = &owned_mods[MOD_REARWHEEL_VAR];
|
||||
is_wheel_mod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
is_wheel_mod = false;
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Mod");
|
||||
if (ImGui::ListBoxHeader("##mod", ImVec2(240, 200)))
|
||||
{
|
||||
for (const auto& it : mod_display_names[selected_slot])
|
||||
{
|
||||
const auto& mod = it.first;
|
||||
const auto& name = it.second;
|
||||
|
||||
bool item_selected = mod == owned_mods[selected_slot];
|
||||
|
||||
if (is_wheel_mod)
|
||||
{
|
||||
item_selected = mod == *wheel_stock_mod;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable(name.c_str(), item_selected))
|
||||
{
|
||||
g_fiber_pool->queue_job([&mod, is_wheel_mod, wheel_stock_mod, wheel_custom] {
|
||||
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(self::veh);
|
||||
|
||||
if (selected_slot >= 0)
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, false);
|
||||
owned_mods[selected_slot] = mod;
|
||||
|
||||
if (is_wheel_mod)
|
||||
{
|
||||
*wheel_stock_mod = mod;
|
||||
*wheel_custom = false;
|
||||
}
|
||||
}
|
||||
else if (selected_slot == MOD_WINDOW_TINT)
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_WINDOW_TINT(player_vehicle, mod);
|
||||
owned_mods[selected_slot] = mod;
|
||||
}
|
||||
else if (selected_slot == MOD_WHEEL_TYPE)
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_WHEEL_TYPE(player_vehicle, mod);
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, MOD_FRONTWHEEL, 0, false);
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, MOD_REARWHEEL, 0, false);
|
||||
player_vehicle = 0;
|
||||
}
|
||||
else if (selected_slot == MOD_PLATE_STYLE)
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_NUMBER_PLATE_TEXT_INDEX(player_vehicle, mod);
|
||||
owned_mods[selected_slot] = mod;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
if (
|
||||
is_wheel_mod && *wheel_stock_mod != -1
|
||||
) {
|
||||
auto wheel_map = front_wheel_map;
|
||||
|
||||
if (selected_slot == MOD_REARWHEEL)
|
||||
{
|
||||
wheel_map = rear_wheel_map;
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Style");
|
||||
if (ImGui::ListBoxHeader("##style", ImVec2(200, 200)))
|
||||
{
|
||||
std::string mod_name = mod_display_names[selected_slot][*wheel_stock_mod];
|
||||
auto wheel_mods = wheel_map[mod_name];
|
||||
|
||||
for (int i = 0; i < wheel_mods.size(); i++)
|
||||
{
|
||||
int& mod = wheel_mods[i];
|
||||
|
||||
int should_custom = false;
|
||||
|
||||
// bennys fix
|
||||
if (!is_bennys)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
if (ImGui::Selectable("Stock", mod == owned_mods[selected_slot] && *wheel_custom == false))
|
||||
{
|
||||
g_fiber_pool->queue_job([&mod] {
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, false);
|
||||
player_vehicle = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
should_custom = true;
|
||||
}
|
||||
|
||||
std::string label = "Style " + std::to_string(mod);
|
||||
if (ImGui::Selectable(label.c_str(), mod == owned_mods[selected_slot] && *wheel_custom == should_custom))
|
||||
{
|
||||
g_fiber_pool->queue_job([&mod, should_custom] {
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, should_custom);
|
||||
player_vehicle = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Neon Light Options");
|
||||
|
||||
if (ImGui::Checkbox("Headlight##headlight_en", (bool*)&owned_mods[MOD_XENON_LIGHTS]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Left", (bool*)&owned_mods[MOD_NEON_LEFT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Right", (bool*)&owned_mods[MOD_NEON_RIGHT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_RIGHT, owned_mods[MOD_NEON_RIGHT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Front", (bool*)&owned_mods[MOD_NEON_FRONT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Back", (bool*)&owned_mods[MOD_NEON_BACK_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
components::button("Check All##neon_check_all", [] {
|
||||
owned_mods[MOD_XENON_LIGHTS] = true;
|
||||
owned_mods[MOD_NEON_LEFT_ON] = true;
|
||||
owned_mods[MOD_NEON_RIGHT_ON] = true;
|
||||
owned_mods[MOD_NEON_FRONT_ON] = true;
|
||||
owned_mods[MOD_NEON_BACK_ON] = true;
|
||||
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_RIGHT, owned_mods[MOD_NEON_RIGHT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("Uncheck All##neon_uncheck_all", [] {
|
||||
owned_mods[MOD_XENON_LIGHTS] = false;
|
||||
owned_mods[MOD_NEON_LEFT_ON] = false;
|
||||
owned_mods[MOD_NEON_RIGHT_ON] = false;
|
||||
owned_mods[MOD_NEON_FRONT_ON] = false;
|
||||
owned_mods[MOD_NEON_BACK_ON] = false;
|
||||
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_RIGHT, owned_mods[MOD_NEON_RIGHT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Color Options");
|
||||
|
||||
static int color_to_change = 0;
|
||||
static int color_type = 8;
|
||||
|
||||
if (
|
||||
(color_to_change == 7 && !owned_mods[MOD_XENON_LIGHTS]) ||
|
||||
(color_to_change == 5 && !owned_mods[MOD_TYRE_SMOKE])
|
||||
) {
|
||||
color_to_change = 0;
|
||||
color_type = 8;
|
||||
}
|
||||
|
||||
if (ImGui::ListBoxHeader("##color_options", ImVec2(120, 254)))
|
||||
{
|
||||
if (ImGui::Selectable("Primary", color_to_change == 0, ImGuiSelectableFlags_SelectOnClick))
|
||||
{
|
||||
color_to_change = 0;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Secondary", color_to_change == 1))
|
||||
{
|
||||
color_to_change = 1;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Pearlescent", color_to_change == 2))
|
||||
{
|
||||
color_to_change = 2;
|
||||
color_type = 4;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Interior", color_to_change == 3))
|
||||
{
|
||||
color_to_change = 3;
|
||||
color_type = 6;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Dashboard", color_to_change == 4))
|
||||
{
|
||||
color_to_change = 4;
|
||||
color_type = 7;
|
||||
}
|
||||
|
||||
if (!owned_mods[MOD_TYRE_SMOKE])
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
if (ImGui::Selectable("Tire Smoke", color_to_change == 5))
|
||||
{
|
||||
color_to_change = 5;
|
||||
color_type = 8;
|
||||
}
|
||||
if (!owned_mods[MOD_TYRE_SMOKE])
|
||||
{
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Wheel Color", color_to_change == 6))
|
||||
{
|
||||
color_to_change = 6;
|
||||
color_type = 5;
|
||||
}
|
||||
|
||||
if (!owned_mods[MOD_XENON_LIGHTS])
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
if (ImGui::Selectable("Headlight##headlight_col", color_to_change == 7))
|
||||
{
|
||||
color_to_change = 7;
|
||||
color_type = 9;
|
||||
}
|
||||
if (!owned_mods[MOD_XENON_LIGHTS])
|
||||
{
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Neon", color_to_change == 8))
|
||||
{
|
||||
color_to_change = 8;
|
||||
color_type = 8;
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
|
||||
|
||||
if (color_to_change == 0 || color_to_change == 1)
|
||||
{
|
||||
if (color_type > 3)
|
||||
{
|
||||
color_type = 8;
|
||||
}
|
||||
|
||||
// primary and secondary color
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ListBoxHeader("##colors", ImVec2(140, 254)))
|
||||
{
|
||||
if (ImGui::Selectable("Custom", color_type == 8, ImGuiSelectableFlags_SelectOnClick))
|
||||
{
|
||||
color_type = 8;
|
||||
}
|
||||
if (ImGui::Selectable("Remove Custom", false))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
VEHICLE::CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle);
|
||||
}
|
||||
else
|
||||
{
|
||||
VEHICLE::CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle);
|
||||
}
|
||||
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
||||
});
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Chrome", color_type == 0))
|
||||
{
|
||||
color_type = 0;
|
||||
}
|
||||
if (ImGui::Selectable("Classic", color_type == 1))
|
||||
{
|
||||
color_type = 1;
|
||||
}
|
||||
if (ImGui::Selectable("Matte", color_type == 2))
|
||||
{
|
||||
color_type = 2;
|
||||
}
|
||||
if (ImGui::Selectable("Metals", color_type == 3))
|
||||
{
|
||||
color_type = 3;
|
||||
}
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
else if (color_to_change == 7)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
}
|
||||
|
||||
|
||||
if (color_type == 8)
|
||||
{
|
||||
// custom color
|
||||
|
||||
static float color[3] = { 1, 1, 1 };
|
||||
auto color_r = &owned_mods[MOD_PRIMARY_COL_R];
|
||||
auto color_g = &owned_mods[MOD_PRIMARY_COL_G];
|
||||
auto color_b = &owned_mods[MOD_PRIMARY_COL_B];
|
||||
|
||||
if (color_to_change == 1)
|
||||
{
|
||||
color_r = &owned_mods[MOD_SECONDARY_COL_R];
|
||||
color_g = &owned_mods[MOD_SECONDARY_COL_G];
|
||||
color_b = &owned_mods[MOD_SECONDARY_COL_B];
|
||||
}
|
||||
else if (color_to_change == 2)
|
||||
{
|
||||
color_r = &owned_mods[MOD_TIRESMOKE_COL_R];
|
||||
color_g = &owned_mods[MOD_TIRESMOKE_COL_G];
|
||||
color_b = &owned_mods[MOD_TIRESMOKE_COL_B];
|
||||
}
|
||||
else if (color_to_change == 3)
|
||||
{
|
||||
color_r = &owned_mods[MOD_NEON_COL_R];
|
||||
color_g = &owned_mods[MOD_NEON_COL_G];
|
||||
color_b = &owned_mods[MOD_NEON_COL_B];
|
||||
}
|
||||
|
||||
color[0] = (float)*color_r / 255;
|
||||
color[1] = (float)*color_g / 255;
|
||||
color[2] = (float)*color_b / 255;
|
||||
|
||||
if (color_to_change == 5)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ListBoxHeader("##tire_smoke_rgb", ImVec2(140, 254)))
|
||||
{
|
||||
for (const auto& it : lsc_tire_smoke_rgb)
|
||||
{
|
||||
auto& name = it.first;
|
||||
auto& rgb = it.second;
|
||||
|
||||
if (ImGui::Selectable(name.c_str(), false))
|
||||
{
|
||||
g_fiber_pool->queue_job([&rgb] {
|
||||
VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, rgb[0], rgb[1], rgb[2]);
|
||||
});
|
||||
*color_r = rgb[0];
|
||||
*color_g = rgb[1];
|
||||
*color_b = rgb[2];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
else if (color_to_change == 8)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ListBoxHeader("##neon_rgb", ImVec2(140, 254)))
|
||||
{
|
||||
for (const auto& it : lsc_neon_rgb)
|
||||
{
|
||||
auto& name = it.first;
|
||||
auto& rgb = it.second;
|
||||
|
||||
if (ImGui::Selectable(name.c_str(), false))
|
||||
{
|
||||
g_fiber_pool->queue_job([&rgb] {
|
||||
VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, rgb[0], rgb[1], rgb[2]);
|
||||
});
|
||||
*color_r = rgb[0];
|
||||
*color_g = rgb[1];
|
||||
*color_b = rgb[2];
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(214);
|
||||
if (ImGui::ColorPicker3("Custom VehColor", color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex))
|
||||
{
|
||||
*color_r = (int)(color[0] * 255);
|
||||
*color_g = (int)(color[1] * 255);
|
||||
*color_b = (int)(color[2] * 255);
|
||||
|
||||
g_fiber_pool->queue_job([color_r, color_g, color_b] {
|
||||
switch (color_to_change)
|
||||
{
|
||||
case 0:
|
||||
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
||||
break;
|
||||
case 1:
|
||||
VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
||||
break;
|
||||
case 5:
|
||||
VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, *color_r, *color_g, *color_b);
|
||||
break;
|
||||
case 8:
|
||||
VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// standard color
|
||||
|
||||
int selected_color = 0;
|
||||
switch (color_type)
|
||||
{
|
||||
case 4:
|
||||
selected_color = owned_mods[MOD_PEARLESCENT_COL];
|
||||
break;
|
||||
case 5:
|
||||
selected_color = owned_mods[MOD_WHEEL_COL];
|
||||
break;
|
||||
case 6:
|
||||
selected_color = owned_mods[MOD_INTERIOR_COL];
|
||||
break;
|
||||
case 7:
|
||||
selected_color = owned_mods[MOD_DASHBOARD_COL];
|
||||
break;
|
||||
case 9:
|
||||
selected_color = owned_mods[MOD_XENON_COL];
|
||||
break;
|
||||
default:
|
||||
selected_color = (color_to_change == 0) ? owned_mods[MOD_PRIMARY_COL] : owned_mods[MOD_SECONDARY_COL];
|
||||
}
|
||||
|
||||
if (color_type != 9)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
}
|
||||
|
||||
if (ImGui::ListBoxHeader("##color", ImVec2(180, 254)))
|
||||
{
|
||||
switch (color_type)
|
||||
{
|
||||
case 0: //Chrome
|
||||
{
|
||||
if (ImGui::Selectable("Chrome", selected_color == COLOR_CHROME))
|
||||
{
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
owned_mods[MOD_PRIMARY_COL] = COLOR_CHROME;
|
||||
}
|
||||
else
|
||||
{
|
||||
owned_mods[MOD_SECONDARY_COL] = COLOR_CHROME;
|
||||
}
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: //Classic
|
||||
{
|
||||
for (const auto& [color, name] : lsc_classic_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
owned_mods[MOD_PRIMARY_COL] = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
owned_mods[MOD_SECONDARY_COL] = color;
|
||||
}
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: //Matte
|
||||
{
|
||||
for (const auto& [color, name] : lsc_matte_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
owned_mods[MOD_PRIMARY_COL] = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
owned_mods[MOD_SECONDARY_COL] = color;
|
||||
}
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: //Metals
|
||||
{
|
||||
for (const auto& [color, name] : lsc_metal_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
owned_mods[MOD_PRIMARY_COL] = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
owned_mods[MOD_SECONDARY_COL] = color;
|
||||
}
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: //Pearlescent
|
||||
{
|
||||
for (const auto& [color, name] : lsc_classic_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
owned_mods[MOD_PEARLESCENT_COL] = color;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, owned_mods[MOD_PEARLESCENT_COL], owned_mods[MOD_WHEEL_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5: //Wheel Color
|
||||
{
|
||||
for (const auto& [color, name] : lsc_classic_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
owned_mods[MOD_WHEEL_COL] = color;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, owned_mods[MOD_PEARLESCENT_COL], owned_mods[MOD_WHEEL_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 6: //Interior Color
|
||||
{
|
||||
for (const auto& [color, name] : lsc_classic_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
owned_mods[MOD_INTERIOR_COL] = color;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_5(player_vehicle, owned_mods[MOD_INTERIOR_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 7: //Dashboard Color
|
||||
{
|
||||
for (const auto& [color, name] : lsc_classic_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
owned_mods[MOD_DASHBOARD_COL] = color;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_6(player_vehicle, owned_mods[MOD_DASHBOARD_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 9: //Headlight Color
|
||||
{
|
||||
for (const auto& [color, name] : lsc_headlight_colors)
|
||||
{
|
||||
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
||||
{
|
||||
selected_color = color;
|
||||
owned_mods[MOD_XENON_COL] = color;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_XENON_LIGHT_COLOR_INDEX(player_vehicle, owned_mods[MOD_XENON_COL]);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
86
src/views/vehicle/view_persist_car.cpp
Normal file
86
src/views/vehicle/view_persist_car.cpp
Normal file
@ -0,0 +1,86 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "script.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "util/mobile.hpp"
|
||||
#include "core/data/speed_units.hpp"
|
||||
#include "services/vehicle/persist_car_service.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
static void save_vehicle(char* vehicle_file_name_input)
|
||||
{
|
||||
if (ENTITY::DOES_ENTITY_EXIST(self::veh))
|
||||
{
|
||||
const auto vehicle_file_name = std::string(vehicle_file_name_input).append(".json");
|
||||
persist_car_service::save_vehicle(self::veh, vehicle_file_name);
|
||||
ZeroMemory(vehicle_file_name_input, sizeof(vehicle_file_name_input));
|
||||
}
|
||||
}
|
||||
|
||||
static void load_vehicle(std::string& selected_vehicle_file)
|
||||
{
|
||||
if (!selected_vehicle_file.empty())
|
||||
{
|
||||
const auto vehicle = persist_car_service::load_vehicle(selected_vehicle_file);
|
||||
if (!vehicle)
|
||||
{
|
||||
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)
|
||||
teleport::into_vehicle(vehicle);
|
||||
|
||||
selected_vehicle_file.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_warning("Persist Car", "Select a file first");
|
||||
}
|
||||
}
|
||||
|
||||
void view::persist_car()
|
||||
{
|
||||
static std::string selected_vehicle_file;
|
||||
|
||||
const auto vehicle_files = persist_car_service::list_files();
|
||||
|
||||
ImGui::PushItemWidth(250);
|
||||
ImGui::Text("Saved Vehicles");
|
||||
|
||||
if (ImGui::ListBoxHeader("##empty", ImVec2(200, 200)))
|
||||
{
|
||||
for (const auto& pair : vehicle_files)
|
||||
{
|
||||
if (ImGui::Selectable(pair.c_str(), selected_vehicle_file == pair))
|
||||
selected_vehicle_file = pair;
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::BeginGroup();
|
||||
static char vehicle_file_name_input[50]{};
|
||||
|
||||
ImGui::PushItemWidth(250);
|
||||
components::input_text_with_hint(
|
||||
"Vehicle File Name",
|
||||
"Ex: My Cool Car",
|
||||
vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("Save Vehicle", []
|
||||
{
|
||||
save_vehicle(vehicle_file_name_input);
|
||||
});
|
||||
|
||||
components::button("Load Vehicle", []
|
||||
{
|
||||
load_vehicle(selected_vehicle_file);
|
||||
});
|
||||
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
}
|
184
src/views/vehicle/view_pv.cpp
Normal file
184
src/views/vehicle/view_pv.cpp
Normal file
@ -0,0 +1,184 @@
|
||||
#include "views/view.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "services/mobile/mobile_service.hpp"
|
||||
#include "services/gta_data/gta_data_service.hpp"
|
||||
#include "services/model_preview/model_preview_service.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
|
||||
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 (!g->clone_pv.preview_vehicle)
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
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)
|
||||
{
|
||||
num_of_rows = 5;
|
||||
|
||||
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)
|
||||
{
|
||||
num_of_rows = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
|
||||
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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int selected_class = -1;
|
||||
const auto& class_arr = g_gta_data_service->vehicle_classes();
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
if (ImGui::BeginCombo("Vehicle Class", selected_class == -1 ? "ALL" : class_arr[selected_class].c_str()))
|
||||
{
|
||||
if (ImGui::Selectable("ALL", selected_class == -1))
|
||||
{
|
||||
selected_class = -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < class_arr.size(); i++)
|
||||
{
|
||||
if (ImGui::Selectable(class_arr[i].c_str(), selected_class == i))
|
||||
{
|
||||
selected_class = i;
|
||||
}
|
||||
|
||||
if (selected_class == i)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
|
||||
static char search[64];
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
components::input_text_with_hint("Model Name", "Search", search, sizeof(search), ImGuiInputTextFlags_None);
|
||||
|
||||
g_mobile_service->refresh_personal_vehicles();
|
||||
if (ImGui::ListBoxHeader("###personal_veh_list", { 300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * num_of_rows) }))
|
||||
{
|
||||
if (g_mobile_service->personal_vehicles().empty())
|
||||
{
|
||||
ImGui::Text("No personal vehicles found, \nare you online?");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string lower_search = search;
|
||||
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
|
||||
|
||||
for (const auto& it : g_mobile_service->personal_vehicles())
|
||||
{
|
||||
const auto& label = it.first;
|
||||
const auto& personal_veh = it.second;
|
||||
const auto& item = g_gta_data_service->vehicle_by_hash(personal_veh->get_hash());
|
||||
|
||||
std::string vehicle_class = item.m_vehicle_class;
|
||||
std::string display_name = label;
|
||||
std::string display_manufacturer = item.m_display_manufacturer;
|
||||
std::transform(display_name.begin(), display_name.end(), display_name.begin(), ::tolower);
|
||||
std::transform(display_manufacturer.begin(), display_manufacturer.end(), display_manufacturer.begin(), ::tolower);
|
||||
|
||||
if ((
|
||||
selected_class == -1 || class_arr[selected_class] == vehicle_class
|
||||
) && (
|
||||
display_name.find(lower_search) != std::string::npos ||
|
||||
display_manufacturer.find(lower_search) != std::string::npos
|
||||
)) {
|
||||
|
||||
ImGui::PushID('v' << 24 & personal_veh->get_id());
|
||||
components::selectable(label, false, [&personal_veh] {
|
||||
if (g->clone_pv.spawn_clone)
|
||||
{
|
||||
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)
|
||||
{
|
||||
spawn_plate_buf = personal_veh->get_plate();
|
||||
}
|
||||
|
||||
auto veh = vehicle::clone_from_owned_mods(owned_mods, spawn_location, spawn_heading);
|
||||
|
||||
if (veh == 0)
|
||||
{
|
||||
g_notification_service->push_error("Vehicle", "Unable to spawn vehicle");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->clone_pv.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, spawn_plate_buf);
|
||||
|
||||
if (g->clone_pv.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(search, "");
|
||||
personal_veh->summon();
|
||||
}
|
||||
|
||||
g_model_preview_service->stop_preview();
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
if (!g->clone_pv.preview_vehicle || (g->clone_pv.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
else if (ImGui::IsItemHovered())
|
||||
{
|
||||
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
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
}
|
204
src/views/vehicle/view_spawn_vehicle.cpp
Normal file
204
src/views/vehicle/view_spawn_vehicle.cpp
Normal file
@ -0,0 +1,204 @@
|
||||
#include "views/view.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "services/gta_data/gta_data_service.hpp"
|
||||
#include "services/model_preview/model_preview_service.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::spawn_vehicle()
|
||||
{
|
||||
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
|
||||
|
||||
if (ImGui::Checkbox("Preview", &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::SameLine();
|
||||
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);
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
|
||||
static int selected_class = -1;
|
||||
const auto& class_arr = g_gta_data_service->vehicle_classes();
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
if (ImGui::BeginCombo("Vehicle Class", selected_class == -1 ? "ALL" : class_arr[selected_class].c_str()))
|
||||
{
|
||||
if (ImGui::Selectable("ALL", selected_class == -1))
|
||||
{
|
||||
selected_class = -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < class_arr.size(); i++)
|
||||
{
|
||||
if (ImGui::Selectable(class_arr[i].c_str(), selected_class == i))
|
||||
{
|
||||
selected_class = i;
|
||||
}
|
||||
|
||||
if (selected_class == i)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
|
||||
static char search[64];
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
components::input_text_with_hint("Model Name", "Search", search, sizeof(search), ImGuiInputTextFlags_None);
|
||||
|
||||
|
||||
if (ImGui::ListBoxHeader("###vehicles", { 300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * 4) }))
|
||||
{
|
||||
if (self::veh)
|
||||
{
|
||||
static auto veh_hash = 0;
|
||||
|
||||
g_fiber_pool->queue_job([] {
|
||||
veh_hash = ENTITY::GET_ENTITY_MODEL(self::veh);
|
||||
});
|
||||
|
||||
if (veh_hash)
|
||||
{
|
||||
const auto& item = g_gta_data_service->vehicle_by_hash(veh_hash);
|
||||
|
||||
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);
|
||||
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
|
||||
|
||||
auto owned_mods = vehicle::get_owned_mods_from_vehicle(self::veh);
|
||||
|
||||
auto veh = vehicle::clone_from_owned_mods(owned_mods, spawn_location, spawn_heading);
|
||||
|
||||
if (veh == 0)
|
||||
{
|
||||
g_notification_service->push_error("Vehicle", "Unable to spawn vehicle");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->spawn_vehicle.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, plate_buf);
|
||||
|
||||
if (g->spawn_vehicle.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_model_preview_service->stop_preview();
|
||||
});
|
||||
|
||||
if (!g->spawn_vehicle.preview_vehicle || (g->spawn_vehicle.preview_vehicle && !ImGui::IsAnyItemHovered()))
|
||||
{
|
||||
g_model_preview_service->stop_preview();
|
||||
}
|
||||
else if (ImGui::IsItemHovered())
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
g_model_preview_service->show_vehicle(
|
||||
vehicle::get_owned_mods_from_vehicle(self::veh),
|
||||
g->spawn_vehicle.spawn_maxed
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto& item_arr = g_gta_data_service->vehicles();
|
||||
if (item_arr.size() > 0)
|
||||
{
|
||||
std::string lower_search = search;
|
||||
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
|
||||
|
||||
for (auto& item : item_arr)
|
||||
{
|
||||
const auto& vehicle = item.second;
|
||||
|
||||
std::string display_name = vehicle.m_display_name;
|
||||
std::string display_manufacturer = vehicle.m_display_manufacturer;
|
||||
std::string clazz = vehicle.m_vehicle_class;
|
||||
|
||||
std::transform(display_name.begin(), display_name.end(), display_name.begin(), ::tolower);
|
||||
std::transform(display_manufacturer.begin(), display_manufacturer.end(), display_manufacturer.begin(), ::tolower);
|
||||
|
||||
if ((
|
||||
selected_class == -1 || class_arr[selected_class] == clazz
|
||||
) && (
|
||||
display_name.find(lower_search) != std::string::npos ||
|
||||
display_manufacturer.find(lower_search) != std::string::npos
|
||||
)) {
|
||||
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_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
|
||||
|
||||
const auto veh = vehicle::spawn(vehicle.m_hash, spawn_location, spawn_heading);
|
||||
|
||||
if (veh == 0)
|
||||
{
|
||||
g_notification_service->push_error("Vehicle", "Unable to spawn vehicle");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g->spawn_vehicle.spawn_maxed)
|
||||
{
|
||||
vehicle::max_vehicle(veh);
|
||||
}
|
||||
|
||||
vehicle::set_plate(veh, plate_buf);
|
||||
|
||||
if (g->spawn_vehicle.spawn_inside)
|
||||
{
|
||||
vehicle::teleport_into_vehicle(veh);
|
||||
}
|
||||
}
|
||||
|
||||
g_model_preview_service->stop_preview();
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text("No vehicles in registry.");
|
||||
}
|
||||
ImGui::ListBoxFooter();
|
||||
}
|
||||
}
|
||||
}
|
211
src/views/vehicle/view_vehicle.cpp
Normal file
211
src/views/vehicle/view_vehicle.cpp
Normal file
@ -0,0 +1,211 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "util/mobile.hpp"
|
||||
#include "core/data/speed_units.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::vehicle()
|
||||
{
|
||||
components::button("MMI Fix All PV", [] {
|
||||
int amount_fixed = mobile::mors_mutual::fix_all();
|
||||
g_notification_service->push("Mobile",
|
||||
std::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have")
|
||||
);
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("Repair", [] {
|
||||
vehicle::repair(self::veh);
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Keep Vehicle Repaired", &g->vehicle.keep_vehicle_repaired);
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
components::button("Teleport in PV", [] {
|
||||
Vehicle veh = mobile::mechanic::get_personal_vehicle();
|
||||
teleport::into_vehicle(veh);
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("Bring PV", [] {
|
||||
Vehicle veh = mobile::mechanic::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::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::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::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("Fully Automatic Signal", &g->vehicle.auto_turn_signals);
|
||||
}
|
||||
ImGui::Checkbox("No Water Collision", &g->vehicle.no_water_collision);
|
||||
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Proofs");
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
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::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
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::EndGroup();
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Speed Unit");
|
||||
{
|
||||
ImGui::RadioButton(
|
||||
speed_unit_strings[(int)SpeedUnit::KMPH].c_str(),
|
||||
(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)SpeedUnit::MIPH
|
||||
);
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton(
|
||||
speed_unit_strings[(int)SpeedUnit::MPS].c_str(),
|
||||
(int*)&g->vehicle.speed_unit,
|
||||
(int)SpeedUnit::MPS
|
||||
);
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("Speedo Meter");
|
||||
{
|
||||
ImGui::Checkbox("Enabled", &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 };
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user