Vehicle tabs UI tweak (#1521)
This commit is contained in:
parent
305f6e7e8d
commit
1e701326a2
@ -22,8 +22,6 @@ namespace big
|
|||||||
HANDLING_CURRENT_PROFILE,
|
HANDLING_CURRENT_PROFILE,
|
||||||
LSC,
|
LSC,
|
||||||
SPAWN_VEHICLE,
|
SPAWN_VEHICLE,
|
||||||
PV,
|
|
||||||
PERSIST_CAR,
|
|
||||||
FUN_VEHICLE,
|
FUN_VEHICLE,
|
||||||
|
|
||||||
WORLD,
|
WORLD,
|
||||||
@ -103,8 +101,6 @@ namespace big
|
|||||||
},
|
},
|
||||||
{tabs::LSC, {"GUI_TAB_LSC", view::lsc}},
|
{tabs::LSC, {"GUI_TAB_LSC", view::lsc}},
|
||||||
{tabs::SPAWN_VEHICLE, {"GUI_TAB_SPAWN_VEHICLE", view::spawn_vehicle}},
|
{tabs::SPAWN_VEHICLE, {"GUI_TAB_SPAWN_VEHICLE", view::spawn_vehicle}},
|
||||||
{tabs::PV, {"GUI_TAB_PERSONAL_VEHICLE", view::pv}},
|
|
||||||
{tabs::PERSIST_CAR, {"GUI_TAB_PERSIST_CAR", view::persist_car}},
|
|
||||||
{tabs::FUN_VEHICLE, {"GUI_TAB_VEHICLE_FUN_FEATURES", view::fun_vehicle}},
|
{tabs::FUN_VEHICLE, {"GUI_TAB_VEHICLE_FUN_FEATURES", view::fun_vehicle}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -52,7 +52,9 @@ namespace big
|
|||||||
for (const auto& pair : vehicle_files)
|
for (const auto& pair : vehicle_files)
|
||||||
{
|
{
|
||||||
if (ImGui::Selectable(pair.c_str(), selected_vehicle_file == pair))
|
if (ImGui::Selectable(pair.c_str(), selected_vehicle_file == pair))
|
||||||
selected_vehicle_file = pair;
|
selected_vehicle_file = pair, g_fiber_pool->queue_job([] {
|
||||||
|
load_vehicle(selected_vehicle_file);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndListBox();
|
ImGui::EndListBox();
|
||||||
@ -63,10 +65,9 @@ namespace big
|
|||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
static char vehicle_file_name_input[50]{};
|
static char vehicle_file_name_input[50]{};
|
||||||
|
|
||||||
|
components::small_text("VEHICLE_FILE_NAME"_T);
|
||||||
ImGui::PushItemWidth(250);
|
ImGui::PushItemWidth(250);
|
||||||
components::input_text_with_hint("VEHICLE_FILE_NAME"_T, "VEHICLE_FILE_NAME_EXAMPLE"_T, vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
|
components::input_text_with_hint("##vehiclefilename", "VEHICLE_FILE_NAME_EXAMPLE"_T, vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
|
||||||
|
|
||||||
ImGui::SameLine();
|
|
||||||
|
|
||||||
components::button("SAVE_VEHICLE"_T, [] {
|
components::button("SAVE_VEHICLE"_T, [] {
|
||||||
if (!self::veh)
|
if (!self::veh)
|
||||||
@ -75,13 +76,6 @@ namespace big
|
|||||||
save_vehicle(vehicle_file_name_input);
|
save_vehicle(vehicle_file_name_input);
|
||||||
});
|
});
|
||||||
|
|
||||||
components::button("LOAD_VEHICLE"_T, [] {
|
|
||||||
if (self::veh)
|
|
||||||
return g_notification_service->push_warning("PERSIST_CAR"_T.data(), "You must not be in a vehicle. Please exit your vehicle before using load.");
|
|
||||||
|
|
||||||
load_vehicle(selected_vehicle_file);
|
|
||||||
});
|
|
||||||
|
|
||||||
ImGui::EndGroup();
|
ImGui::EndGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
void view::spawn_vehicle()
|
void render_spawn_new_vehicle()
|
||||||
{
|
{
|
||||||
ImGui::SetWindowSize({0.f, (float)*g_pointers->m_gta.m_resolution_y}, ImGuiCond_Always);
|
ImGui::SetWindowSize({0.f, (float)*g_pointers->m_gta.m_resolution_y}, ImGuiCond_Always);
|
||||||
|
|
||||||
@ -196,4 +196,21 @@ namespace big
|
|||||||
ImGui::EndListBox();
|
ImGui::EndListBox();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void view::spawn_vehicle()
|
||||||
|
{
|
||||||
|
static int spawn_type = 0;
|
||||||
|
ImGui::RadioButton("New", &spawn_type, 0);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::RadioButton("Personal", &spawn_type, 1);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::RadioButton("Persistent", &spawn_type, 2);
|
||||||
|
|
||||||
|
switch (spawn_type)
|
||||||
|
{
|
||||||
|
case 0: render_spawn_new_vehicle(); break;
|
||||||
|
case 1: view::pv(); break;
|
||||||
|
case 2: view::persist_car(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user