Skip to content
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.tabCompletion": "on",
"diffEditor.codeLens": true
}
20 changes: 11 additions & 9 deletions ui/modules/apps/beamadvisor/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ angular.module('beamng.apps')
const changeVisibility = (newVisibility) => {
if (settings.visibility !== newVisibility) settings.visibility = newVisibility;

if (newVisibility === 'normal') {
if (newVisibility === 'normal') { // might want to change to visible
elements.root.classList.remove('gps-only');
elements.root.classList.remove('gone');
}
Expand Down Expand Up @@ -706,7 +706,7 @@ angular.module('beamng.apps')

// Speed
// This is in m/s (meters per second), so m/s to mph is n * 2.237
const rawSpeedMph = streams.electrics.wheelspeed * 2.237;
const rawSpeedMph = streams.electrics.airspeed * 2.237;
const speedMph = Math.round(rawSpeedMph);
const speedKph = Math.round(speedMph * 1.609344);
updateElementText(elements.labels.topBar.speed, settings.speedUnit === 'mph' ? `${speedMph} mph` : `${speedKph} km/h`);
Expand Down Expand Up @@ -780,12 +780,14 @@ angular.module('beamng.apps')

// Gear
let gear;
if (streams.engineInfo[16] === 0) gear = 'N'; // Neutral
else if (streams.engineInfo[16] <= -1) gear = `R${Math.abs(streams.engineInfo[16])}`; // Reverse
else {
if (streams.engineInfo[13].toLowerCase() === 'auto') gear = `A${streams.engineInfo[16]}`;
else gear = streams.engineInfo[16];
}
if (streams.electrics.gear == 0) {
gear = 'N';
} else if (streams.electrics.gear < 0) {
gear = 'R';
} else {
gear = streams.electrics.gear;
}

updateElementText(elements.labels.topBar.gear, `<img src="/ui/modules/apps/beamadvisor/images/icons/gear.png" /> ${gear}`);

// Damage
Expand Down Expand Up @@ -1490,4 +1492,4 @@ angular.module('beamng.apps')
}, (2 * 1000));
}
};
}]);
}]);