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

Improve pantograph selector

- A new parameter has been added to .fiz file format, in the Switches: section:
  - PantographPresetDefault [0] - The 0-based index of a pantograph preset that should be chosen upon the vehicle creation. 0 by default mimicks the current behavior.

- Fixed the selected pantograph configuration not being respected until the configuration has been changed.
This commit is contained in:
jakubg1
2024-03-13 03:25:19 +01:00
parent c9ccdda806
commit 13d9a91632
4 changed files with 11 additions and 1 deletions

View File

@@ -211,12 +211,14 @@ class TTrain {
void update_sounds( double const Deltatime );
void update_sounds_runningnoise( sound_source &Sound );
void update_sounds_radio();
// Translates the given cab to an end ID: cab `1` and engine compartment (`0`) translate to `end::front`, cab `2` translates to `end::rear`
inline
end cab_to_end( int const End ) const {
return (
End == 2 ?
end::rear :
end::front ); }
// Translates the currently occupied cab to an end ID: cab `1` and engine compartment (`0`) translate to `end::front`, cab `2` translates to `end::rear`
inline
end cab_to_end() const {
return cab_to_end( iCabn ); }
@@ -815,7 +817,7 @@ public: // reszta może by?publiczna
*/
// McZapkie: opis kabiny - obszar poruszania sie mechanika oraz zajetosc
std::array<TCab, 3> Cabine; // przedzial maszynowy, kabina 1 (A), kabina 2 (B)
int iCabn { 0 }; // 0: mid, 1: front, 2: rear
int iCabn { 0 }; // the cab number the player is currently inside of; 0: mid, 1: front, 2: rear
bool is_cab_initialized { false };
// McZapkie: do poruszania sie po kabinie
Math3D::vector3 pMechSittingPosition; // ABu 180404