From 6baf43d0e75ec0a08ca2c46452156c28543f2f7f Mon Sep 17 00:00:00 2001 From: mbm-OR Date: Wed, 24 Aug 2022 00:51:46 +0200 Subject: [PATCH] Bug fix for https://bugs.launchpad.net/or/+bug/1987453. Web: HUD/Force Information, some labels not visible. --- Source/RunActivity/Viewer3D/Popups/HUDWindow.cs | 3 ++- Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/RunActivity/Viewer3D/Popups/HUDWindow.cs b/Source/RunActivity/Viewer3D/Popups/HUDWindow.cs index a0109f41ce..bd56723b16 100644 --- a/Source/RunActivity/Viewer3D/Popups/HUDWindow.cs +++ b/Source/RunActivity/Viewer3D/Popups/HUDWindow.cs @@ -1,4 +1,4 @@ -// COPYRIGHT 2011, 2012, 2013 by the Open Rails project. +// COPYRIGHT 2011, 2012, 2013 by the Open Rails project. // // This file is part of Open Rails. // @@ -1038,6 +1038,7 @@ void TextPageBrakeInfo(TableData table) void TextPageForceInfo(TableData table) { + TableSetLabelValueColumns(table, 0, 2); TextPageHeading(table, Viewer.Catalog.GetString("FORCE INFORMATION")); var train = Viewer.PlayerLocomotive.Train; diff --git a/Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js b/Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js index 0b29e6f03a..36babdc5b4 100644 --- a/Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js +++ b/Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js @@ -85,6 +85,7 @@ function ApiHeadUpDisplay() { DebugColSpanTo3 = ['Render process','Updater process','Loader process','Sound process','Total process'], DebugWidthTofix = ['primitives','Camera'], // Force information + ForceColSpanTo15 = ['Wind Speed'], ForceColSpanTo4 = ['(Simple adhesion model)','Dynamic brake'], ForceColSpanTo3 = ['Axle out force','Loco Adhesion','Wagon Adhesion'], // Brake information @@ -135,6 +136,9 @@ function ApiHeadUpDisplay() { Str += "" + obj.extraTable.values[next] + ""; } // Force info requires colspan into first col + else if (obj.extraTable.values[next].includes(ForceColSpanTo15)) { + Str += "" + obj.extraTable.values[next] + ""; + } else if (ForceColSpanTo4.indexOf(obj.extraTable.values[next]) !== -1 || obj.extraTable.values[next].indexOf('===') !== -1){ // Locomotive info Str += "" + obj.extraTable.values[next] + ""; }