Added proofs to vehicle menu and improved waterproof feature. (#330)

- Added proofs section to vehicle menu that allows player to control damage bits. 
- Player can now drive or walk underwater with waterproof turned on.
- Added bring closest vehicle feature.
- Vehicle will not deform with collision proof on.
- Improved vehicle menu arrangement.
- Added plate changer in LSC.
- Updated LSC layout.
- Expanded wheel type feature.
- Fixed a bug where the mod section shows repetitive wheel mods.

Fixed issue #331
This commit is contained in:
aa15032261
2022-07-12 22:42:07 +08:00
committed by GitHub
parent 2d9021f0b8
commit 15ef1b874d
23 changed files with 1207 additions and 713 deletions

View File

@ -52,7 +52,7 @@ namespace big
});
g_mobile_service->refresh_personal_vehicles();
if (ImGui::ListBoxHeader("##personal_veh_list", { 300, static_cast<float>(*g_pointers->m_resolution_y - 184 - 38 * num_of_rows) }))
if (ImGui::ListBoxHeader("###personal_veh_list", { 300, static_cast<float>(*g_pointers->m_resolution_y - 184 - 38 * num_of_rows) }))
{
if (g_mobile_service->personal_vehicles().empty())
@ -77,60 +77,58 @@ namespace big
display_name.find(lower_search) != std::string::npos ||
display_manufacturer.find(lower_search) != std::string::npos
) {
ImGui::PushID(personal_veh->get_id());
if (ImGui::Selectable(label.c_str(), false)) {
ImGui::PushID('v' << 24 & personal_veh->get_id());
components::selectable(label, false, [&personal_veh] {
if (g->clone_pv.spawn_clone)
{
g_fiber_pool->queue_job([&personal_veh] {
auto vehicle_idx = personal_veh->get_vehicle_idx();
auto veh_data = vehicle::get_vehicle_data_from_vehicle_idx(vehicle_idx);
auto vehicle_idx = personal_veh->get_vehicle_idx();
auto veh_data = vehicle::get_vehicle_data_from_vehicle_idx(vehicle_idx);
float y_offset = 0;
float y_offset = 0;
if (PED::IS_PED_IN_ANY_VEHICLE(self::ped, false))
{
y_offset = 10.f;
}
else if (!g->spawn.spawn_inside)
{
y_offset = 5.f;
}
if (self::veh != 0)
{
y_offset = 10.f;
}
else if (!g->clone_pv.spawn_inside)
{
y_offset = 5.f;
}
auto spawn_location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, y_offset, 0.f);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
auto spawn_location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, y_offset, 0.f);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
const char* spawn_plate = plate;
if (g->clone_pv.clone_plate)
{
spawn_plate = personal_veh->get_plate();
}
const char* spawn_plate = plate;
if (g->clone_pv.clone_plate)
{
spawn_plate = personal_veh->get_plate();
}
auto veh = vehicle::clone(veh_data, spawn_location, spawn_heading);
auto veh = vehicle::clone(veh_data, spawn_location, spawn_heading);
if (g->clone_pv.spawn_inside)
{
vehicle::telport_into_veh(veh);
}
if (g->clone_pv.spawn_inside)
{
vehicle::telport_into_veh(veh);
}
if (g->clone_pv.spawn_maxed)
{
vehicle::max_vehicle(veh);
}
if (g->clone_pv.spawn_maxed)
{
vehicle::max_vehicle(veh);
}
vehicle::set_plate(veh, spawn_plate);
});
vehicle::set_plate(veh, spawn_plate);
}
else
{
strcpy(search, "");
lower_search = search;
g_fiber_pool->queue_job([&personal_veh] {
personal_veh->summon();
});
personal_veh->summon();
}
}
g_vehicle_preview_service->stop_preview();
});
ImGui::PopID();
if (g->clone_pv.preview_vehicle && ImGui::IsItemHovered())