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

fix: radio fuse review: working push buttons, own hint, HUD

- radioon_sw:/radiooff_sw:/radiofuseon_sw:/radiofuseoff_sw: are now loaded
  as push-button gauges in initialize_gauge, so they can be clicked; the
  enable/disable commands press them while held. radiotoggle and
  radiofusetoggle flip the state directly, so they don't move them.
- New driver hint "Close radio fuse" (radiofuseon); "Switch on radio" is
  given only when the radio's own switch is off.
- The HUD shows the radio channel only with the fuse closed.

(eu07/maszyna#438)
This commit is contained in:
jerrrrycho
2026-11-08 17:52:39 +01:00
parent 30bdc3da61
commit 43fc80f452
7 changed files with 94 additions and 34 deletions

View File

@@ -130,13 +130,22 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
case driver_hint::radioon: {
if( AIControllFlag ) {
mvOccupied->Radio = true;
mvOccupied->RadioFuse = true;
}
remove_hint( driver_hint::radiooff );
hint(
Action,
[this](float const /*Parameter*/) {
return mvOccupied->Radio && mvOccupied->RadioFuse; } );
return mvOccupied->Radio == true; } );
break;
}
case driver_hint::radiofuseon: {
if( AIControllFlag ) {
mvOccupied->RadioFuse = true;
}
hint(
Action,
[this](float const /*Parameter*/) {
return mvOccupied->RadioFuse == true; } );
break;
}
case driver_hint::radiochannel: {

View File

@@ -2,6 +2,7 @@ DRIVER_HINT_DEF(batteryon, STRN("Switch on battery"))
DRIVER_HINT_DEF(batteryoff, STRN("Switch off battery"))
DRIVER_HINT_DEF(radioon, STRN("Switch on radio"))
DRIVER_HINT_DEF(radiooff, STRN("Switch off radio"))
DRIVER_HINT_DEF(radiofuseon, STRN("Close radio fuse"))
DRIVER_HINT_DEF(radiochannel, STRN("Tune into channel %.0f"))
DRIVER_HINT_DEF(oilpumpon, STRN("Switch on oil pump"))
DRIVER_HINT_DEF(oilpumpoff, STRN("Switch off oil pump"))

View File

@@ -810,7 +810,7 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
mover.HeatingAllow ? 'h' :
'.',
mover.Hamulec->Releaser() ? '^' : '.',
std::string( m_input.mechanik ? STR(" R") + ( mover.Radio ? std::to_string( m_input.mechanik->iRadioChannel ) : "-" ) : "" ).c_str(),
std::string( m_input.mechanik ? STR(" R") + ( mover.Radio && mover.RadioFuse ? std::to_string( m_input.mechanik->iRadioChannel ) : "-" ) : "" ).c_str(),
std::string( isdieselenginepowered ? STR(" oil pressure: ") + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
// power transfers
// 3000v