2023-03-01 21:27:15 +00:00
|
|
|
#include "core/data/lsc_types.hpp"
|
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-12 22:42:07 +08:00
|
|
|
#include "util/vehicle.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "views/view.hpp"
|
|
|
|
|
2022-07-12 22:42:07 +08:00
|
|
|
#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;
|
2023-03-01 21:27:15 +00:00
|
|
|
static bool ready = true;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2023-09-26 16:02:16 -04:00
|
|
|
static Hash model;
|
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;
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
static int selected_slot = -1;
|
|
|
|
static bool is_bennys = false;
|
2022-07-14 22:16:30 +08:00
|
|
|
static int front_wheel_stock_mod = -1;
|
2023-03-01 21:27:15 +00:00
|
|
|
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
|
|
|
{
|
2023-03-01 21:27:15 +00: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;
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Text("PLEASE_ENTER_A_VEHICLE"_T.data());
|
2022-07-14 22:16:30 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player_vehicle != self::veh && ready == true)
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
ready = false;
|
2022-07-14 22:16:30 +08:00
|
|
|
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();
|
|
|
|
}
|
2023-03-01 21:27:15 +00:00
|
|
|
|
2022-07-15 20:56:55 +08:00
|
|
|
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2023-09-26 16:02:16 -04:00
|
|
|
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;
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
tmp_slot_display_names[MOD_PLATE_STYLE] = "PLATE_STYLE"_T.data();
|
|
|
|
tmp_slot_display_names[MOD_WINDOW_TINT] = "WINDOW_TINT"_T.data();
|
2023-03-01 21:27:15 +00:00
|
|
|
tmp_slot_display_names[MOD_WHEEL_TYPE] = "WHEEL_TYPE"_T.data();
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
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());
|
|
|
|
|
2023-03-01 21:27:15 +00: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
|
|
|
}
|
2023-08-24 14:23:50 -04:00
|
|
|
slot_name.append("##");
|
|
|
|
slot_name.append(std::to_string(slot));
|
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)
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (mod_name.rfind("LSC_CHROME"_T.data(), 0) == 0)
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
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;
|
2022-07-17 04:36:05 +08:00
|
|
|
}
|
|
|
|
}
|
2023-03-01 21:27:15 +00:00
|
|
|
else if (slot == MOD_REARWHEEL)
|
2022-07-17 04:36:05 +08:00
|
|
|
{
|
|
|
|
if (is_bennys)
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (mod_name.rfind("LSC_CHROME"_T.data(), 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
|
|
|
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;
|
2023-03-01 21:27:15 +00:00
|
|
|
mod_display_names = tmp_mod_display_names;
|
|
|
|
front_wheel_map = tmp_front_wheel_map;
|
|
|
|
rear_wheel_map = tmp_rear_wheel_map;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
ready = true;
|
|
|
|
});
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::button("START_LS_CUSTOMS"_T, [] {
|
2022-12-18 23:15:52 +01:00
|
|
|
g.vehicle.ls_customs = true;
|
2022-07-12 22:42:07 +08:00
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (components::button("MAX_VEHICLE"_T))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
vehicle::max_vehicle(self::veh);
|
|
|
|
|
|
|
|
// refresh mod names
|
|
|
|
player_vehicle = 0;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-06-10 14:47:19 +02:00
|
|
|
ImGui::SameLine();
|
2023-11-03 11:07:28 -04:00
|
|
|
if (components::button("MAX_VEHICLE_PERFORMANCE"_T))
|
2023-06-10 14:47:19 +02:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
vehicle::max_vehicle_performance(self::veh);
|
2023-06-27 14:05:44 +02:00
|
|
|
|
2023-06-10 14:47:19 +02:00
|
|
|
// refresh mod names
|
|
|
|
player_vehicle = 0;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
static char plate[9];
|
|
|
|
|
|
|
|
ImGui::SetNextItemWidth(200.f);
|
2023-02-01 19:46:33 +01:00
|
|
|
components::input_text_with_hint("##plate", "PLATE_NUMBER"_T, plate, sizeof(plate), ImGuiInputTextFlags_None);
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (components::button("CHANGE_PLATE_NUMBER"_T))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
vehicle::set_plate(self::veh, plate);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-06-27 14:05:44 +02:00
|
|
|
ImGui::SeparatorText("MOD_OPTIONS"_T.data());
|
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];
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("BULLETPROOF_TIRES"_T.data(), (bool*)&is_bulletproof_tires))
|
2022-07-28 01:42:15 +08:00
|
|
|
{
|
|
|
|
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();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("LOW_GRIP_TIRES"_T.data(), (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();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("TURBO"_T.data(), (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();
|
2023-08-31 09:43:55 -04:00
|
|
|
if (ImGui::Checkbox("TIRE_SMOKE"_T.data(), (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
|
|
|
});
|
|
|
|
}
|
2023-09-26 16:02:16 -04:00
|
|
|
rage::fvector3 blank;
|
|
|
|
float scale;
|
|
|
|
if (GetVehicleInfoForClanLogo(model, blank, blank, blank, scale))
|
|
|
|
{
|
|
|
|
auto has_clan_logo = (bool*)&owned_mods[MOD_HAS_CLAN_LOGO];
|
|
|
|
if (ImGui::Checkbox("CLAN_LOGO"_T.data(), has_clan_logo))
|
|
|
|
{
|
|
|
|
if (*has_clan_logo)
|
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
vehicle_helper::add_clan_logo_to_vehicle(player_vehicle, self::ped);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([] {
|
|
|
|
GRAPHICS::REMOVE_VEHICLE_CREW_EMBLEM(player_vehicle, 0);
|
|
|
|
GRAPHICS::REMOVE_VEHICLE_CREW_EMBLEM(player_vehicle, 1);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::SeparatorText("VIEW_LSC_MOD_SLOTS"_T.data());
|
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
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("SLOT"_T);
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##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
|
|
|
}
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
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;
|
2023-03-01 21:27:15 +00:00
|
|
|
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;
|
2023-03-01 21:27:15 +00:00
|
|
|
wheel_custom = &owned_mods[MOD_REARWHEEL_VAR];
|
|
|
|
is_wheel_mod = true;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
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();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("MOD"_T);
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##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
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
const auto& mod = it.first;
|
2022-07-14 22:16:30 +08:00
|
|
|
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] {
|
2023-02-09 05:46:08 +08:00
|
|
|
entity::take_control_of(self::veh);
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
if (selected_slot >= 0)
|
|
|
|
{
|
2023-08-19 11:01:08 +00:00
|
|
|
if (!VEHICLE::IS_VEHICLE_MOD_GEN9_EXCLUSIVE(player_vehicle, selected_slot, mod))
|
|
|
|
{
|
|
|
|
VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, false);
|
|
|
|
owned_mods[selected_slot] = mod;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2023-08-19 11:01:08 +00:00
|
|
|
if (is_wheel_mod)
|
|
|
|
{
|
|
|
|
*wheel_stock_mod = mod;
|
|
|
|
*wheel_custom = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2024-03-23 00:04:49 +01:00
|
|
|
g_notification_service.push_error("GUI_TAB_LSC"_T.data(), "VIEW_LSC_SELECTED_MOD_IS_INVALID"_T.data());
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
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
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
if (is_wheel_mod && *wheel_stock_mod != -1)
|
|
|
|
{
|
2022-07-14 22:16:30 +08:00
|
|
|
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();
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
components::sub_title("STYLE"_T);
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##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];
|
2023-03-01 21:27:15 +00:00
|
|
|
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)
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("STOCK"_T.data(), mod == owned_mods[selected_slot] && *wheel_custom == false))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
std::string label = "LSC_STYLE"_T.data() + std::to_string(mod);
|
2022-07-14 22:16:30 +08:00
|
|
|
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
|
|
|
}
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-25 02:53:24 -04:00
|
|
|
int item_counter = 0;
|
|
|
|
for (int extra = MOD_EXTRA_0; extra >= MOD_EXTRA_14; extra--)
|
|
|
|
{
|
|
|
|
if (owned_mods.find(extra) != owned_mods.end())
|
|
|
|
{
|
|
|
|
if (item_counter == 0)
|
|
|
|
{
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::SeparatorText("VIEW_LSC_VEHICLE_EXTRAS"_T.data());
|
2023-08-25 02:53:24 -04:00
|
|
|
ImGui::BeginGroup();
|
|
|
|
}
|
|
|
|
if ((item_counter % 5) != 0)
|
|
|
|
ImGui::SameLine();
|
|
|
|
int gta_extra_id = (extra - MOD_EXTRA_0) * -1;
|
2023-10-20 12:24:44 -04:00
|
|
|
auto name = std::format("{}: #{}", "VIEW_LSC_EXTRAS"_T, gta_extra_id);
|
2023-08-25 02:53:24 -04:00
|
|
|
bool is_extra_enabled = owned_mods[extra] == 1;
|
|
|
|
if (ImGui::Checkbox(name.c_str(), &is_extra_enabled))
|
|
|
|
{
|
|
|
|
owned_mods[extra] = is_extra_enabled;
|
|
|
|
g_fiber_pool->queue_job([gta_extra_id, is_extra_enabled] {
|
|
|
|
VEHICLE::SET_VEHICLE_EXTRA(player_vehicle, gta_extra_id, !is_extra_enabled);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
item_counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (item_counter != 0)
|
|
|
|
{
|
|
|
|
ImGui::EndGroup();
|
|
|
|
}
|
|
|
|
|
2023-06-27 14:05:44 +02:00
|
|
|
ImGui::SeparatorText("NEON_LIGHT_OPTIONS"_T.data());
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PushID("##headlight_en");
|
|
|
|
if (ImGui::Checkbox("HEADLIGHT"_T.data(), (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
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PopID();
|
2022-07-12 22:42:07 +08:00
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("LEFT"_T.data(), (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();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("RIGHT"_T.data(), (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();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("FRONT"_T.data(), (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();
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Checkbox("BACK"_T.data(), (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();
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PushID("##neon_check_all");
|
|
|
|
components::button("CHECK_ALL"_T, [] {
|
2023-03-01 21:27:15 +00:00
|
|
|
owned_mods[MOD_XENON_LIGHTS] = true;
|
|
|
|
owned_mods[MOD_NEON_LEFT_ON] = true;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_NEON_RIGHT_ON] = true;
|
|
|
|
owned_mods[MOD_NEON_FRONT_ON] = true;
|
2023-03-01 21:27:15 +00:00
|
|
|
owned_mods[MOD_NEON_BACK_ON] = true;
|
2022-07-17 04:36:05 +08:00
|
|
|
|
|
|
|
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
|
|
|
});
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PopID();
|
2022-07-15 20:53:48 +08:00
|
|
|
ImGui::SameLine();
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PushID("##neon_uncheck_all");
|
|
|
|
components::button("UNCHECK_ALL"_T, [] {
|
2023-03-01 21:27:15 +00:00
|
|
|
owned_mods[MOD_XENON_LIGHTS] = false;
|
|
|
|
owned_mods[MOD_NEON_LEFT_ON] = false;
|
2022-07-17 04:36:05 +08:00
|
|
|
owned_mods[MOD_NEON_RIGHT_ON] = false;
|
|
|
|
owned_mods[MOD_NEON_FRONT_ON] = false;
|
2023-03-01 21:27:15 +00:00
|
|
|
owned_mods[MOD_NEON_BACK_ON] = false;
|
2022-07-17 04:36:05 +08:00
|
|
|
|
|
|
|
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
|
|
|
});
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PopID();
|
2022-07-12 22:42:07 +08:00
|
|
|
|
2023-06-27 14:05:44 +02:00
|
|
|
ImGui::SeparatorText("COLOR_OPTIONS"_T.data());
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
static int color_to_change = 0;
|
2023-03-01 21:27:15 +00:00
|
|
|
static int color_type = 8;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
if ((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;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 8;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##color_options", ImVec2(120, 254)))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("PRIMARY"_T.data(), color_to_change == 0, ImGuiSelectableFlags_SelectOnClick))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 0;
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("SECONDARY"_T.data(), color_to_change == 1))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 1;
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("PEARLESCENT"_T.data(), color_to_change == 2))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 2;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 4;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("INTERIOR"_T.data(), color_to_change == 3))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 3;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 6;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("DASHBOARD"_T.data(), color_to_change == 4))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 4;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 7;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_TYRE_SMOKE])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::BeginDisabled();
|
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("TIRE_SMOKE"_T.data(), color_to_change == 5))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 5;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 8;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_TYRE_SMOKE])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::EndDisabled();
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("WHEEL_COLOR"_T.data(), color_to_change == 6))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 6;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 5;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_XENON_LIGHTS])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::BeginDisabled();
|
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PushID("##headlight_col");
|
|
|
|
if (ImGui::Selectable("HEADLIGHT"_T.data(), color_to_change == 7))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 7;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 9;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::PopID();
|
2022-07-17 04:36:05 +08:00
|
|
|
if (!owned_mods[MOD_XENON_LIGHTS])
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
ImGui::EndDisabled();
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("NEON"_T.data(), color_to_change == 8))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
color_to_change = 8;
|
2023-03-01 21:27:15 +00:00
|
|
|
color_type = 8;
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
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();
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##colors", ImVec2(140, 254)))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("CUSTOM"_T.data(), 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
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("REMOVE_CUSTOM"_T.data(), false))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
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
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("CHROME"_T.data(), 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
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("CLASSIC"_T.data(), 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
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("MATTE"_T.data(), 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
|
|
|
}
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("METALS"_T.data(), 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
|
|
|
}
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-07-12 22:42:07 +08:00
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
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];
|
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();
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##tire_smoke_rgb", ImVec2(140, 254)))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
for (const auto& it : lsc_tire_smoke_rgb)
|
|
|
|
{
|
|
|
|
auto& name = it.first;
|
2023-03-01 21:27:15 +00:00
|
|
|
auto& rgb = it.second;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (color_to_change == 8)
|
|
|
|
{
|
|
|
|
ImGui::SameLine();
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##neon_rgb", ImVec2(140, 254)))
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
for (const auto& it : lsc_neon_rgb)
|
|
|
|
{
|
|
|
|
auto& name = it.first;
|
2023-03-01 21:27:15 +00:00
|
|
|
auto& rgb = it.second;
|
2022-07-14 22:16:30 +08:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-07-14 22:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
2022-07-12 22:42:07 +08:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
2022-07-14 22:16:30 +08:00
|
|
|
ImGui::SetNextItemWidth(214);
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::ColorPicker3("CUSTOM_VEHCOLOR"_T.data(), color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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;
|
2023-03-01 21:27:15 +00:00
|
|
|
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;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
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)
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
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;
|
2022-07-12 22:42:07 +08:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##color", ImVec2(180, 254)))
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
|
|
|
switch (color_type)
|
|
|
|
{
|
2023-06-27 14:05:44 +02:00
|
|
|
case 0: //Chrome
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::Selectable("CHROME"_T.data(), 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;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 1: //Classic
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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-12 22:42:07 +08:00
|
|
|
break;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 2: //Matte
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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-12 22:42:07 +08:00
|
|
|
break;
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
2023-06-27 14:05:44 +02: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;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 4: //Pearlescent
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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
|
|
|
{
|
2023-03-01 21:27:15 +00: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;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 5: //Wheel Color
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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
|
|
|
{
|
2023-03-01 21:27:15 +00: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;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 6: //Interior Color
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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
|
|
|
{
|
2023-03-01 21:27:15 +00: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;
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 7: //Dashboard Color
|
2022-07-12 22:42:07 +08:00
|
|
|
{
|
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
|
|
|
{
|
2023-03-01 21:27:15 +00: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
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
case 9: //Headlight Color
|
2022-07-14 22:16:30 +08:00
|
|
|
{
|
|
|
|
for (const auto& [color, name] : lsc_headlight_colors)
|
|
|
|
{
|
|
|
|
if (ImGui::Selectable(name.c_str(), selected_color == color))
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
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
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-06-26 00:14:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|