mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 08:49:18 +02:00
glfw integration
This commit is contained in:
132
Train.cpp
132
Train.cpp
@@ -394,7 +394,7 @@ void TTrain::OnKeyDown(int cKey)
|
||||
// isEztOer=(mvControlled->TrainType==dt_EZT)&&(mvControlled->Mains)&&(mvOccupied->BrakeSubsystem==ss_ESt)&&(mvControlled->ActiveDir!=0);
|
||||
// isEztOer=((mvControlled->TrainType==dt_EZT)&&(mvControlled->Battery==true)&&(mvControlled->EpFuse==true)&&(mvOccupied->BrakeSubsystem==Oerlikon)&&(mvControlled->ActiveDir!=0));
|
||||
|
||||
if (GetAsyncKeyState(VK_SHIFT) < 0)
|
||||
if (Global::shiftState)
|
||||
{ // wciśnięty [Shift]
|
||||
if (cKey == Global::Keys[k_IncMainCtrlFAST]) // McZapkie-200702: szybkie
|
||||
// przelaczanie na poz.
|
||||
@@ -409,7 +409,7 @@ void TTrain::OnKeyDown(int cKey)
|
||||
else if (cKey == Global::Keys[k_DirectionBackward])
|
||||
{
|
||||
if (mvOccupied->Radio == false)
|
||||
if (GetAsyncKeyState(VK_CONTROL) >= 0)
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||
dsbSwitch->Play(0, 0, 0);
|
||||
@@ -561,7 +561,7 @@ void TTrain::OnKeyDown(int cKey)
|
||||
int CouplNr = -2;
|
||||
if (!FreeFlyModeFlag)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if (Global::ctrlState)
|
||||
if (mvOccupied->BrakeDelaySwitch(bdelay_R + bdelay_M))
|
||||
{
|
||||
dsbPneumaticRelay->SetVolume(DSBVOLUME_MAX);
|
||||
@@ -588,7 +588,7 @@ void TTrain::OnKeyDown(int cKey)
|
||||
}
|
||||
if (temp)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if (Global::ctrlState)
|
||||
if (temp->MoverParameters->BrakeDelaySwitch(bdelay_R + bdelay_M))
|
||||
{
|
||||
dsbPneumaticRelay->SetVolume(DSBVOLUME_MAX);
|
||||
@@ -658,7 +658,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
{ // Ra: dźwięk, gdy razem z [Shift]
|
||||
if ((mvControlled->TrainType & dt_EZT) ? mvControlled == mvOccupied :
|
||||
!mvOccupied->ActiveCab) // tylko w maszynowym
|
||||
if (Console::Pressed(VK_CONTROL)) // z [Ctrl]
|
||||
if (Global::ctrlState) // z [Ctrl]
|
||||
mvControlled->bPantKurek3 = true; // zbiornik pantografu połączony
|
||||
// jest ze zbiornikiem głównym
|
||||
// (pompowanie nie ma sensu)
|
||||
@@ -671,7 +671,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
dsbSwitch->Play(0, 0, 0); // dźwięk tylko po naciśnięciu klawisza
|
||||
}
|
||||
}
|
||||
else if (cKey == VkKeyScan('q')) // ze Shiftem - włączenie AI
|
||||
else if (cKey == GLFW_KEY_Q) // ze Shiftem - włączenie AI
|
||||
{ // McZapkie-240302 - wlaczanie automatycznego pilota (zadziala tylko w
|
||||
// trybie debugmode)
|
||||
if (DynamicObject->Mechanik)
|
||||
@@ -760,7 +760,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
// przyciemnienia pod Univ4)
|
||||
else if (cKey == Global::Keys[k_Univ3])
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
if (bCabLight == false) //(ggCabLightButton.GetValue()==0)
|
||||
{
|
||||
@@ -788,7 +788,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
// hunter-091012: dzwiek dla przyciemnienia swiatelka w kabinie
|
||||
else if (cKey == Global::Keys[k_Univ4])
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
if (bCabLightDim == false) //(ggCabLightDimButton.GetValue()==0)
|
||||
{
|
||||
@@ -891,7 +891,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
{
|
||||
if (false == (mvOccupied->LightsPosNo > 0))
|
||||
{
|
||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
if ((Global::ctrlState) &&
|
||||
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu.
|
||||
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||
@@ -1011,7 +1011,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
SetLights();
|
||||
}
|
||||
}
|
||||
else if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
else if ((Global::ctrlState) &&
|
||||
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
||||
{
|
||||
//------------------------------
|
||||
@@ -1066,7 +1066,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
{
|
||||
if (false == (mvOccupied->LightsPosNo > 0))
|
||||
{
|
||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
if ((Global::ctrlState) &&
|
||||
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
||||
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||
@@ -1238,7 +1238,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
// World.cpp
|
||||
if (!FreeFlyModeFlag)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if (Global::ctrlState)
|
||||
if ((mvOccupied->LocalBrake == ManualBrake) || (mvOccupied->MBrake == true))
|
||||
{
|
||||
mvOccupied->IncManualBrakeLevel(1);
|
||||
@@ -1256,7 +1256,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
// World.cpp
|
||||
if (!FreeFlyModeFlag)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if (Global::ctrlState)
|
||||
if ((mvOccupied->LocalBrake == ManualBrake) || (mvOccupied->MBrake == true))
|
||||
mvOccupied->DecManualBrakeLevel(1);
|
||||
else
|
||||
@@ -1350,7 +1350,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
// mvOccupied->IncBrakeLevel());
|
||||
mvOccupied->BrakeLevelSet(mvOccupied->BrakeCtrlPosNo / 2 +
|
||||
(mvOccupied->BrakeHandle == FV4a ? 1 : 0));
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if (Global::ctrlState)
|
||||
mvOccupied->BrakeLevelSet(
|
||||
mvOccupied->Handle->GetPos(bh_NP)); // yB: czy ten stos funkcji nie
|
||||
// powinien być jako oddzielna
|
||||
@@ -1369,7 +1369,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
}
|
||||
else if (cKey == Global::Keys[k_Brake0])
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
mvOccupied->BrakeCtrlPos2 = 0; // wyrownaj kapturek
|
||||
}
|
||||
@@ -1431,7 +1431,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
else if (cKey == Global::Keys[k_Fuse])
|
||||
//---------------
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0) // z controlem
|
||||
if( Global::ctrlState ) // z controlem
|
||||
{
|
||||
ggConverterFuseButton.PutValue(1); // hunter-261211
|
||||
if ((mvControlled->Mains == false) && (ggConverterButton.GetValue() == 0) &&
|
||||
@@ -1472,7 +1472,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
}
|
||||
else if (cKey == Global::Keys[k_DirectionBackward]) // r
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if( Global::ctrlState )
|
||||
{ // wciśnięty [Ctrl]
|
||||
if (mvOccupied->Radio == true)
|
||||
{
|
||||
@@ -1554,7 +1554,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
int CouplNr = -2;
|
||||
if (!FreeFlyModeFlag)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if( Global::ctrlState )
|
||||
if (mvOccupied->BrakeDelaySwitch(bdelay_R))
|
||||
{
|
||||
dsbPneumaticRelay->SetVolume(DSBVOLUME_MAX);
|
||||
@@ -1581,7 +1581,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
}
|
||||
if (temp)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||
if( Global::ctrlState )
|
||||
if (temp->MoverParameters->BrakeDelaySwitch(bdelay_R))
|
||||
{
|
||||
dsbPneumaticRelay->SetVolume(DSBVOLUME_MAX);
|
||||
@@ -1646,7 +1646,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
{ // Ra: bez [Shift] też dać dźwięk
|
||||
if ((mvControlled->TrainType & dt_EZT) ? mvControlled == mvOccupied :
|
||||
!mvOccupied->ActiveCab) // tylko w maszynowym
|
||||
if (Console::Pressed(VK_CONTROL)) // z [Ctrl]
|
||||
if (Global::ctrlState) // z [Ctrl]
|
||||
mvControlled->bPantKurek3 =
|
||||
false; // zbiornik pantografu połączony jest z małą sprężarką
|
||||
// (pompowanie ma sens, ale potem trzeba przełączyć)
|
||||
@@ -1661,7 +1661,7 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
||||
}
|
||||
// McZapkie-240302 - wylaczanie automatycznego pilota (w trybie ~debugmode
|
||||
// mozna tylko raz)
|
||||
else if (cKey == VkKeyScan('q')) // bez Shift
|
||||
else if (cKey == GLFW_KEY_Q) // bez Shift
|
||||
{
|
||||
if (DynamicObject->Mechanik)
|
||||
DynamicObject->Mechanik->TakeControl(false);
|
||||
@@ -1983,7 +1983,7 @@ if
|
||||
// przyciemnienia pod Univ4)
|
||||
else if (cKey == Global::Keys[k_Univ3])
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
if (bCabLight == true) //(ggCabLightButton.GetValue()!=0)
|
||||
{
|
||||
@@ -2010,7 +2010,7 @@ if
|
||||
// hunter-091012: dzwiek dla przyciemnienia swiatelka w kabinie
|
||||
else if (cKey == Global::Keys[k_Univ4])
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
if (bCabLightDim == true) //(ggCabLightDimButton.GetValue()!=0)
|
||||
{
|
||||
@@ -2091,7 +2091,7 @@ if
|
||||
{
|
||||
if (false == (mvOccupied->LightsPosNo > 0))
|
||||
{
|
||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
if( ( Global::ctrlState ) &&
|
||||
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||
@@ -2204,7 +2204,7 @@ if
|
||||
SetLights();
|
||||
}
|
||||
}
|
||||
else if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
else if( ( Global::ctrlState ) &&
|
||||
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||
{
|
||||
//------------------------------
|
||||
@@ -2258,7 +2258,7 @@ if
|
||||
{
|
||||
if (false == (mvOccupied->LightsPosNo > 0))
|
||||
{
|
||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||
if( ( Global::ctrlState ) &&
|
||||
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||
@@ -2384,7 +2384,7 @@ if
|
||||
{
|
||||
// McZapkie: poruszanie sie po kabinie, w updatemechpos zawarte sa wiezy
|
||||
|
||||
auto step = 60.0f * Timer::GetDeltaTime();
|
||||
auto step = 1.5f;
|
||||
auto const camerayaw = Global::pCamera->Yaw;
|
||||
Math3D::vector3 direction( 0.0f, 0.0f, step );
|
||||
direction.RotateY( camerayaw );
|
||||
@@ -2398,7 +2398,7 @@ if
|
||||
right *= -1.0f;
|
||||
}
|
||||
// if (!GetAsyncKeyState(VK_SHIFT)<0) // bez shifta
|
||||
if (!Console::Pressed(VK_CONTROL)) // gdy [Ctrl] zwolniony (dodatkowe widoki)
|
||||
if( !Global::ctrlState ) // gdy [Ctrl] zwolniony (dodatkowe widoki)
|
||||
{
|
||||
if (cKey == Global::Keys[k_MechLeft])
|
||||
{
|
||||
@@ -2443,7 +2443,7 @@ if
|
||||
if (DebugModeFlag)
|
||||
{ // przesuwanie składu o 100m
|
||||
TDynamicObject *d = DynamicObject;
|
||||
if (cKey == VkKeyScan('['))
|
||||
if (cKey == GLFW_KEY_LEFT_BRACKET)
|
||||
{
|
||||
while (d)
|
||||
{
|
||||
@@ -2457,7 +2457,7 @@ if
|
||||
d = d->Prev(); // w drugą stronę też
|
||||
}
|
||||
}
|
||||
else if (cKey == VkKeyScan(']'))
|
||||
else if (cKey == GLFW_KEY_RIGHT_BRACKET)
|
||||
{
|
||||
while (d)
|
||||
{
|
||||
@@ -2472,12 +2472,12 @@ if
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cKey == VkKeyScan('-'))
|
||||
if (cKey == GLFW_KEY_MINUS)
|
||||
{ // zmniejszenie numeru kanału radiowego
|
||||
if (iRadioChannel > 0)
|
||||
--iRadioChannel; // 0=wyłączony
|
||||
}
|
||||
else if (cKey == VkKeyScan('='))
|
||||
else if (cKey == GLFW_KEY_EQUAL)
|
||||
{ // zmniejszenie numeru kanału radiowego
|
||||
if (iRadioChannel < 8)
|
||||
++iRadioChannel; // 0=wyłączony
|
||||
@@ -2487,7 +2487,7 @@ if
|
||||
|
||||
void TTrain::OnKeyUp(int cKey)
|
||||
{ // zwolnienie klawisza
|
||||
if (GetAsyncKeyState(VK_SHIFT) < 0)
|
||||
if (Global::shiftState)
|
||||
{ // wciśnięty [Shift]
|
||||
}
|
||||
else
|
||||
@@ -2548,6 +2548,7 @@ void TTrain::UpdateMechPosition(double dt)
|
||||
// shake *= 1.25;
|
||||
}
|
||||
vMechVelocity -= (shake + vMechVelocity * 100) * (fMechSpringX + fMechSpringY + fMechSpringZ) / (200);
|
||||
// vMechVelocity -= vMechVelocity * iVel * dt;
|
||||
// shake *= 0.95 * dt; // shake damping
|
||||
|
||||
// McZapkie:
|
||||
@@ -2558,15 +2559,15 @@ void TTrain::UpdateMechPosition(double dt)
|
||||
vMechVelocity.y = -vMechVelocity.y;
|
||||
// ABu011104: 5*pMechShake.y, zeby ladnie pudlem rzucalo :)
|
||||
pNewMechPosition = pMechOffset + vector3(1.5 * pMechShake.x, 2.0 * pMechShake.y, 1.5 * pMechShake.z);
|
||||
vMechMovement = 0.5 * vMechMovement;
|
||||
// vMechMovement = 0.5 * vMechMovement;
|
||||
}
|
||||
else
|
||||
{ // hamowanie rzucania przy spadku FPS
|
||||
pMechShake -= pMechShake * std::min(dt, 1.0); // po tym chyba potrafią zostać jakieś ułamki, które powodują zjazd
|
||||
pMechOffset += vMechMovement * dt;
|
||||
vMechVelocity.y = 0.5 * vMechVelocity.y;
|
||||
vMechVelocity.y -= vMechVelocity.y * 50.0 * dt;
|
||||
pNewMechPosition = pMechOffset + vector3(pMechShake.x, 5 * pMechShake.y, pMechShake.z);
|
||||
vMechMovement = 0.5 * vMechMovement;
|
||||
// vMechMovement = 0.5 * vMechMovement;
|
||||
}
|
||||
// numer kabiny (-1: kabina B)
|
||||
if (DynamicObject->Mechanik) // może nie być?
|
||||
@@ -2613,6 +2614,13 @@ void TTrain::UpdateMechPosition(double dt)
|
||||
pMechPosition = DynamicObject->mMatrix *
|
||||
pNewMechPosition; // położenie względem środka pojazdu w układzie scenerii
|
||||
pMechPosition += DynamicObject->GetPosition();
|
||||
|
||||
// framerate-independent speed reduction that doesn't break at high framerates...
|
||||
vMechMovement -= vMechMovement * 50.0 * dt;
|
||||
if( vMechMovement.LengthSquared() < 0.01 ) {
|
||||
vMechMovement = Math3D::vector3();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
bool TTrain::Update( double const Deltatime )
|
||||
@@ -4195,7 +4203,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
if (Console::Pressed(Global::Keys[k_Horn]))
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if (Global::shiftState)
|
||||
{
|
||||
SetFlag(mvOccupied->WarningSignal, 2);
|
||||
mvOccupied->WarningSignal &= (255 - 1);
|
||||
@@ -4226,7 +4234,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
//----------------
|
||||
// hunter-141211: wyl. szybki zalaczony i wylaczony przeniesiony z
|
||||
// OnKeyPress()
|
||||
if (Console::Pressed(VK_SHIFT) && Console::Pressed(Global::Keys[k_Main]))
|
||||
if (Global::shiftState && Console::Pressed(Global::Keys[k_Main]))
|
||||
{
|
||||
fMainRelayTimer += dt;
|
||||
ggMainOnButton.PutValue(1);
|
||||
@@ -4260,7 +4268,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
}
|
||||
//---
|
||||
|
||||
if (!Console::Pressed(VK_SHIFT) && Console::Pressed(Global::Keys[k_Main]))
|
||||
if (!Global::shiftState && Console::Pressed(Global::Keys[k_Main]))
|
||||
{
|
||||
ggMainOffButton.PutValue(1);
|
||||
if (mvControlled->MainSwitch(false))
|
||||
@@ -4399,7 +4407,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
ggAntiSlipButton.UpdateValue(0);
|
||||
//-----------------
|
||||
// hunter-261211: przetwornica i sprezarka
|
||||
if (Console::Pressed(VK_SHIFT) &&
|
||||
if (Global::shiftState &&
|
||||
Console::Pressed(Global::Keys[k_Converter])) // NBMX 14-09-2003: przetwornica wl
|
||||
{ //(mvControlled->CompressorPower<2)
|
||||
ggConverterButton.PutValue(1);
|
||||
@@ -4425,14 +4433,14 @@ bool TTrain::Update( double const Deltatime )
|
||||
// if (
|
||||
// Console::Pressed(VK_SHIFT)&&Console::Pressed(Global::Keys[k_Compressor])&&((mvControlled->EngineType==ElectricSeriesMotor)||(mvControlled->TrainType==dt_EZT))
|
||||
// ) //NBMX 14-09-2003: sprezarka wl
|
||||
if (Console::Pressed(VK_SHIFT) && Console::Pressed(Global::Keys[k_Compressor]) &&
|
||||
if (Global::shiftState && Console::Pressed(Global::Keys[k_Compressor]) &&
|
||||
(mvControlled->CompressorPower < 2)) // hunter-091012: tak jest poprawnie
|
||||
{ // hunter-110212: poprawka dla EZT
|
||||
ggCompressorButton.PutValue(1);
|
||||
mvControlled->CompressorSwitch(true);
|
||||
}
|
||||
|
||||
if (!Console::Pressed(VK_SHIFT) &&
|
||||
if (!Global::shiftState &&
|
||||
Console::Pressed(Global::Keys[k_Converter])) // NBMX 14-09-2003: przetwornica wl
|
||||
{
|
||||
ggConverterButton.PutValue(0);
|
||||
@@ -4445,7 +4453,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
// if (
|
||||
// !Console::Pressed(VK_SHIFT)&&Console::Pressed(Global::Keys[k_Compressor])&&((mvControlled->EngineType==ElectricSeriesMotor)||(mvControlled->TrainType==dt_EZT))
|
||||
// ) //NBMX 14-09-2003: sprezarka wl
|
||||
if (!Console::Pressed(VK_SHIFT) && Console::Pressed(Global::Keys[k_Compressor]) &&
|
||||
if (!Global::shiftState && Console::Pressed(Global::Keys[k_Compressor]) &&
|
||||
(mvControlled->CompressorPower < 2)) // hunter-091012: tak jest poprawnie
|
||||
{ // hunter-110212: poprawka dla EZT
|
||||
ggCompressorButton.PutValue(0);
|
||||
@@ -4504,7 +4512,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
if (!DebugModeFlag)
|
||||
{
|
||||
if (ggUniversal1Button.SubModel)
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if( Global::shiftState )
|
||||
ggUniversal1Button.IncValue(dt / 2);
|
||||
else
|
||||
ggUniversal1Button.DecValue(dt / 2);
|
||||
@@ -4520,7 +4528,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
if (!DebugModeFlag)
|
||||
{
|
||||
if (ggUniversal2Button.SubModel)
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if( Global::shiftState )
|
||||
ggUniversal2Button.IncValue(dt / 2);
|
||||
else
|
||||
ggUniversal2Button.DecValue(dt / 2);
|
||||
@@ -4530,9 +4538,9 @@ bool TTrain::Update( double const Deltatime )
|
||||
// hunter-091012: zrobione z uwzglednieniem przelacznika swiatla
|
||||
if (Console::Pressed(Global::Keys[k_Univ3]))
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if( Global::shiftState )
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
bCabLight = true;
|
||||
if (ggCabLightButton.SubModel)
|
||||
@@ -4555,7 +4563,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
bCabLight = false;
|
||||
if (ggCabLightButton.SubModel)
|
||||
@@ -4659,9 +4667,9 @@ bool TTrain::Update( double const Deltatime )
|
||||
// swiatla
|
||||
if (Console::Pressed(Global::Keys[k_Univ4]))
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if( Global::shiftState )
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
bCabLightDim = true;
|
||||
if (ggCabLightDimButton.SubModel)
|
||||
@@ -4677,7 +4685,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
bCabLightDim = false;
|
||||
if (ggCabLightDimButton.SubModel)
|
||||
@@ -4717,7 +4725,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
// ((mvOccupied->BrakeHandle==FV4a)&&(Console::Pressed(Global::Keys[k_IncBrakeLevel])))
|
||||
if ((Console::Pressed(Global::Keys[k_IncBrakeLevel])))
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
// mvOccupied->BrakeCtrlPos2-=dt/20.0;
|
||||
// if (mvOccupied->BrakeCtrlPos2<-1.5) mvOccupied->BrakeCtrlPos2=-1.5;
|
||||
@@ -4732,7 +4740,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
// ((mvOccupied->BrakeHandle==FV4a)&&(Console::Pressed(Global::Keys[k_DecBrakeLevel])))
|
||||
if ((Console::Pressed(Global::Keys[k_DecBrakeLevel])))
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
// mvOccupied->BrakeCtrlPos2+=(mvOccupied->BrakeCtrlPos2>2?0:dt/20.0);
|
||||
// if (mvOccupied->BrakeCtrlPos2<-3) mvOccupied->BrakeCtrlPos2=-3;
|
||||
@@ -4748,7 +4756,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
if ((mvOccupied->BrakeHandle == FV4a) && (Console::Pressed(Global::Keys[k_IncBrakeLevel])))
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
mvOccupied->BrakeCtrlPos2 -= dt / 20.0;
|
||||
if (mvOccupied->BrakeCtrlPos2 < -1.5)
|
||||
@@ -4765,7 +4773,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
if ((mvOccupied->BrakeHandle == FV4a) && (Console::Pressed(Global::Keys[k_DecBrakeLevel])))
|
||||
{
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if( Global::ctrlState )
|
||||
{
|
||||
mvOccupied->BrakeCtrlPos2 += (mvOccupied->BrakeCtrlPos2 > 2 ? 0 : dt / 20.0);
|
||||
if (mvOccupied->BrakeCtrlPos2 < -3)
|
||||
@@ -4818,7 +4826,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
if (Console::Pressed(Global::Keys[k_Main])) //[]
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if (Global::shiftState)
|
||||
ggMainButton.PutValue(1);
|
||||
else
|
||||
ggMainButton.PutValue(0);
|
||||
@@ -4843,7 +4851,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if (Global::shiftState)
|
||||
{
|
||||
// if (Console::Pressed(k_CurrentNext))
|
||||
{ // Ra: było pod VK_F3
|
||||
@@ -4858,7 +4866,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
{
|
||||
// if (Console::Pressed(k_CurrentNext))
|
||||
{ // Ra: było pod VK_F3
|
||||
if (Console::Pressed(VK_CONTROL))
|
||||
if (Global::ctrlState)
|
||||
{
|
||||
if ((mvOccupied->EpFuseSwitch(false)))
|
||||
{
|
||||
@@ -4887,7 +4895,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
// Winger 010304 PantAllDownButton
|
||||
if (Console::Pressed(Global::Keys[k_PantFrontUp]))
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if (Global::shiftState)
|
||||
ggPantFrontButton.PutValue(1);
|
||||
else
|
||||
ggPantAllDownButton.PutValue(1);
|
||||
@@ -4900,7 +4908,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
if (Console::Pressed(Global::Keys[k_PantRearUp]))
|
||||
{
|
||||
if (Console::Pressed(VK_SHIFT))
|
||||
if( Global::shiftState )
|
||||
ggPantRearButton.PutValue(1);
|
||||
else
|
||||
ggPantFrontButtonOff.PutValue(1);
|
||||
@@ -5041,10 +5049,10 @@ bool TTrain::Update( double const Deltatime )
|
||||
//światło wewnętrzne przygaszone (255 216 176)
|
||||
if( mvOccupied->ConverterFlag == true ) {
|
||||
// jasnosc dla zalaczonej przetwornicy
|
||||
DynamicObject->InteriorLightLevel = 0.75f;
|
||||
DynamicObject->InteriorLightLevel = 0.4f;
|
||||
}
|
||||
else {
|
||||
DynamicObject->InteriorLightLevel = 0.375f;
|
||||
DynamicObject->InteriorLightLevel = 0.2f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user