Make repair button vehicle in debug mode instead call resetconsist command, add pantograph damage flag, repair pantographs in resetconsist command

This commit is contained in:
milek7
2021-01-30 13:25:18 +01:00
parent 810b7ad074
commit 372f99afee
4 changed files with 22 additions and 13 deletions

View File

@@ -546,18 +546,10 @@ debug_panel::render() {
// sections
ImGui::Separator();
if( true == render_section( "Vehicle", m_vehiclelines ) ) {
if( ( m_input.mover )
&& ( m_input.mover->DamageFlag != 0 ) ) {
if( true == ImGui::Button( "Fix Status" ) ) {
// TODO: refactor status reset into mover method
m_input.mover->DamageFlag = 0;
m_input.mover->EngDmgFlag = 0;
m_input.mover->V = 0.0001; // HACK: force vehicle position re-calculation
m_input.mover->DistCounter = 0.0;
m_input.mover->WheelFlat = 0.0;
m_input.mover->AlarmChainFlag = false;
m_input.mover->OffsetTrackH = 0.0;
m_input.mover->OffsetTrackV = 0.0;
if( DebugModeFlag && ( m_input.mover ) && ( m_input.mover->DamageFlag != 0 ) ) {
if( true == ImGui::Button( "Stop and repair consist" ) ) {
command_relay relay;
relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &m_input.vehicle->name());
}
}
}