2022-06-26 00:14:00 +02:00
|
|
|
#include "fiber_pool.hpp"
|
|
|
|
#include "natives.hpp"
|
2022-06-30 00:11:54 +02:00
|
|
|
#include "script.hpp"
|
|
|
|
#include "services/vehicle_helper/vehicle_helper.hpp"
|
2022-07-14 22:16:30 +08:00
|
|
|
#include "core/data/lsc_types.hpp"
|
2022-06-26 00:14:00 +02:00
|
|
|
#include "views/view.hpp"
|
2022-07-12 22:42:07 +08:00
|
|
|
#include "util/vehicle.hpp"
|
|
|
|
#include <imgui_internal.h>
|
2022-06-26 00:14:00 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void view::lsc()
|
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
static Vehicle player_vehicle = 0;
|
2022-07-14 22:16:30 +08:00
|
|
|
static bool ready = true;
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
static std::map<int, int32_t> owned_mods;
|
2022-07-12 22:42:07 +08:00
|
|
|
static std::map<int, std::string> slot_display_names;
|
2022-07-14 22:16:30 +08:00
|
|
|
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;
|
|
|
|
|
2022-06-26 00:14:00 +02:00
|
|
|
static int selected_slot = -1;
|
2022-07-14 22:16:30 +08:00
|
|
|
static bool is_bennys = false;
|
|
|
|
static int front_wheel_stock_mod = -1;
|
|
|
|
static int rear_wheel_stock_mod = -1;
|
2022-06-26 00:14:00 +02:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (self::veh == 0 || player_vehicle != self::veh)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-28 01:42:15 +08:00
|
|
|
if (self::veh == 0 )
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
owned_mods.clear();
|
|
|
|
slot_display_names.clear();
|
|
|
|
mod_display_names.clear();
|
2022-07-14 22:16:30 +08:00
|
|
|
front_wheel_map.clear();
|
|
|
|
rear_wheel_map.clear();
|
|
|
|
player_vehicle = 0;
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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([] {
|
2022-07-12 22:42:07 +08:00
|
|
|
if (!HUD::HAS_THIS_ADDITIONAL_TEXT_LOADED("MOD_MNU", 10))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
HUD::CLEAR_ADDITIONAL_TEXT(10, TRUE);
|
|
|
|
HUD::REQUEST_ADDITIONAL_TEXT("MOD_MNU", 10);
|
|
|
|
script::get_current()->yield();
|
|
|
|
}
|
2022-07-15 20:56:55 +08:00
|
|
|
|
|
|
|
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
Hash model = ENTITY::GET_ENTITY_MODEL(player_vehicle);
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods = vehicle::get_owned_mods_from_vehicle(player_vehicle);
|
|
|
|
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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());
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
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;
|
2022-06-26 00:14:00 +02:00
|
|
|
|
2022-07-28 01:42:15 +08:00
|
|
|
for (int slot = MOD_SPOILERS; slot <= MOD_LIGHTBAR; slot++)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
int count = VEHICLE::GET_NUM_VEHICLE_MODS(player_vehicle, slot);
|
|
|
|
if (count > 0)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
int owner_mod = owned_mods[slot];
|
2022-06-26 00:14:00 +02:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
std::string slot_name = vehicle_helper::get_mod_slot_name(model, player_vehicle, slot);
|
2022-07-12 22:42:07 +08:00
|
|
|
if (slot_name.empty())
|
|
|
|
{
|
|
|
|
continue;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
tmp_slot_display_names[slot] = slot_name;
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
std::map<int, std::string> mod_names;
|
2022-07-17 04:36:05 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
for (int mod = -1; mod < count; mod++)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
if (vehicle_helper::check_mod_blacklist(model, slot, mod))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
bool is_repeated = false;
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
std::string mod_name = vehicle_helper::get_mod_name(model, player_vehicle, slot, mod, count);
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (mod_name.empty() || mod_name == "NULL")
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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;
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2022-07-17 04:36:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(slot == MOD_REARWHEEL)
|
|
|
|
{
|
|
|
|
if (is_bennys)
|
|
|
|
{
|
|
|
|
if (mod_name.rfind("Chrome ", 0) == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
std::string new_mod_name = mod_name.substr(7);
|
|
|
|
|
|
|
|
if (tmp_rear_wheel_map[new_mod_name].size() > 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
mod_name = new_mod_name;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
is_repeated = true;
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (!is_repeated)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
mod_names[mod] = mod_name;
|
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
tmp_mod_display_names[slot] = mod_names;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (tmp_mod_display_names.count(MOD_HORNS) > 0)
|
|
|
|
{
|
|
|
|
tmp_mod_display_names[MOD_HORNS].insert(lsc_missing_horns.begin(), lsc_missing_horns.end());
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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;
|
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
components::button("Start LS Customs", [] {
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.ls_customs = true;
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (components::button("Max Vehicle"))
|
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
vehicle::max_vehicle(self::veh);
|
|
|
|
|
|
|
|
// refresh mod names
|
|
|
|
player_vehicle = 0;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::Separator();
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Mod Options");
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-28 01:42:15 +08:00
|
|
|
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]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_DRIFT_TYRES(player_vehicle, owned_mods[MOD_DRIFT_TIRE]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
}
|
2022-07-28 01:42:15 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Turbo", (bool*)&owned_mods[MOD_TURBO]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TURBO, owned_mods[MOD_TURBO]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Tiresmoke", (bool*)&owned_mods[MOD_TYRE_SMOKE]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TYRE_SMOKE, owned_mods[MOD_TYRE_SMOKE]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::Separator();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::BeginGroup();
|
2022-06-26 00:14:00 +02:00
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Slot");
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::ListBoxHeader("##slot", ImVec2(200, 200)))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [slot, name] : slot_display_names)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), slot == selected_slot))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_slot = slot;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::ListBoxFooter();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::EndGroup();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (selected_slot != -1)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
auto wheel_stock_mod = &front_wheel_stock_mod;
|
|
|
|
auto wheel_custom = &owned_mods[MOD_FRONTWHEEL_VAR];
|
|
|
|
bool is_wheel_mod = false;
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (selected_slot == MOD_FRONTWHEEL)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
is_wheel_mod = true;
|
|
|
|
}
|
|
|
|
else if (selected_slot == MOD_REARWHEEL)
|
|
|
|
{
|
|
|
|
wheel_stock_mod = &rear_wheel_stock_mod;
|
2022-07-17 04:36:05 +08:00
|
|
|
wheel_custom = &owned_mods[MOD_REARWHEEL_VAR];
|
2022-07-14 22:16:30 +08:00
|
|
|
is_wheel_mod = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
is_wheel_mod = false;
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Mod");
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::ListBoxHeader("##mod", ImVec2(240, 200)))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& it : mod_display_names[selected_slot])
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
const auto& mod = it.first;
|
|
|
|
const auto& name = it.second;
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
bool item_selected = mod == owned_mods[selected_slot];
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (is_wheel_mod)
|
|
|
|
{
|
|
|
|
item_selected = mod == *wheel_stock_mod;
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), item_selected))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
g_fiber_pool->queue_job([&mod, is_wheel_mod, wheel_stock_mod, wheel_custom] {
|
2022-07-14 22:16:30 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::ListBoxFooter();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::EndGroup();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (
|
|
|
|
is_wheel_mod && *wheel_stock_mod != -1
|
|
|
|
) {
|
|
|
|
auto wheel_map = front_wheel_map;
|
|
|
|
|
|
|
|
if (selected_slot == MOD_REARWHEEL)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
wheel_map = rear_wheel_map;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Style");
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::ListBoxHeader("##style", ImVec2(200, 200)))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
std::string mod_name = mod_display_names[selected_slot][*wheel_stock_mod];
|
|
|
|
auto wheel_mods = wheel_map[mod_name];
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
for (int i = 0; i < wheel_mods.size(); i++)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
int& mod = wheel_mods[i];
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
int should_custom = false;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
// 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;
|
2022-07-17 04:36:05 +08:00
|
|
|
});
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::ListBoxFooter();
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
ImGui::EndGroup();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::Separator();
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Neon Light Options");
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Headlight##headlight_en", (bool*)&owned_mods[MOD_XENON_LIGHTS]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Left", (bool*)&owned_mods[MOD_NEON_LEFT_ON]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Right", (bool*)&owned_mods[MOD_NEON_RIGHT_ON]))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_RIGHT, owned_mods[MOD_NEON_RIGHT_ON]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Front", (bool*)&owned_mods[MOD_NEON_FRONT_ON]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (ImGui::Checkbox("Back", (bool*)&owned_mods[MOD_NEON_BACK_ON]))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
|
|
|
components::button("Check All##neon_check_all", [] {
|
2022-07-17 04:36:05 +08:00
|
|
|
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]);
|
2022-09-20 14:03:19 +01:00
|
|
|
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]);
|
2022-07-15 20:53:48 +08:00
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::button("Uncheck All##neon_uncheck_all", [] {
|
2022-07-17 04:36:05 +08:00
|
|
|
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]);
|
2022-09-20 14:03:19 +01:00
|
|
|
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]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
ImGui::Separator();
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Color Options");
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
static int color_to_change = 0;
|
|
|
|
static int color_type = 8;
|
|
|
|
|
|
|
|
if (
|
2022-07-17 04:36:05 +08:00
|
|
|
(color_to_change == 7 && !owned_mods[MOD_XENON_LIGHTS]) ||
|
|
|
|
(color_to_change == 5 && !owned_mods[MOD_TYRE_SMOKE])
|
2022-07-14 22:16:30 +08:00
|
|
|
) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_TYRE_SMOKE])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::BeginDisabled();
|
|
|
|
}
|
|
|
|
if (ImGui::Selectable("Tire Smoke", color_to_change == 5))
|
|
|
|
{
|
|
|
|
color_to_change = 5;
|
|
|
|
color_type = 8;
|
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_TYRE_SMOKE])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::EndDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::Selectable("Wheel Color", color_to_change == 6))
|
|
|
|
{
|
|
|
|
color_to_change = 6;
|
|
|
|
color_type = 5;
|
|
|
|
}
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_XENON_LIGHTS])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::BeginDisabled();
|
|
|
|
}
|
|
|
|
if (ImGui::Selectable("Headlight##headlight_col", color_to_change == 7))
|
|
|
|
{
|
|
|
|
color_to_change = 7;
|
|
|
|
color_type = 9;
|
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_XENON_LIGHTS])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::EndDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::Selectable("Neon", color_to_change == 8))
|
|
|
|
{
|
|
|
|
color_to_change = 8;
|
|
|
|
color_type = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::ListBoxFooter();
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
if (color_to_change == 0 || color_to_change == 1)
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (color_type > 3)
|
|
|
|
{
|
|
|
|
color_type = 8;
|
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
// primary and secondary color
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::ListBoxHeader("##colors", ImVec2(140, 254)))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
if (ImGui::Selectable("Custom", color_type == 8, ImGuiSelectableFlags_SelectOnClick))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
color_type = 8;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
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);
|
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Selectable("Chrome", color_type == 0))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
color_type = 0;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Selectable("Classic", color_type == 1))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
color_type = 1;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Selectable("Matte", color_type == 2))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
color_type = 2;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::Selectable("Metals", color_type == 3))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
color_type = 3;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::ListBoxFooter();
|
|
|
|
}
|
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
else if (color_to_change == 7)
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (color_type == 8)
|
|
|
|
{
|
|
|
|
// custom color
|
|
|
|
|
|
|
|
static float color[3] = { 1, 1, 1 };
|
2022-07-17 04:36:05 +08:00
|
|
|
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];
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
if (color_to_change == 1)
|
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
color_r = &owned_mods[MOD_SECONDARY_COL_R];
|
|
|
|
color_g = &owned_mods[MOD_SECONDARY_COL_G];
|
|
|
|
color_b = &owned_mods[MOD_SECONDARY_COL_B];
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
else if (color_to_change == 2)
|
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
color_r = &owned_mods[MOD_TIRESMOKE_COL_R];
|
|
|
|
color_g = &owned_mods[MOD_TIRESMOKE_COL_G];
|
|
|
|
color_b = &owned_mods[MOD_TIRESMOKE_COL_B];
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
else if (color_to_change == 3)
|
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
color_r = &owned_mods[MOD_NEON_COL_R];
|
|
|
|
color_g = &owned_mods[MOD_NEON_COL_G];
|
|
|
|
color_b = &owned_mods[MOD_NEON_COL_B];
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
color[0] = (float)*color_r / 255;
|
|
|
|
color[1] = (float)*color_g / 255;
|
|
|
|
color[2] = (float)*color_b / 255;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
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]);
|
|
|
|
});
|
2022-07-17 04:36:05 +08:00
|
|
|
*color_r = rgb[0];
|
|
|
|
*color_g = rgb[1];
|
|
|
|
*color_b = rgb[2];
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, rgb[0], rgb[1], rgb[2]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
2022-07-17 04:36:05 +08:00
|
|
|
*color_r = rgb[0];
|
|
|
|
*color_g = rgb[1];
|
|
|
|
*color_b = rgb[2];
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::ListBoxFooter();
|
|
|
|
}
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SetNextItemWidth(214);
|
2022-07-12 22:42:07 +08:00
|
|
|
if (ImGui::ColorPicker3("Custom VehColor", color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex))
|
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
*color_r = (int)(color[0] * 255);
|
|
|
|
*color_g = (int)(color[1] * 255);
|
|
|
|
*color_b = (int)(color[2] * 255);
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
g_fiber_pool->queue_job([color_r, color_g, color_b] {
|
2022-07-12 22:42:07 +08:00
|
|
|
switch (color_to_change)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
case 0:
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
2022-06-26 00:14:00 +02:00
|
|
|
break;
|
2022-07-12 22:42:07 +08:00
|
|
|
case 1:
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
2022-07-14 22:16:30 +08:00
|
|
|
case 5:
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, *color_r, *color_g, *color_b);
|
2022-07-14 22:16:30 +08:00
|
|
|
break;
|
|
|
|
case 8:
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
|
2022-06-26 00:14:00 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// standard color
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
int selected_color = 0;
|
2022-07-12 22:42:07 +08:00
|
|
|
switch (color_type)
|
|
|
|
{
|
|
|
|
case 4:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = owned_mods[MOD_PEARLESCENT_COL];
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
case 5:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = owned_mods[MOD_WHEEL_COL];
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
case 6:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = owned_mods[MOD_INTERIOR_COL];
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
case 7:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = owned_mods[MOD_DASHBOARD_COL];
|
2022-07-14 22:16:30 +08:00
|
|
|
break;
|
|
|
|
case 9:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = owned_mods[MOD_XENON_COL];
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
default:
|
2022-07-17 04:36:05 +08:00
|
|
|
selected_color = (color_to_change == 0) ? owned_mods[MOD_PRIMARY_COL] : owned_mods[MOD_SECONDARY_COL];
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
if (color_type != 9)
|
|
|
|
{
|
|
|
|
ImGui::SameLine();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::ListBoxHeader("##color", ImVec2(180, 254)))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
switch (color_type)
|
|
|
|
{
|
|
|
|
case 0: //Chrome
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable("Chrome", selected_color == COLOR_CHROME))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-12 22:42:07 +08:00
|
|
|
if (color_to_change == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_PRIMARY_COL] = COLOR_CHROME;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
else
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_SECONDARY_COL] = COLOR_CHROME;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: //Classic
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_classic_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (color_to_change == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_PRIMARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
else
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_SECONDARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: //Matte
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_matte_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (color_to_change == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_PRIMARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
else
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_SECONDARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
case 3: //Metals
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_metal_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
if (color_to_change == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_PRIMARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
else
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_SECONDARY_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
|
2022-06-26 00:14:00 +02:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4: //Pearlescent
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_classic_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_PEARLESCENT_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, owned_mods[MOD_PEARLESCENT_COL], owned_mods[MOD_WHEEL_COL]);
|
2022-06-26 00:14:00 +02:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 5: //Wheel Color
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_classic_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_WHEEL_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-07-17 04:36:05 +08:00
|
|
|
VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, owned_mods[MOD_PEARLESCENT_COL], owned_mods[MOD_WHEEL_COL]);
|
2022-06-26 00:14:00 +02:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6: //Interior Color
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_classic_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_INTERIOR_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_5(player_vehicle, owned_mods[MOD_INTERIOR_COL]);
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7: //Dashboard Color
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
for (const auto& [color, name] : lsc_classic_colors)
|
2022-06-26 00:14:00 +02:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
selected_color = color;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_DASHBOARD_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_6(player_vehicle, owned_mods[MOD_DASHBOARD_COL]);
|
2022-06-26 00:14:00 +02:00
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
break;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
case 9: //Headlight Color
|
|
|
|
{
|
|
|
|
for (const auto& [color, name] : lsc_headlight_colors)
|
|
|
|
{
|
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
|
|
|
{
|
|
|
|
selected_color = color;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_XENON_COL] = color;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
g_fiber_pool->queue_job([] {
|
2022-09-20 14:03:19 +01:00
|
|
|
VEHICLE::SET_VEHICLE_XENON_LIGHT_COLOR_INDEX(player_vehicle, owned_mods[MOD_XENON_COL]);
|
2022-07-14 22:16:30 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::ListBoxFooter();
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|