18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 01:34:59 +01:00

feat: keep the vehicle odometers between the sessions (#72)

Every vehicle gets an odometer (TMoverParameters::Odometer) counting along
with the per-session DistCounter, starting from its state saved in
eu07_odometers.txt in the user's settings directory, else from the file a
python screen kept it in (kilometry/<name>_przebieg.txt), else from a state
made up from the vehicle name. The store is saved every minute of
simulation time and on closing.

The cab's distcounter: gauge shows the odometer; its .mmd offset seeds a
vehicle with no known state. Python screens get it as
state["odometer_total"]; state["odometer"] stays the session distance the
logbook and mirror scripts count differences of.
This commit is contained in:
jerrrrycho
2026-11-07 22:08:42 +01:00
parent 68fdf1efdf
commit 6dc42e976f
11 changed files with 568 additions and 2 deletions

View File

@@ -55,6 +55,13 @@ public:
void AssignBool(bool *bValue);
void UpdateValue();
void AssignState( bool const *State );
// the value shown is value * scale + offset
float offset() const {
return m_offset; }
void offset( float const Offset ) {
m_offset = Offset; }
float scale() const {
return m_scale; }
// returns offset of submodel associated with the button from the model centre
glm::vec3 model_offset() const;
TGaugeType type() const;