mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 04:19:19 +02:00
build 170715. custom sounds for cab lights, optional fallback on legacy sounds for controls without their own sound definitions
This commit is contained in:
158
Button.cpp
158
Button.cpp
@@ -9,11 +9,11 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Button.h"
|
||||
#include "parser.h"
|
||||
#include "Model3d.h"
|
||||
#include "Console.h"
|
||||
#include "logs.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
TButton::TButton()
|
||||
{
|
||||
iFeedbackBit = 0;
|
||||
@@ -21,13 +21,11 @@ TButton::TButton()
|
||||
Clear();
|
||||
};
|
||||
|
||||
TButton::~TButton(){};
|
||||
|
||||
void TButton::Clear(int i)
|
||||
{
|
||||
pModelOn = NULL;
|
||||
pModelOff = NULL;
|
||||
bOn = false;
|
||||
pModelOn = nullptr;
|
||||
pModelOff = nullptr;
|
||||
m_state = false;
|
||||
if (i >= 0)
|
||||
FeedbackBitSet(i);
|
||||
Update(); // kasowanie bitu Feedback, o ile jakiś ustawiony
|
||||
@@ -35,52 +33,134 @@ void TButton::Clear(int i)
|
||||
|
||||
void TButton::Init(std::string const &asName, TModel3d *pModel, bool bNewOn)
|
||||
{
|
||||
if (!pModel)
|
||||
return; // nie ma w czym szukać
|
||||
if( pModel == nullptr ) { return; }
|
||||
|
||||
pModelOn = pModel->GetFromName( (asName + "_on").c_str() );
|
||||
pModelOff = pModel->GetFromName( (asName + "_off").c_str() );
|
||||
bOn = bNewOn;
|
||||
m_state = bNewOn;
|
||||
Update();
|
||||
};
|
||||
|
||||
void TButton::Load(cParser &Parser, TModel3d *pModel1, TModel3d *pModel2)
|
||||
{
|
||||
std::string const token = Parser.getToken<std::string>();
|
||||
if (pModel1)
|
||||
{ // poszukiwanie submodeli w modelu
|
||||
Init(token, pModel1, false);
|
||||
if (pModel2)
|
||||
if (!pModelOn && !pModelOff)
|
||||
Init(token, pModel2, false); // może w drugim będzie (jak nie w kabinie,
|
||||
// to w zewnętrznym)
|
||||
}
|
||||
else
|
||||
{
|
||||
pModelOn = NULL;
|
||||
pModelOff = NULL;
|
||||
void TButton::Load(cParser &Parser, TModel3d *pModel1, TModel3d *pModel2) {
|
||||
|
||||
ErrorLog( "Failed to locate sub-model \"" + token + "\" in 3d model \"" + pModel1->NameGet() + "\"" );
|
||||
std::string submodelname;
|
||||
|
||||
Parser.getTokens();
|
||||
if( Parser.peek() != "{" ) {
|
||||
// old fixed size config
|
||||
Parser >> submodelname;
|
||||
}
|
||||
else {
|
||||
// new, block type config
|
||||
// TODO: rework the base part into yaml-compatible flow style mapping
|
||||
cParser mappingparser( Parser.getToken<std::string>( false, "}" ) );
|
||||
submodelname = mappingparser.getToken<std::string>( false );
|
||||
// new, variable length section
|
||||
while( true == Load_mapping( mappingparser ) ) {
|
||||
; // all work done by while()
|
||||
}
|
||||
}
|
||||
|
||||
if( pModel1 ) {
|
||||
// poszukiwanie submodeli w modelu
|
||||
Init( submodelname, pModel1, false );
|
||||
if( ( pModelOn != nullptr ) || ( pModelOff != nullptr ) ) {
|
||||
// we got our models, bail out
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( pModel2 ) {
|
||||
// poszukiwanie submodeli w modelu
|
||||
Init( submodelname, pModel2, false );
|
||||
if( ( pModelOn != nullptr ) || ( pModelOff != nullptr ) ) {
|
||||
// we got our models, bail out
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if we failed to locate even one state submodel, cry
|
||||
ErrorLog( "Failed to locate sub-model \"" + submodelname + "\" in 3d model \"" + pModel1->NameGet() + "\"" );
|
||||
};
|
||||
|
||||
void TButton::Update()
|
||||
{
|
||||
if (bData != NULL)
|
||||
bOn = (*bData);
|
||||
if (pModelOn)
|
||||
pModelOn->iVisible = bOn;
|
||||
if (pModelOff)
|
||||
pModelOff->iVisible = !bOn;
|
||||
if (iFeedbackBit) // jeżeli generuje informację zwrotną
|
||||
{
|
||||
if (bOn) // zapalenie
|
||||
bool
|
||||
TButton::Load_mapping( cParser &Input ) {
|
||||
|
||||
if( false == Input.getTokens( 2, true, ", " ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string key, value;
|
||||
Input
|
||||
>> key
|
||||
>> value;
|
||||
|
||||
if( key == "soundinc:" ) {
|
||||
m_soundfxincrease = (
|
||||
value != "none" ?
|
||||
TSoundsManager::GetFromName( value, true ) :
|
||||
nullptr );
|
||||
}
|
||||
else if( key == "sounddec:" ) {
|
||||
m_soundfxdecrease = (
|
||||
value != "none" ?
|
||||
TSoundsManager::GetFromName( value, true ) :
|
||||
nullptr );
|
||||
}
|
||||
return true; // return value marks a key: value pair was extracted, nothing about whether it's recognized
|
||||
}
|
||||
|
||||
void
|
||||
TButton::Turn( bool const State ) {
|
||||
|
||||
if( State != m_state ) {
|
||||
|
||||
m_state = State;
|
||||
play();
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
void TButton::Update() {
|
||||
|
||||
if( ( bData != nullptr )
|
||||
&& ( *bData != m_state ) ) {
|
||||
|
||||
m_state = ( *bData );
|
||||
play();
|
||||
}
|
||||
|
||||
if( pModelOn != nullptr ) { pModelOn->iVisible = m_state; }
|
||||
if( pModelOff != nullptr ) { pModelOff->iVisible = (!m_state); }
|
||||
|
||||
if (iFeedbackBit) {
|
||||
// jeżeli generuje informację zwrotną
|
||||
if (m_state) // zapalenie
|
||||
Console::BitsSet(iFeedbackBit);
|
||||
else
|
||||
Console::BitsClear(iFeedbackBit);
|
||||
}
|
||||
};
|
||||
|
||||
void TButton::AssignBool(bool *bValue)
|
||||
{
|
||||
void TButton::AssignBool(bool const *bValue) {
|
||||
|
||||
bData = bValue;
|
||||
}
|
||||
|
||||
void
|
||||
TButton::play() {
|
||||
|
||||
play(
|
||||
m_state == true ?
|
||||
m_soundfxincrease :
|
||||
m_soundfxdecrease );
|
||||
}
|
||||
|
||||
void
|
||||
TButton::play( PSound Sound ) {
|
||||
|
||||
if( Sound == nullptr ) { return; }
|
||||
|
||||
Sound->SetCurrentPosition( 0 );
|
||||
Sound->SetVolume( DSBVOLUME_MAX );
|
||||
Sound->Play( 0, 0, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
75
Button.h
75
Button.h
@@ -7,59 +7,52 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef ButtonH
|
||||
#define ButtonH
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "Model3d.h"
|
||||
#include "parser.h"
|
||||
#include "Classes.h"
|
||||
#include "sound.h"
|
||||
|
||||
class TButton
|
||||
{ // animacja dwustanowa, włącza jeden z dwóch submodeli (jednego
|
||||
// z nich może nie być)
|
||||
private:
|
||||
TSubModel *pModelOn, *pModelOff; // submodel dla stanu załączonego i wyłączonego
|
||||
bool bOn;
|
||||
bool *bData;
|
||||
int iFeedbackBit; // Ra: bit informacji zwrotnej, do wyprowadzenia na pulpit
|
||||
TSubModel
|
||||
*pModelOn { nullptr },
|
||||
*pModelOff { nullptr }; // submodel dla stanu załączonego i wyłączonego
|
||||
bool m_state { false };
|
||||
bool const *bData { nullptr };
|
||||
int iFeedbackBit { 0 }; // Ra: bit informacji zwrotnej, do wyprowadzenia na pulpit
|
||||
PSound m_soundfxincrease { nullptr }; // sound associated with increasing control's value
|
||||
PSound m_soundfxdecrease { nullptr }; // sound associated with decreasing control's value
|
||||
// methods
|
||||
// imports member data pair from the config file
|
||||
bool
|
||||
Load_mapping( cParser &Input );
|
||||
// plays the sound associated with current state
|
||||
void
|
||||
play();
|
||||
// plays specified sound
|
||||
void
|
||||
play( PSound Sound );
|
||||
|
||||
public:
|
||||
TButton();
|
||||
~TButton();
|
||||
void Clear(int i = -1);
|
||||
inline void FeedbackBitSet(int i)
|
||||
{
|
||||
iFeedbackBit = 1 << i;
|
||||
};
|
||||
inline void Turn(bool to)
|
||||
{
|
||||
bOn = to;
|
||||
Update();
|
||||
};
|
||||
inline void TurnOn()
|
||||
{
|
||||
bOn = true;
|
||||
Update();
|
||||
};
|
||||
inline void TurnOff()
|
||||
{
|
||||
bOn = false;
|
||||
Update();
|
||||
};
|
||||
inline void Switch()
|
||||
{
|
||||
bOn = !bOn;
|
||||
Update();
|
||||
};
|
||||
inline bool Active()
|
||||
{
|
||||
return (pModelOn) || (pModelOff);
|
||||
};
|
||||
void Clear(int const i = -1);
|
||||
inline void FeedbackBitSet(int const i) {
|
||||
iFeedbackBit = 1 << i; };
|
||||
void Turn( bool const State );
|
||||
inline void TurnOn() {
|
||||
Turn( true ); };
|
||||
inline void TurnOff() {
|
||||
Turn( false ); };
|
||||
inline void Switch() {
|
||||
Turn( !m_state ); };
|
||||
inline bool Active() {
|
||||
return (pModelOn) || (pModelOff); };
|
||||
void Update();
|
||||
void Init(std::string const &asName, TModel3d *pModel, bool bNewOn = false);
|
||||
void Load(cParser &Parser, TModel3d *pModel1, TModel3d *pModel2 = NULL);
|
||||
void AssignBool(bool *bValue);
|
||||
void AssignBool(bool const *bValue);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -200,7 +200,7 @@ TGauge::UpdateValue( double fNewDesired, PSound Fallbacksound ) {
|
||||
else if( ( currentvalue > fNewDesired ) && ( m_soundfxdecrease != nullptr ) ) {
|
||||
play( m_soundfxdecrease );
|
||||
}
|
||||
else {
|
||||
else if( Fallbacksound != nullptr ) {
|
||||
// ...and if that fails too, try the provided fallback sound from legacy system
|
||||
play( Fallbacksound );
|
||||
}
|
||||
|
||||
5
Gauge.h
5
Gauge.h
@@ -43,18 +43,19 @@ class TGauge {
|
||||
PSound m_soundfxdecrease { nullptr }; // sound associated with decreasing control's value
|
||||
std::map<int, PSound> m_soundfxvalues; // sounds associated with specific values
|
||||
// methods
|
||||
// imports member data pair from the config file
|
||||
bool
|
||||
Load_mapping( cParser &Input );
|
||||
// plays specified sound
|
||||
void
|
||||
play( PSound Sound );
|
||||
|
||||
public:
|
||||
TGauge() = default;
|
||||
~TGauge() {}
|
||||
inline
|
||||
void Clear() { *this = TGauge(); }
|
||||
void Init(TSubModel *NewSubModel, TGaugeType eNewTyp, double fNewScale = 1, double fNewOffset = 0, double fNewFriction = 0, double fNewValue = 0);
|
||||
bool Load(cParser &Parser, TModel3d *md1, TModel3d *md2 = nullptr, double mul = 1.0);
|
||||
bool Load_mapping( cParser &Input );
|
||||
void PermIncValue(double fNewDesired);
|
||||
void IncValue(double fNewDesired);
|
||||
void DecValue(double fNewDesired);
|
||||
|
||||
323
Train.cpp
323
Train.cpp
@@ -704,7 +704,7 @@ void TTrain::OnCommand_mucurrentindicatorothersourceactivate( TTrain *Train, com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggNextCurrentButton.UpdateValue( 1.0 );
|
||||
Train->ggNextCurrentButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE ) {
|
||||
//turn off
|
||||
@@ -716,7 +716,7 @@ void TTrain::OnCommand_mucurrentindicatorothersourceactivate( TTrain *Train, com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggNextCurrentButton.UpdateValue( 0.0 );
|
||||
Train->ggNextCurrentButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,13 +820,13 @@ void TTrain::OnCommand_independentbrakebailoff( TTrain *Train, command_data cons
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggReleaserButton.UpdateValue( 1.0 );
|
||||
Train->ggReleaserButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
// release
|
||||
Train->mvOccupied->BrakeReleaser( 0 );
|
||||
// visual feedback
|
||||
Train->ggReleaserButton.UpdateValue( 0.0 );
|
||||
Train->ggReleaserButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ void TTrain::OnCommand_wheelspinbrakeactivate( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggAntiSlipButton.UpdateValue( 1.0 );
|
||||
Train->ggAntiSlipButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
// release
|
||||
@@ -1060,7 +1060,7 @@ void TTrain::OnCommand_sandboxactivate( TTrain *Train, command_data const &Comma
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggSandButton.UpdateValue( 1.0 );
|
||||
Train->ggSandButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE) {
|
||||
// release
|
||||
@@ -1127,19 +1127,22 @@ void TTrain::OnCommand_brakeactingspeedincrease( TTrain *Train, command_data con
|
||||
Train->ggBrakeProfileCtrl.UpdateValue(
|
||||
( ( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
2.0 :
|
||||
Train->mvOccupied->BrakeDelayFlag - 1 ) );
|
||||
Train->mvOccupied->BrakeDelayFlag - 1 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
if( Train->ggBrakeProfileG.SubModel != nullptr ) {
|
||||
Train->ggBrakeProfileG.UpdateValue(
|
||||
Train->mvOccupied->BrakeDelayFlag == bdelay_G ?
|
||||
( Train->mvOccupied->BrakeDelayFlag == bdelay_G ?
|
||||
1.0 :
|
||||
0.0 );
|
||||
0.0 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
if( Train->ggBrakeProfileR.SubModel != nullptr ) {
|
||||
Train->ggBrakeProfileR.UpdateValue(
|
||||
( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
( ( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
1.0 :
|
||||
0.0 );
|
||||
0.0 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1169,19 +1172,22 @@ void TTrain::OnCommand_brakeactingspeeddecrease( TTrain *Train, command_data con
|
||||
Train->ggBrakeProfileCtrl.UpdateValue(
|
||||
( ( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
2.0 :
|
||||
Train->mvOccupied->BrakeDelayFlag - 1 ) );
|
||||
Train->mvOccupied->BrakeDelayFlag - 1 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
if( Train->ggBrakeProfileG.SubModel != nullptr ) {
|
||||
Train->ggBrakeProfileG.UpdateValue(
|
||||
Train->mvOccupied->BrakeDelayFlag == bdelay_G ?
|
||||
( Train->mvOccupied->BrakeDelayFlag == bdelay_G ?
|
||||
1.0 :
|
||||
0.0 );
|
||||
0.0 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
if( Train->ggBrakeProfileR.SubModel != nullptr ) {
|
||||
Train->ggBrakeProfileR.UpdateValue(
|
||||
( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
( ( Train->mvOccupied->BrakeDelayFlag & bdelay_R ) != 0 ?
|
||||
1.0 :
|
||||
0.0 );
|
||||
0.0 ),
|
||||
Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1212,7 +1218,7 @@ void TTrain::OnCommand_mubrakingindicatortoggle( TTrain *Train, command_data con
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggSignallingButton.UpdateValue( 1.0 );
|
||||
Train->ggSignallingButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -1224,7 +1230,7 @@ void TTrain::OnCommand_mubrakingindicatortoggle( TTrain *Train, command_data con
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggSignallingButton.UpdateValue( 0.0 );
|
||||
Train->ggSignallingButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1282,7 +1288,7 @@ void TTrain::OnCommand_alerteracknowledge( TTrain *Train, command_data const &Co
|
||||
}
|
||||
}
|
||||
// visual feedback
|
||||
Train->ggSecurityResetButton.UpdateValue( 1.0 );
|
||||
Train->ggSecurityResetButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggSecurityResetButton.GetValue() < 0.05 ) {
|
||||
@@ -1314,7 +1320,7 @@ void TTrain::OnCommand_batterytoggle( TTrain *Train, command_data const &Command
|
||||
if( Train->mvOccupied->BatterySwitch( true ) ) {
|
||||
// bateria potrzebna np. do zapalenia świateł
|
||||
if( Train->ggBatteryButton.SubModel ) {
|
||||
Train->ggBatteryButton.UpdateValue( 1 );
|
||||
Train->ggBatteryButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// audio feedback
|
||||
@@ -1336,7 +1342,7 @@ void TTrain::OnCommand_batterytoggle( TTrain *Train, command_data const &Command
|
||||
if( Train->mvOccupied->BatterySwitch( false ) ) {
|
||||
// ewentualnie zablokować z FIZ, np. w samochodach się nie odłącza akumulatora
|
||||
if( Train->ggBatteryButton.SubModel ) {
|
||||
Train->ggBatteryButton.UpdateValue( 0 );
|
||||
Train->ggBatteryButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// audio feedback
|
||||
@@ -1367,15 +1373,19 @@ void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantFrontButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantFrontButton.SubModel )
|
||||
Train->ggPantFrontButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// pantograph control can have two-button setup
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 0.0 );
|
||||
if( Train->ggPantFrontButtonOff.SubModel )
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel )
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1399,15 +1409,19 @@ void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantFrontButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantFrontButton.SubModel )
|
||||
Train->ggPantFrontButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// pantograph control can have two-button setup
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 1.0 );
|
||||
if( Train->ggPantFrontButtonOff.SubModel )
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel )
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1420,23 +1434,24 @@ void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
}
|
||||
#endif
|
||||
Train->ggPantFrontButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantFrontButton.SubModel )
|
||||
Train->ggPantFrontButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// also the switch off button, in cabs which have it
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
if( Train->ggPantFrontButtonOff.GetValue() > 0.35 ) {
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
}
|
||||
#endif
|
||||
if( Train->ggPantFrontButtonOff.SubModel ) {
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 0.0 );
|
||||
}
|
||||
if( Train->ggPantFrontButtonOff.SubModel )
|
||||
Train->ggPantFrontButtonOff.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
if( Train->ggPantSelectedDownButton.SubModel ) {
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0 );
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1456,15 +1471,19 @@ void TTrain::OnCommand_pantographtogglerear( TTrain *Train, command_data const &
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantRearButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantRearButton.SubModel )
|
||||
Train->ggPantRearButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// pantograph control can have two-button setup
|
||||
Train->ggPantRearButtonOff.UpdateValue( 0.0 );
|
||||
if( Train->ggPantRearButtonOff.SubModel )
|
||||
Train->ggPantRearButtonOff.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel )
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1488,15 +1507,19 @@ void TTrain::OnCommand_pantographtogglerear( TTrain *Train, command_data const &
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantRearButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantRearButton.SubModel )
|
||||
Train->ggPantRearButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// pantograph control can have two-button setup
|
||||
Train->ggPantRearButtonOff.UpdateValue( 1.0 );
|
||||
if( Train->ggPantRearButtonOff.SubModel )
|
||||
Train->ggPantRearButtonOff.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel )
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1509,23 +1532,24 @@ void TTrain::OnCommand_pantographtogglerear( TTrain *Train, command_data const &
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
}
|
||||
#endif
|
||||
Train->ggPantRearButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantRearButton.SubModel )
|
||||
Train->ggPantRearButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedButton.SubModel )
|
||||
Train->ggPantSelectedButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// also the switch off button, in cabs which have it
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
if( Train->ggPantRearButtonOff.GetValue() > 0.35 ) {
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
}
|
||||
#endif
|
||||
if( Train->ggPantRearButtonOff.SubModel ) {
|
||||
Train->ggPantRearButtonOff.UpdateValue( 0.0 );
|
||||
}
|
||||
if( Train->ggPantRearButtonOff.SubModel )
|
||||
Train->ggPantRearButtonOff.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
if( Train->ggPantSelectedDownButton.SubModel ) {
|
||||
// NOTE: currently we animate the selectable pantograph control based on standard key presses
|
||||
// TODO: implement actual selection control, and refactor handling this control setup in a separate method
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0 );
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1619,9 +1643,10 @@ void TTrain::OnCommand_pantographlowerall( TTrain *Train, command_data const &Co
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantAllDownButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel != nullptr ) {
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0 );
|
||||
if( Train->ggPantAllDownButton.SubModel )
|
||||
Train->ggPantAllDownButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
if( Train->ggPantSelectedDownButton.SubModel ) {
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE ) {
|
||||
@@ -1637,8 +1662,9 @@ void TTrain::OnCommand_pantographlowerall( TTrain *Train, command_data const &Co
|
||||
*/
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggPantAllDownButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel != nullptr ) {
|
||||
if( Train->ggPantAllDownButton.SubModel )
|
||||
Train->ggPantAllDownButton.UpdateValue( 0.0 );
|
||||
if( Train->ggPantSelectedDownButton.SubModel ) {
|
||||
Train->ggPantSelectedDownButton.UpdateValue( 0.0 );
|
||||
}
|
||||
}
|
||||
@@ -1680,7 +1706,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainOnButton.UpdateValue( 1.0 );
|
||||
Train->ggMainOnButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Train->ggMainButton.SubModel != nullptr ) {
|
||||
// single two-state switch
|
||||
@@ -1691,7 +1717,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainButton.UpdateValue( 1.0 );
|
||||
Train->ggMainButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
// keep track of period the button is held down, to determine when/if circuit closes
|
||||
if( ( ( ( Train->mvControlled->EngineType != ElectricSeriesMotor )
|
||||
@@ -1739,7 +1765,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainOffButton.UpdateValue( 1.0 );
|
||||
Train->ggMainOffButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Train->ggMainButton.SubModel != nullptr ) {
|
||||
// single two-state switch
|
||||
@@ -1765,7 +1791,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainButton.UpdateValue( 0.0 );
|
||||
Train->ggMainButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1788,7 +1814,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
// we don't exactly know which of the two buttons was used, so reset both
|
||||
// for setup with two separate swiches
|
||||
if( Train->ggMainOnButton.SubModel != nullptr ) {
|
||||
Train->ggMainOnButton.UpdateValue( 0.0 );
|
||||
Train->ggMainOnButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// audio feedback
|
||||
if( Train->ggMainOnButton.GetValue() > 0.5 ) {
|
||||
@@ -1797,7 +1823,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
#endif
|
||||
}
|
||||
if( Train->ggMainOffButton.SubModel != nullptr ) {
|
||||
Train->ggMainOffButton.UpdateValue( 0.0 );
|
||||
Train->ggMainOffButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
// and the two-state switch too, for good measure
|
||||
if( Train->ggMainButton.SubModel != nullptr ) {
|
||||
@@ -1808,7 +1834,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainButton.UpdateValue( 0.0 );
|
||||
Train->ggMainButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
// finalize the state of the line breaker
|
||||
Train->m_linebreakerstate = 0;
|
||||
@@ -1832,7 +1858,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
// visual feedback
|
||||
if( Train->ggMainOnButton.SubModel != nullptr ) {
|
||||
// setup with two separate switches
|
||||
Train->ggMainOnButton.UpdateValue( 0.0 );
|
||||
Train->ggMainOnButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
// NOTE: we don't have switch type definition for the line breaker switch
|
||||
// so for the time being we have hard coded "impulse" switches for all EMUs
|
||||
@@ -1846,7 +1872,7 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggMainButton.UpdateValue( 0.0 );
|
||||
Train->ggMainButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
// finalize the state of the line breaker
|
||||
@@ -1876,7 +1902,7 @@ void TTrain::OnCommand_convertertoggle( TTrain *Train, command_data const &Comma
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterButton.UpdateValue( 1.0 );
|
||||
Train->ggConverterButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
/*
|
||||
if( ( Train->mvControlled->EnginePowerSource.SourceType != CurrentCollector )
|
||||
|| ( Train->mvControlled->PantRearVolt != 0.0 )
|
||||
@@ -1916,9 +1942,9 @@ void TTrain::OnCommand_convertertoggle( TTrain *Train, command_data const &Comma
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterButton.UpdateValue( 0.0 );
|
||||
Train->ggConverterButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
if( Train->ggConverterOffButton.SubModel != nullptr ) {
|
||||
Train->ggConverterOffButton.UpdateValue( 1.0 );
|
||||
Train->ggConverterOffButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
if( true == Train->mvControlled->ConverterSwitch( false ) ) {
|
||||
// side effects
|
||||
@@ -1950,8 +1976,8 @@ void TTrain::OnCommand_convertertoggle( TTrain *Train, command_data const &Comma
|
||||
Train->play_sound( Train->dsbSwitch );
|
||||
}
|
||||
#endif
|
||||
Train->ggConverterButton.UpdateValue( 0.0 );
|
||||
Train->ggConverterOffButton.UpdateValue( 0.0 );
|
||||
Train->ggConverterButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
Train->ggConverterOffButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1978,7 +2004,7 @@ void TTrain::OnCommand_convertertogglelocal( TTrain *Train, command_data const &
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterLocalButton.UpdateValue( 1.0 );
|
||||
Train->ggConverterLocalButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// effect
|
||||
Train->mvOccupied->ConverterAllowLocal = true;
|
||||
/*
|
||||
@@ -2001,7 +2027,7 @@ void TTrain::OnCommand_convertertogglelocal( TTrain *Train, command_data const &
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterLocalButton.UpdateValue( 0.0 );
|
||||
Train->ggConverterLocalButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// effect
|
||||
Train->mvOccupied->ConverterAllowLocal = false;
|
||||
/*
|
||||
@@ -2046,7 +2072,7 @@ void TTrain::OnCommand_converteroverloadrelayreset( TTrain *Train, command_data
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterFuseButton.UpdateValue( 1.0 );
|
||||
Train->ggConverterFuseButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE ) {
|
||||
// release
|
||||
@@ -2057,7 +2083,7 @@ void TTrain::OnCommand_converteroverloadrelayreset( TTrain *Train, command_data
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggConverterFuseButton.UpdateValue( 0.0 );
|
||||
Train->ggConverterFuseButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2072,7 +2098,7 @@ void TTrain::OnCommand_compressortoggle( TTrain *Train, command_data const &Comm
|
||||
if( false == Train->mvControlled->CompressorAllow ) {
|
||||
// turn on
|
||||
// visual feedback
|
||||
Train->ggCompressorButton.UpdateValue( 1.0 );
|
||||
Train->ggCompressorButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggCompressorButton.GetValue() < 0.5 ) {
|
||||
@@ -2104,7 +2130,7 @@ void TTrain::OnCommand_compressortoggle( TTrain *Train, command_data const &Comm
|
||||
// }
|
||||
// else {
|
||||
// visual feedback
|
||||
Train->ggCompressorButton.UpdateValue( 0.0 );
|
||||
Train->ggCompressorButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -2148,7 +2174,7 @@ void TTrain::OnCommand_compressortogglelocal( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCompressorLocalButton.UpdateValue( 1.0 );
|
||||
Train->ggCompressorLocalButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// effect
|
||||
Train->mvOccupied->CompressorAllowLocal = true;
|
||||
}
|
||||
@@ -2161,7 +2187,7 @@ void TTrain::OnCommand_compressortogglelocal( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCompressorLocalButton.UpdateValue( 0.0 );
|
||||
Train->ggCompressorLocalButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
// effect
|
||||
Train->mvOccupied->CompressorAllowLocal = false;
|
||||
}
|
||||
@@ -2206,7 +2232,7 @@ void TTrain::OnCommand_motorconnectorsopen( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggStLinOffButton.UpdateValue( 1.0 );
|
||||
Train->ggStLinOffButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
// effect
|
||||
if( true == Train->mvControlled->StLinFlag ) {
|
||||
Train->play_sound( Train->dsbRelay );
|
||||
@@ -2255,7 +2281,7 @@ void TTrain::OnCommand_motorconnectorsopen( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggStLinOffButton.UpdateValue( 0.0 );
|
||||
Train->ggStLinOffButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2286,7 +2312,7 @@ void TTrain::OnCommand_motorconnectorsopen( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggStLinOffButton.UpdateValue( 0.0 );
|
||||
Train->ggStLinOffButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2320,7 +2346,7 @@ void TTrain::OnCommand_motoroverloadrelaythresholdtoggle( TTrain *Train, command
|
||||
// turn on
|
||||
if( true == Train->mvControlled->CurrentSwitch( true ) ) {
|
||||
// visual feedback
|
||||
Train->ggMaxCurrentCtrl.UpdateValue( 1.0 );
|
||||
Train->ggMaxCurrentCtrl.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggMaxCurrentCtrl.GetValue() < 0.5 ) {
|
||||
@@ -2333,7 +2359,7 @@ void TTrain::OnCommand_motoroverloadrelaythresholdtoggle( TTrain *Train, command
|
||||
//turn off
|
||||
if( true == Train->mvControlled->CurrentSwitch( false ) ) {
|
||||
// visual feedback
|
||||
Train->ggMaxCurrentCtrl.UpdateValue( 0.0 );
|
||||
Train->ggMaxCurrentCtrl.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggMaxCurrentCtrl.GetValue() > 0.5 ) {
|
||||
@@ -2364,7 +2390,7 @@ void TTrain::OnCommand_motoroverloadrelayreset( TTrain *Train, command_data cons
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggFuseButton.UpdateValue( 1.0 );
|
||||
Train->ggFuseButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE ) {
|
||||
// release
|
||||
@@ -2375,7 +2401,7 @@ void TTrain::OnCommand_motoroverloadrelayreset( TTrain *Train, command_data cons
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggFuseButton.UpdateValue( 0.0 );
|
||||
Train->ggFuseButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2397,7 +2423,7 @@ void TTrain::OnCommand_headlighttoggleleft( TTrain *Train, command_data const &C
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_left;
|
||||
// visual feedback
|
||||
Train->ggLeftLightButton.UpdateValue( 1.0 );
|
||||
Train->ggLeftLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggLeftLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2409,7 +2435,7 @@ void TTrain::OnCommand_headlighttoggleleft( TTrain *Train, command_data const &C
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_left;
|
||||
// visual feedback
|
||||
Train->ggLeftLightButton.UpdateValue( 0.0 );
|
||||
Train->ggLeftLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggLeftLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2438,7 +2464,7 @@ void TTrain::OnCommand_headlighttoggleright( TTrain *Train, command_data const &
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_right;
|
||||
// visual feedback
|
||||
Train->ggRightLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRightLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRightLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2450,7 +2476,7 @@ void TTrain::OnCommand_headlighttoggleright( TTrain *Train, command_data const &
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_right;
|
||||
// visual feedback
|
||||
Train->ggRightLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRightLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRightLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2479,7 +2505,7 @@ void TTrain::OnCommand_headlighttoggleupper( TTrain *Train, command_data const &
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_upper;
|
||||
// visual feedback
|
||||
Train->ggUpperLightButton.UpdateValue( 1.0 );
|
||||
Train->ggUpperLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggUpperLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2491,7 +2517,7 @@ void TTrain::OnCommand_headlighttoggleupper( TTrain *Train, command_data const &
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_upper;
|
||||
// visual feedback
|
||||
Train->ggUpperLightButton.UpdateValue( 0.0 );
|
||||
Train->ggUpperLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggUpperLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2520,7 +2546,7 @@ void TTrain::OnCommand_redmarkertoggleleft( TTrain *Train, command_data const &C
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_left;
|
||||
// visual feedback
|
||||
Train->ggLeftEndLightButton.UpdateValue( 1.0 );
|
||||
Train->ggLeftEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggLeftEndLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2532,7 +2558,7 @@ void TTrain::OnCommand_redmarkertoggleleft( TTrain *Train, command_data const &C
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_left;
|
||||
// visual feedback
|
||||
Train->ggLeftEndLightButton.UpdateValue( 0.0 );
|
||||
Train->ggLeftEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggLeftEndLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2561,7 +2587,7 @@ void TTrain::OnCommand_redmarkertoggleright( TTrain *Train, command_data const &
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_right;
|
||||
// visual feedback
|
||||
Train->ggRightEndLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRightEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRightEndLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2573,7 +2599,7 @@ void TTrain::OnCommand_redmarkertoggleright( TTrain *Train, command_data const &
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_right;
|
||||
// visual feedback
|
||||
Train->ggRightEndLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRightEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRightEndLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2603,7 +2629,7 @@ void TTrain::OnCommand_headlighttogglerearleft( TTrain *Train, command_data cons
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_right;
|
||||
// visual feedback
|
||||
Train->ggRearLeftLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRearLeftLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearLeftLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2615,7 +2641,7 @@ void TTrain::OnCommand_headlighttogglerearleft( TTrain *Train, command_data cons
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_right;
|
||||
// visual feedback
|
||||
Train->ggRearLeftLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRearLeftLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearLeftLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2645,7 +2671,7 @@ void TTrain::OnCommand_headlighttogglerearright( TTrain *Train, command_data con
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_left;
|
||||
// visual feedback
|
||||
Train->ggRearRightLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRearRightLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearRightLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2657,7 +2683,7 @@ void TTrain::OnCommand_headlighttogglerearright( TTrain *Train, command_data con
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_left;
|
||||
// visual feedback
|
||||
Train->ggRearRightLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRearRightLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearRightLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2686,7 +2712,7 @@ void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data con
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_upper;
|
||||
// visual feedback
|
||||
Train->ggRearUpperLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRearUpperLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearUpperLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2698,7 +2724,7 @@ void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data con
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::headlight_upper;
|
||||
// visual feedback
|
||||
Train->ggRearUpperLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRearUpperLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearUpperLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2728,7 +2754,7 @@ void TTrain::OnCommand_redmarkertogglerearleft( TTrain *Train, command_data cons
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_right;
|
||||
// visual feedback
|
||||
Train->ggRearLeftEndLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRearLeftEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearLeftEndLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2740,7 +2766,7 @@ void TTrain::OnCommand_redmarkertogglerearleft( TTrain *Train, command_data cons
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_right;
|
||||
// visual feedback
|
||||
Train->ggRearLeftEndLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRearLeftEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearLeftEndLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2770,7 +2796,7 @@ void TTrain::OnCommand_redmarkertogglerearright( TTrain *Train, command_data con
|
||||
// turn on
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_left;
|
||||
// visual feedback
|
||||
Train->ggRearRightEndLightButton.UpdateValue( 1.0 );
|
||||
Train->ggRearRightEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearRightEndLightButton.GetValue() < 0.5 ) {
|
||||
@@ -2782,7 +2808,7 @@ void TTrain::OnCommand_redmarkertogglerearright( TTrain *Train, command_data con
|
||||
//turn off
|
||||
Train->DynamicObject->iLights[ lightsindex ] ^= TMoverParameters::light::redmarker_left;
|
||||
// visual feedback
|
||||
Train->ggRearRightEndLightButton.UpdateValue( 0.0 );
|
||||
Train->ggRearRightEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggRearRightEndLightButton.GetValue() > 0.5 ) {
|
||||
@@ -2816,7 +2842,7 @@ void TTrain::OnCommand_headlightsdimtoggle( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDimHeadlightsButton.UpdateValue( 1.0 );
|
||||
Train->ggDimHeadlightsButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -2828,7 +2854,7 @@ void TTrain::OnCommand_headlightsdimtoggle( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDimHeadlightsButton.UpdateValue( 0.0 );
|
||||
Train->ggDimHeadlightsButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2857,7 +2883,7 @@ void TTrain::OnCommand_interiorlighttoggle( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCabLightButton.UpdateValue( 1.0 );
|
||||
Train->ggCabLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -2870,7 +2896,7 @@ void TTrain::OnCommand_interiorlighttoggle( TTrain *Train, command_data const &C
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCabLightButton.UpdateValue( 0.0 );
|
||||
Train->ggCabLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2897,7 +2923,7 @@ void TTrain::OnCommand_interiorlightdimtoggle( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCabLightDimButton.UpdateValue( 1.0 );
|
||||
Train->ggCabLightDimButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -2909,7 +2935,7 @@ void TTrain::OnCommand_interiorlightdimtoggle( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggCabLightDimButton.UpdateValue( 0.0 );
|
||||
Train->ggCabLightDimButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2938,7 +2964,7 @@ void TTrain::OnCommand_instrumentlighttoggle( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggInstrumentLightButton.UpdateValue( 1.0 );
|
||||
Train->ggInstrumentLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -2950,7 +2976,7 @@ void TTrain::OnCommand_instrumentlighttoggle( TTrain *Train, command_data const
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggInstrumentLightButton.UpdateValue( 0.0 );
|
||||
Train->ggInstrumentLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2976,7 +3002,7 @@ void TTrain::OnCommand_heatingtoggle( TTrain *Train, command_data const &Command
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggTrainHeatingButton.UpdateValue( 1.0 );
|
||||
Train->ggTrainHeatingButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -2988,7 +3014,7 @@ void TTrain::OnCommand_heatingtoggle( TTrain *Train, command_data const &Command
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggTrainHeatingButton.UpdateValue( 0.0 );
|
||||
Train->ggTrainHeatingButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3016,7 +3042,7 @@ void TTrain::OnCommand_generictoggle( TTrain *Train, command_data const &Command
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
item.UpdateValue( 1.0 );
|
||||
item.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
//turn off
|
||||
@@ -3027,7 +3053,7 @@ void TTrain::OnCommand_generictoggle( TTrain *Train, command_data const &Command
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
item.UpdateValue( 0.0 );
|
||||
item.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3055,7 +3081,7 @@ void TTrain::OnCommand_doorlocktoggle( TTrain *Train, command_data const &Comman
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDoorSignallingButton.UpdateValue( 1.0 );
|
||||
Train->ggDoorSignallingButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
// turn off
|
||||
@@ -3069,7 +3095,7 @@ void TTrain::OnCommand_doorlocktoggle( TTrain *Train, command_data const &Comman
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDoorSignallingButton.UpdateValue( 0.0 );
|
||||
Train->ggDoorSignallingButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3088,7 +3114,7 @@ void TTrain::OnCommand_doortoggleleft( TTrain *Train, command_data const &Comman
|
||||
// open
|
||||
if( Train->mvOccupied->ActiveCab == 1 ) {
|
||||
if( Train->mvOccupied->DoorLeft( true ) ) {
|
||||
Train->ggDoorLeftButton.UpdateValue( 1.0 );
|
||||
Train->ggDoorLeftButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorLeftButton.GetValue() < 0.5 ) {
|
||||
@@ -3101,7 +3127,7 @@ void TTrain::OnCommand_doortoggleleft( TTrain *Train, command_data const &Comman
|
||||
else {
|
||||
// in the rear cab sides are reversed
|
||||
if( Train->mvOccupied->DoorRight( true ) ) {
|
||||
Train->ggDoorRightButton.UpdateValue( 1.0 );
|
||||
Train->ggDoorRightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorRightButton.GetValue() < 0.5 ) {
|
||||
@@ -3116,7 +3142,7 @@ void TTrain::OnCommand_doortoggleleft( TTrain *Train, command_data const &Comman
|
||||
// close
|
||||
if( Train->mvOccupied->ActiveCab == 1 ) {
|
||||
if( Train->mvOccupied->DoorLeft( false ) ) {
|
||||
Train->ggDoorLeftButton.UpdateValue( 0.0 );
|
||||
Train->ggDoorLeftButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorLeftButton.GetValue() > 0.5 ) {
|
||||
@@ -3129,7 +3155,7 @@ void TTrain::OnCommand_doortoggleleft( TTrain *Train, command_data const &Comman
|
||||
else {
|
||||
// in the rear cab sides are reversed
|
||||
if( Train->mvOccupied->DoorRight( false ) ) {
|
||||
Train->ggDoorRightButton.UpdateValue( 0.0 );
|
||||
Train->ggDoorRightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorRightButton.GetValue() > 0.5 ) {
|
||||
@@ -3157,7 +3183,7 @@ void TTrain::OnCommand_doortoggleright( TTrain *Train, command_data const &Comma
|
||||
// open
|
||||
if( Train->mvOccupied->ActiveCab == 1 ) {
|
||||
if( Train->mvOccupied->DoorRight( true ) ) {
|
||||
Train->ggDoorRightButton.UpdateValue( 1.0 );
|
||||
Train->ggDoorRightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorRightButton.GetValue() < 0.5 ) {
|
||||
@@ -3170,7 +3196,7 @@ void TTrain::OnCommand_doortoggleright( TTrain *Train, command_data const &Comma
|
||||
else {
|
||||
// in the rear cab sides are reversed
|
||||
if( Train->mvOccupied->DoorLeft( true ) ) {
|
||||
Train->ggDoorLeftButton.UpdateValue( 1.0 );
|
||||
Train->ggDoorLeftButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorLeftButton.GetValue() < 0.5 ) {
|
||||
@@ -3185,7 +3211,7 @@ void TTrain::OnCommand_doortoggleright( TTrain *Train, command_data const &Comma
|
||||
// close
|
||||
if( Train->mvOccupied->ActiveCab == 1 ) {
|
||||
if( Train->mvOccupied->DoorRight( false ) ) {
|
||||
Train->ggDoorRightButton.UpdateValue( 0.0 );
|
||||
Train->ggDoorRightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorRightButton.GetValue() > 0.5 ) {
|
||||
@@ -3198,7 +3224,7 @@ void TTrain::OnCommand_doortoggleright( TTrain *Train, command_data const &Comma
|
||||
else {
|
||||
// in the rear cab sides are reversed
|
||||
if( Train->mvOccupied->DoorLeft( false ) ) {
|
||||
Train->ggDoorLeftButton.UpdateValue( 0.0 );
|
||||
Train->ggDoorLeftButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
#ifdef EU07_USE_OLD_CONTROLSOUNDS
|
||||
// sound feedback
|
||||
if( Train->ggDoorLeftButton.GetValue() > 0.5 ) {
|
||||
@@ -3233,7 +3259,7 @@ void TTrain::OnCommand_departureannounce( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDepartureSignalButton.UpdateValue( 1.0 );
|
||||
Train->ggDepartureSignalButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
else if( Command.action == GLFW_RELEASE ) {
|
||||
@@ -3246,7 +3272,7 @@ void TTrain::OnCommand_departureannounce( TTrain *Train, command_data const &Com
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggDepartureSignalButton.UpdateValue( 0.0 );
|
||||
Train->ggDepartureSignalButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3378,7 +3404,7 @@ void TTrain::OnCommand_radiotoggle( TTrain *Train, command_data const &Command )
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggRadioButton.UpdateValue( 1.0 );
|
||||
Train->ggRadioButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||
}
|
||||
else {
|
||||
// turn off
|
||||
@@ -3390,7 +3416,7 @@ void TTrain::OnCommand_radiotoggle( TTrain *Train, command_data const &Command )
|
||||
}
|
||||
#endif
|
||||
// visual feedback
|
||||
Train->ggRadioButton.UpdateValue( 0.0 );
|
||||
Train->ggRadioButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5121,13 +5147,18 @@ bool TTrain::Update( double const Deltatime )
|
||||
btLampkaED.TurnOff();
|
||||
}
|
||||
// McZapkie-080602: obroty (albo translacje) regulatorow
|
||||
if (ggMainCtrl.SubModel)
|
||||
{
|
||||
if (mvControlled->CoupledCtrl)
|
||||
if (ggMainCtrl.SubModel) {
|
||||
|
||||
if( mvControlled->CoupledCtrl ) {
|
||||
ggMainCtrl.UpdateValue(
|
||||
double(mvControlled->MainCtrlPos + mvControlled->ScndCtrlPos));
|
||||
else
|
||||
ggMainCtrl.UpdateValue(double(mvControlled->MainCtrlPos));
|
||||
double( mvControlled->MainCtrlPos + mvControlled->ScndCtrlPos ),
|
||||
dsbNastawnikJazdy );
|
||||
}
|
||||
else {
|
||||
ggMainCtrl.UpdateValue(
|
||||
double( mvControlled->MainCtrlPos ),
|
||||
dsbNastawnikJazdy );
|
||||
}
|
||||
ggMainCtrl.Update();
|
||||
}
|
||||
if (ggMainCtrlAct.SubModel)
|
||||
@@ -5139,21 +5170,23 @@ bool TTrain::Update( double const Deltatime )
|
||||
ggMainCtrlAct.UpdateValue(double(mvControlled->MainCtrlActualPos));
|
||||
ggMainCtrlAct.Update();
|
||||
}
|
||||
if (ggScndCtrl.SubModel)
|
||||
{ // Ra: od byte odejmowane boolean i konwertowane
|
||||
// potem na double?
|
||||
if (ggScndCtrl.SubModel) {
|
||||
// Ra: od byte odejmowane boolean i konwertowane potem na double?
|
||||
ggScndCtrl.UpdateValue(
|
||||
double(mvControlled->ScndCtrlPos -
|
||||
((mvControlled->TrainType == dt_ET42) && mvControlled->DynamicBrakeFlag)));
|
||||
double( mvControlled->ScndCtrlPos
|
||||
- ( ( mvControlled->TrainType == dt_ET42 ) && mvControlled->DynamicBrakeFlag ) ),
|
||||
dsbNastawnikBocz );
|
||||
ggScndCtrl.Update();
|
||||
}
|
||||
if (ggDirKey.SubModel)
|
||||
{
|
||||
if (ggDirKey.SubModel) {
|
||||
if (mvControlled->TrainType != dt_EZT)
|
||||
ggDirKey.UpdateValue(double(mvControlled->ActiveDir));
|
||||
ggDirKey.UpdateValue(
|
||||
double(mvControlled->ActiveDir),
|
||||
dsbReverserKey);
|
||||
else
|
||||
ggDirKey.UpdateValue(double(mvControlled->ActiveDir) +
|
||||
double(mvControlled->Imin == mvControlled->IminHi));
|
||||
ggDirKey.UpdateValue(
|
||||
double(mvControlled->ActiveDir) + double(mvControlled->Imin == mvControlled->IminHi),
|
||||
dsbReverserKey);
|
||||
ggDirKey.Update();
|
||||
}
|
||||
if (ggBrakeCtrl.SubModel)
|
||||
|
||||
@@ -346,12 +346,12 @@ opengl_renderer::Render_camera() {
|
||||
break;
|
||||
}
|
||||
case rendermode::shadows: {
|
||||
m_renderpass.camera.position() = Global::pCameraPosition - glm::dvec3{ Global::DayLight.direction * 750.0f };
|
||||
m_renderpass.camera.position() = Global::pCameraPosition - glm::dvec3{ Global::DayLight.direction * 750.f };
|
||||
m_renderpass.camera.position().y = std::max( 50.0, m_renderpass.camera.position().y ); // prevent shadow source from dipping too low
|
||||
viewmatrix = glm::lookAt(
|
||||
m_renderpass.camera.position(),
|
||||
glm::dvec3{ Global::pCameraPosition.x, 0.0, Global::pCameraPosition.z },
|
||||
glm::dvec3{ 0.0f, 1.0f, 0.0f } );
|
||||
glm::dvec3{ 0.f, 1.f, 0.f } );
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user