17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 10:50:28 +01:00

First implementation of graph vehicles

This commit is contained in:
2026-10-14 12:20:49 +02:00
parent 70abf879b3
commit 1ef465264c
121 changed files with 12292 additions and 729 deletions

View File

@@ -186,6 +186,12 @@ TGauge &TCab::Gauge(int n)
}
};
void TCab::ClearControls()
{
ggList.clear();
btList.clear();
}
TButton &TCab::Button(int n)
{ // pobranie adresu obiektu animowanego wyborem 1 z 2
/*
@@ -919,6 +925,11 @@ std::shared_ptr<dictionary_source> TTrain::GetTrainState(dictionary_source const
dict->insert("air_temperature", Global.AirTemperature);
dict->insert("light_level", Global.fLuminance - std::max(0.f, Global.Overcast - 1.f));
if (mvOccupied->Graph)
{
export_graph_values(*dict);
}
return dict;
}
@@ -8532,6 +8543,11 @@ bool TTrain::Update(double const Deltatime)
while (simulation::Commands.pop(commanddata, static_cast<std::size_t>(command_target::vehicle) | id()))
{
if (mvOccupied->Graph && graph_command(commanddata))
{
// the command operated a control of the vehicle graph
continue;
}
auto lookup = m_commandhandlers.find(commanddata.command);
if (lookup != m_commandhandlers.end())
{
@@ -8899,7 +8915,8 @@ bool TTrain::Update(double const Deltatime)
ggClockHInd.Update();
}
Cabine[iCabn].Update(lowvoltagepower); // nowy sposób ustawienia animacji
// lamps of a graph vehicle are powered as its graph says
Cabine[iCabn].Update(mvOccupied->Graph ? true : lowvoltagepower); // nowy sposób ustawienia animacji
/*
if (ggZbS.SubModel)
{
@@ -10387,8 +10404,9 @@ bool TTrain::LoadMMediaFile(std::string const &asFileName)
parser >> token;
auto lookup{internalsounds.find(token)};
if (lookup == internalsounds.end())
if (lookup == internalsounds.end() || mvOccupied->Graph)
{
// sounds of a graph vehicle are defined by its graph
continue;
}
@@ -10782,6 +10800,13 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
}
}
if (mvOccupied->Graph)
{
// controls and indicators of a graph vehicle come from its graph; before the model of the cab is initialised,
// so the animated submodels are known
initialize_graph_controls(cabindex);
}
if (DynamicObject->mdKabina)
DynamicObject->mdKabina->Init(); // obrócenie modelu oraz optymalizacja, również zapisanie binarnego