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

Automatic neutral direction when deactivating cab

This commit is contained in:
Królik Uszasty
2022-03-02 23:33:54 +01:00
parent a2bdd8d698
commit 0508fa7660
4 changed files with 21 additions and 8 deletions

View File

@@ -7705,7 +7705,7 @@ bool TTrain::Update( double const Deltatime )
ggBatteryOffButton.Update();
if ((ggCabActivationButton.SubModel != nullptr) && (ggCabActivationButton.type() != TGaugeType::push))
{
ggCabActivationButton.UpdateValue((mvOccupied->CabMaster) && (mvOccupied->CabOccupied == mvOccupied->CabActive) ? 1.0 : 0.0);
ggCabActivationButton.UpdateValue(mvOccupied->IsCabMaster() ? 1.0 : 0.0);
}
ggCabActivationButton.Update();
@@ -9174,10 +9174,10 @@ void TTrain::set_cab_controls( int const Cab ) {
( ggBatteryButton.type() == TGaugeType::push ? 0.5f :
mvOccupied->Power24vIsAvailable ? 1.f :
0.f ) );
// battery
// activation
ggCabActivationButton.PutValue(
(ggCabActivationButton.type() == TGaugeType::push ? 0.5f :
(mvOccupied->CabActive == mvOccupied->CabOccupied) && mvOccupied->CabMaster ? 1.f :
mvOccupied->IsCabMaster() ? 1.f :
0.f));
// line breaker
if( ggMainButton.SubModel != nullptr ) { // instead of single main button there can be on/off pair