Vehicle tabs UI tweak (#1521)
This commit is contained in:
@ -52,7 +52,9 @@ namespace big
|
||||
for (const auto& pair : vehicle_files)
|
||||
{
|
||||
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();
|
||||
@ -63,10 +65,9 @@ namespace big
|
||||
ImGui::BeginGroup();
|
||||
static char vehicle_file_name_input[50]{};
|
||||
|
||||
components::small_text("VEHICLE_FILE_NAME"_T);
|
||||
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));
|
||||
|
||||
ImGui::SameLine();
|
||||
components::input_text_with_hint("##vehiclefilename", "VEHICLE_FILE_NAME_EXAMPLE"_T, vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
|
||||
|
||||
components::button("SAVE_VEHICLE"_T, [] {
|
||||
if (!self::veh)
|
||||
@ -75,13 +76,6 @@ namespace big
|
||||
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();
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
|
||||
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);
|
||||
|
||||
@ -36,7 +36,7 @@ namespace big
|
||||
|
||||
ImGui::SetNextItemWidth(300.f);
|
||||
if (ImGui::BeginCombo("VEHICLE_CLASS"_T.data(),
|
||||
selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
|
||||
selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
|
||||
{
|
||||
if (ImGui::Selectable("ALL"_T.data(), selected_class == -1))
|
||||
{
|
||||
@ -196,4 +196,21 @@ namespace big
|
||||
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