From 7cdbc2ca9cc28d7d9f8029e85aff2f103dc21de5 Mon Sep 17 00:00:00 2001 From: gir489 <100792176+gir489returns@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:02:16 -0400 Subject: [PATCH] Added clan logo to LS Customs menu. (#2199) --- src/views/vehicle/view_lsc.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/views/vehicle/view_lsc.cpp b/src/views/vehicle/view_lsc.cpp index 3ef6f81e..75bffcbc 100644 --- a/src/views/vehicle/view_lsc.cpp +++ b/src/views/vehicle/view_lsc.cpp @@ -15,6 +15,7 @@ namespace big static Vehicle player_vehicle = 0; static bool ready = true; + static Hash model; static std::map owned_mods; static std::map slot_display_names; static std::map> mod_display_names; @@ -58,7 +59,7 @@ namespace big VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0); - Hash model = ENTITY::GET_ENTITY_MODEL(player_vehicle); + 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); @@ -263,6 +264,28 @@ namespace big VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TYRE_SMOKE, owned_mods[MOD_TYRE_SMOKE]); }); } + 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); + }); + } + } + } ImGui::SeparatorText("Mod Slots");