input for xml transport (#3207)
This commit is contained in:
parent
9df32a3adf
commit
9a2e85b7f5
@ -8,6 +8,11 @@ namespace big
|
||||
{
|
||||
void view::xml_vehicles()
|
||||
{
|
||||
static char search[64];
|
||||
components::input_text_with_hint("MODEL_NAME"_T, "SEARCH"_T, search, IM_ARRAYSIZE(search), ImGuiInputTextFlags_None);
|
||||
std::string lower_search = search;
|
||||
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::button("Reload", [] {
|
||||
@ -17,11 +22,16 @@ namespace big
|
||||
{
|
||||
for (auto& [name, doc] : g_xml_vehicles_service->m_all_xml_vehicles)
|
||||
{
|
||||
components::selectable(name, false, [&doc] {
|
||||
auto handle = g_xml_vehicles_service->spawn_from_xml(doc, self::pos);
|
||||
if (g.spawn_vehicle.spawn_inside)
|
||||
vehicle::teleport_into_vehicle(handle);
|
||||
});
|
||||
std::string lower_name = name;
|
||||
std::transform(lower_name.begin(), lower_name.end(), lower_name.begin(), tolower);
|
||||
if (lower_name.find(lower_search) != std::string::npos)
|
||||
{
|
||||
components::selectable(name, false, [&doc] {
|
||||
auto handle = g_xml_vehicles_service->spawn_from_xml(doc, self::pos);
|
||||
if (g.spawn_vehicle.spawn_inside)
|
||||
vehicle::teleport_into_vehicle(handle);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndListBox();
|
||||
|
Reference in New Issue
Block a user