diff --git a/locales/en/messages.json b/locales/en/messages.json index 489621607c..3f6c55db38 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -5498,14 +5498,23 @@ "osdDescElementAltitude": { "message": "Current altitude (flashes when above alarm threshold)" }, - "osdTextElementAltitudeVariant1Decimal": { - "message": "With 1 decimal", + "osdTextElementAltitudeVariant1DecimalAGL": { + "message": "AGL with 1 decimal", "description": "One of the variants of the altitude element of the OSD" }, - "osdTextElementAltitudeVariantNoDecimal": { - "message": "Without decimals", + "osdTextElementAltitudeVariantNoDecimalAGL": { + "message": "AGL without decimals", "description": "One of the variants of the altitude element of the OSD" }, + "osdTextElementAltitudeVariant1DecimalASL": { + "message": "ASL with 1 decimal", + "description": "One of the variants of the altitude element of the OSD" + }, + "osdTextElementAltitudeVariantNoDecimalASL": { + "message": "ASL without decimals", + "description": "One of the variants of the altitude element of the OSD" + }, + "osdTextElementOnTime": { "message": "On time", "description": "One of the elements of the OSD" diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 106178b851..7445a98cc9 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -15,6 +15,7 @@ import inflection from "inflection"; import debounce from "lodash.debounce"; import $ from 'jquery'; import FileSystem from "../FileSystem"; +import { have_sensor } from "../sensor_helpers"; const FONT = {}; const SYM = {}; @@ -779,8 +780,8 @@ OSD.loadDisplayFields = function() { draw_order: 160, positionable: true, variants: [ - 'osdTextElementAltitudeVariant1Decimal', - 'osdTextElementAltitudeVariantNoDecimal', + 'osdTextElementAltitudeVariant1DecimalAGL', + 'osdTextElementAltitudeVariantNoDecimalAGL', ], preview(osdData) { return OSD.generateAltitudePreview(osdData); @@ -1513,6 +1514,11 @@ OSD.loadDisplayFields = function() { preview: '1:23.456', }, }; + + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47) && have_sensor(FC.CONFIG.activeSensors, 'gps')) { + OSD.ALL_DISPLAY_FIELDS.ALTITUDE.variants.push('osdTextElementAltitudeVariant1DecimalASL'); + OSD.ALL_DISPLAY_FIELDS.ALTITUDE.variants.push('osdTextElementAltitudeVariantNoDecimalASL'); + } }; OSD.constants = {