16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

vehicle params window, aware system rewrite, sifa

This commit is contained in:
milek7
2019-03-16 01:21:59 +01:00
parent f1c8c8f1cd
commit 3556a2d0e6
24 changed files with 622 additions and 451 deletions

View File

@@ -3,8 +3,10 @@
#include "simulation.h"
#include "Driver.h"
void ui::vehiclelist_panel::render_contents() {
for (TDynamicObject* vehicle : simulation::Vehicles.sequence()) {
void ui::vehiclelist_panel::render_contents()
{
for (TDynamicObject *vehicle : simulation::Vehicles.sequence())
{
if (vehicle->Prev())
continue;
@@ -17,9 +19,11 @@ void ui::vehiclelist_panel::render_contents() {
std::string label = std::string(name + ", " + timetable + std::to_string(speed) + " km/h");
if (!vehicle->Next())
ImGui::TextUnformatted(label.c_str());
else if (ImGui::TreeNode(vehicle, label.c_str())) {
else if (ImGui::TreeNode(vehicle, label.c_str()))
{
vehicle = vehicle->Next();
while (vehicle) {
while (vehicle)
{
ImGui::TextUnformatted(vehicle->name().c_str());
vehicle = vehicle->Next();
}
@@ -27,5 +31,5 @@ void ui::vehiclelist_panel::render_contents() {
}
}
//ImGui::ShowDemoWindow();
// ImGui::ShowDemoWindow();
}