diff --git a/DynObj.cpp b/DynObj.cpp index 6f2f3eaf..4057086d 100644 --- a/DynObj.cpp +++ b/DynObj.cpp @@ -5769,23 +5769,28 @@ TDynamicObject::LoadMMediaFile_mdload( std::string const &Name ) const { TModel3d *loadmodel { nullptr }; // check if we don't have model override for this load type - auto const lookup { LoadModelOverrides.find( Name ) }; - if( lookup != LoadModelOverrides.end() ) { - loadmodel = TModelsManager::GetModel( asBaseDir + lookup->second, true ); - // if the override was succesfully loaded call it a day - if( loadmodel != nullptr ) { return loadmodel; } + { + auto const lookup { LoadModelOverrides.find( Name ) }; + if( lookup != LoadModelOverrides.end() ) { + loadmodel = TModelsManager::GetModel( asBaseDir + lookup->second, true ); + // if the override was succesfully loaded call it a day + if( loadmodel != nullptr ) { return loadmodel; } + } } // regular routine if there's no override or it couldn't be loaded // try first specialized version of the load model, vehiclename_loadname - auto const specializedloadfilename { asBaseDir + MoverParameters->TypeName + "_" + Name }; - if( ( true == FileExists( specializedloadfilename + ".e3d" ) ) - || ( true == FileExists( specializedloadfilename + ".t3d" ) ) ) { - loadmodel = TModelsManager::GetModel( specializedloadfilename, true ); + { + auto const specializedloadfilename { asBaseDir + MoverParameters->TypeName + "_" + Name }; + loadmodel = TModelsManager::GetModel( specializedloadfilename, true, false ); + if( loadmodel != nullptr ) { return loadmodel; } } - if( loadmodel == nullptr ) { - // if this fails, try generic load model - loadmodel = TModelsManager::GetModel( asBaseDir + Name, true ); + // try generic version of the load model next, loadname + { + auto const genericloadfilename { asBaseDir + Name }; + loadmodel = TModelsManager::GetModel( genericloadfilename, true, false ); + if( loadmodel != nullptr ) { return loadmodel; } } + // if we're still here, give up return loadmodel; } diff --git a/MdlMngr.cpp b/MdlMngr.cpp index 015de0ee..f71b2921 100644 --- a/MdlMngr.cpp +++ b/MdlMngr.cpp @@ -57,7 +57,7 @@ TModelsManager::LoadModel(std::string const &Name, bool dynamic) { } TModel3d * -TModelsManager::GetModel(std::string const &Name, bool const Dynamic) +TModelsManager::GetModel(std::string const &Name, bool const Dynamic, bool const Logerrors ) { // model może być we wpisie "node...model" albo "node...dynamic", a także być dodatkowym w dynamic // (kabina, wnętrze, ładunek) // dla "node...dynamic" mamy podaną ścieżkę w "\dynamic\" i musi być co najmniej 1 poziom, zwkle @@ -107,7 +107,9 @@ TModelsManager::GetModel(std::string const &Name, bool const Dynamic) } else { // there's nothing matching in the databank nor on the disk, report failure... - ErrorLog( "Bad file: failed do locate 3d model file \"" + filename + "\"", logtype::file ); + if( Logerrors ) { + ErrorLog( "Bad file: failed do locate 3d model file \"" + filename + "\"", logtype::file ); + } // ...and link it with the error model slot m_modelsmap.emplace( filename, null_handle ); } diff --git a/MdlMngr.h b/MdlMngr.h index b70eb30d..196da420 100644 --- a/MdlMngr.h +++ b/MdlMngr.h @@ -22,7 +22,7 @@ private: class TModelsManager { public: // McZapkie: dodalem sciezke, notabene Path!=Patch :) - static TModel3d *GetModel( std::string const &Name, bool dynamic = false ); + static TModel3d *GetModel( std::string const &Name, bool const dynamic = false, bool const Logerrors = true ); private: // types: diff --git a/Train.cpp b/Train.cpp index 1870279e..f171ccec 100644 --- a/Train.cpp +++ b/Train.cpp @@ -4719,13 +4719,10 @@ void TTrain::OnCommand_doorcloseall( TTrain *Train, command_data const &Command if( Command.action == GLFW_PRESS ) { if( Train->mvOccupied->Doors.has_autowarning ) { - // automatic departure signal delays actual door closing until the button is released Train->mvOccupied->signal_departure( true ); } - else { - Train->mvOccupied->OperateDoors( side::right, false ); - Train->mvOccupied->OperateDoors( side::left, false ); - } + Train->mvOccupied->OperateDoors( side::right, false ); + Train->mvOccupied->OperateDoors( side::left, false ); // visual feedback Train->ggDoorLeftButton.UpdateValue( 0.0, Train->dsbSwitch ); Train->ggDoorRightButton.UpdateValue( 0.0, Train->dsbSwitch ); @@ -4735,11 +4732,7 @@ void TTrain::OnCommand_doorcloseall( TTrain *Train, command_data const &Command else if( Command.action == GLFW_RELEASE ) { // release the button if( Train->mvOccupied->Doors.has_autowarning ) { - // automatic departure signal delays actual door closing until the button is released Train->mvOccupied->signal_departure( false ); - // now we can actually close the door - Train->mvOccupied->OperateDoors( side::right, false ); - Train->mvOccupied->OperateDoors( side::left, false ); } // visual feedback if( Train->ggDoorAllOffButton.SubModel ) diff --git a/driveruipanels.cpp b/driveruipanels.cpp index 6a482e81..ff93e88e 100644 --- a/driveruipanels.cpp +++ b/driveruipanels.cpp @@ -377,24 +377,26 @@ timetable_panel::update() { candeparture ? readycolor : // czas minął i odjazd był, to nazwa stacji będzie na zielono isatpassengerstop ? waitcolor : Global.UITextColor ) }; + auto const trackcount{ ( tableline->TrackNo == 1 ? u8" ┃ " : u8" ║ " ) }; m_tablelines.emplace_back( - ( u8"│ " + vmax + u8" │ " + station + u8" │ " + arrival + u8" │ " + traveltime + u8" │" ), + ( u8"│ " + vmax + u8" │ " + station + trackcount + arrival + u8" │ " + traveltime + u8" │" ), linecolor ); m_tablelines.emplace_back( - ( u8"│ │ " + location + tableline->StationWare + u8" │ " + departure + u8" │ │" ), + ( u8"│ │ " + location + tableline->StationWare + trackcount + departure + u8" │ │" ), linecolor ); // divider/footer if( i < table->StationCount ) { auto const *nexttableline { tableline + 1 }; - if( tableline->vmax == nexttableline->vmax ) { - m_tablelines.emplace_back( u8"│ ├────────────────────────────────────┼─────────┼─────┤", Global.UITextColor ); - } - else { - m_tablelines.emplace_back( u8"├─────┼────────────────────────────────────┼─────────┼─────┤", Global.UITextColor ); - } + std::string const vmaxnext{ ( tableline->vmax == nexttableline->vmax ? u8"│ ├" : u8"├─────┼" ) }; + auto const trackcountnext{ ( nexttableline->TrackNo == 1 ? u8"╂" : u8"╫" ) }; + m_tablelines.emplace_back( + vmaxnext + u8"────────────────────────────────────" + trackcountnext + u8"─────────┼─────┤", + Global.UITextColor ); } else { - m_tablelines.emplace_back( u8"└─────┴────────────────────────────────────┴─────────┴─────┘", Global.UITextColor ); + m_tablelines.emplace_back( + u8"└─────┴────────────────────────────────────┴─────────┴─────┘", + Global.UITextColor ); } } } diff --git a/mtable.cpp b/mtable.cpp index 957a4f8d..b1749f87 100644 --- a/mtable.cpp +++ b/mtable.cpp @@ -549,6 +549,7 @@ void TTrainParameters::serialize( dictionary_source *Output ) const { Output->insert( ( stationlabel + "am" ), timetableline.Am ); Output->insert( ( stationlabel + "dh" ), timetableline.Dh ); Output->insert( ( stationlabel + "dm" ), timetableline.Dm ); + Output->insert( ( stationlabel + "tracks" ), timetableline.TrackNo ); } } }