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

build 200322. coupler adapter, automatic coupling vehicle setting, parked vehicle manual brake activation, ai braking logic enhancement, opengl 3.3 renderer diffuse color visualization fix, minor cab control logic bug fixes

This commit is contained in:
tmj-fstate
2020-03-24 16:12:25 +01:00
parent e0c1f41474
commit c22f4c900f
17 changed files with 431 additions and 93 deletions

View File

@@ -797,18 +797,23 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
std::string
debug_panel::update_vehicle_coupler( int const Side ) {
// NOTE: mover and vehicle are guaranteed to be valid by the caller
auto const &mover { *( m_input.mover ) };
std::string couplerstatus { locale::strings[ locale::string::debug_vehicle_none ] };
std::string const adapterstatus { ( mover.Couplers[ Side ].adapter_type == TCouplerType::NoCoupler ? "" : "[A]" ) };
auto const *connected { m_input.vehicle->MoverParameters->Neighbours[ Side ].vehicle };
if( connected == nullptr ) { return couplerstatus; }
auto const &mover { *( m_input.mover ) };
if( connected == nullptr ) {
return couplerstatus + " " + adapterstatus;
}
std::snprintf(
m_buffer.data(), m_buffer.size(),
"%s [%d] (%.1f m)",
"%s %s[%d] (%.1f m)",
connected->name().c_str(),
adapterstatus.c_str(),
mover.Couplers[ Side ].CouplingFlag,
mover.Neighbours[ Side ].distance );