..obviously only for vehicles that have pantographs at all

This commit is contained in:
milek7
2021-01-16 19:52:30 +01:00
parent fdafcbc9be
commit 5d130c7fcf
2 changed files with 8 additions and 4 deletions

View File

@@ -821,8 +821,10 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
Output.emplace_back( m_buffer.data(), Global.UITextColor );
std::snprintf(m_buffer.data(), m_buffer.size(), STR_C("Energy consumed from pantographs: %.1f kWh"), mover.EnergyConsumed);
Output.emplace_back( m_buffer.data(), Global.UITextColor );
if( mover.EnginePowerSource.SourceType == TPowerSource::CurrentCollector ) {
std::snprintf(m_buffer.data(), m_buffer.size(), STR_C("Energy consumed from pantographs: %.1f kWh"), mover.EnergyConsumed);
Output.emplace_back( m_buffer.data(), Global.UITextColor );
}
if (!std::isnan(last_time)) {
double dt = Timer::GetTime() - last_time;

View File

@@ -277,8 +277,10 @@ void ui::vehicleparams_panel::render_contents()
ImGui::TextUnformatted(buffer.data());
std::snprintf(buffer.data(), buffer.size(), STR_C("Energy consumed from pantographs: %.1f kWh"), mover.EnergyConsumed);
ImGui::TextUnformatted(buffer.data());
if( mover.EnginePowerSource.SourceType == TPowerSource::CurrentCollector ) {
std::snprintf(buffer.data(), buffer.size(), STR_C("Energy consumed from pantographs: %.1f kWh"), mover.EnergyConsumed);
ImGui::TextUnformatted(buffer.data());
}
draw_mini(mover);