feat(Vehicle Controller): Added vehicle window controls (#1607)

* feat(Overlay): Added Invisibility indicator and its able to save on unload
* feat(Vehicle Controller): Added vehicle window controls
This commit is contained in:
Sixhei Tartari
2023-07-05 23:51:19 +02:00
committed by GitHub
parent feeaa2ddbd
commit 13d5d81cea
8 changed files with 120 additions and 15 deletions

View File

@ -93,7 +93,7 @@ namespace big
}
ImGui::SameLine(300);
const auto button_label = g_vehicle_control_service.m_controlled_vehicle.doors[i].open ? "CLOSE"_T : "OPEN"_T;
if (components::button(button_label))
{
@ -109,6 +109,48 @@ namespace big
ImGui::EndGroup();
}
void render_windows_tab()
{
const char* const windownames[4]{
"Front left",
"Front right",
"Back left",
"Back right",
};
ImGui::BeginGroup();
ImGui::Spacing();
ImGui::SetNextItemWidth(200);
components::button("Roll Down All", [] {
g_vehicle_control_service.operate_window(eWindowId::WINDOW_INVALID_ID, true);
});
ImGui::SameLine();
components::button("Roll Up All", [] {
g_vehicle_control_service.operate_window(eWindowId::WINDOW_INVALID_ID, false);
});
ImGui::EndGroup();
ImGui::Spacing();
ImGui::Separator();
ImGui::BeginGroup();
for (int i = 0; i < 4; i++)
{
ImGui::SetNextItemWidth(200);
ImGui::PushID(i);
ImGui::Text(windownames[i]);
ImGui::SameLine(300);
components::button("Roll Down", [i] {
g_vehicle_control_service.operate_window((eWindowId)i, true);
});
ImGui::SameLine();
components::button("Roll Up", [i] {
g_vehicle_control_service.operate_window((eWindowId)i, false);
});
ImGui::PopID();
}
}
void render_lights_tab()
{
const char* const neonnames[4]{
@ -321,6 +363,13 @@ namespace big
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Windows"))
{
render_windows_tab();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Lights"))
{
render_lights_tab();