mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 16:55:10 +01:00
driveruipanels: Allow to toggle AI driver from the driving aid
Possibly the single greatest UX improvement for newcomers that could there ever be.
This commit is contained in:
@@ -206,6 +206,24 @@ drivingaid_panel::update() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
drivingaid_panel::render_contents() {
|
||||||
|
ImGui::Checkbox(STR_C("expand"), &is_expanded);
|
||||||
|
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
auto const *driver = (simulation::Train && simulation::Train->Dynamic()) ? simulation::Train->Dynamic()->Mechanik : nullptr;
|
||||||
|
if (driver && (false == Global.RealisticControlMode || DebugModeFlag)) {
|
||||||
|
bool autopilot = driver->AIControllFlag;
|
||||||
|
if (ImGui::Checkbox(STR_C("autopilot"), &autopilot)) {
|
||||||
|
command_relay commandrelay;
|
||||||
|
commandrelay.post(autopilot ? user_command::aidriverenable : user_command::aidriverdisable, 0.0, 0.0, GLFW_PRESS, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_panel::render_contents();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
scenario_panel::update() {
|
scenario_panel::update() {
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
|
void render_contents() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// members
|
// members
|
||||||
|
|||||||
Reference in New Issue
Block a user