From 43f39962a29c96ab830d88a30aa5723313485d85 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Tue, 13 Aug 2024 16:57:33 +0200 Subject: [PATCH] Add DEBUG2 OSD element (#4124) --- locales/en/messages.json | 7 +++++++ src/js/tabs/osd.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/locales/en/messages.json b/locales/en/messages.json index 6ffb5f893d..baa81d6e86 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -5605,6 +5605,13 @@ "osdDescElementDebug": { "message": "Debug variables" }, + "osdTextElementDebug2": { + "message": "Debug2", + "description": "One of the elements of the OSD" + }, + "osdDescElementDebug2": { + "message": "Debug variables for debug 4-7" + }, "osdTextElementPIDRoll": { "message": "PID roll", "description": "One of the elements of the OSD" diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 48b2241033..7ed96e22bd 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -1513,6 +1513,15 @@ OSD.loadDisplayFields = function() { positionable: true, preview: '1:23.456', }, + DEBUG2: { + name: 'DEBUG2', + text: 'osdTextElementDebug2', + desc: 'osdDescElementDebug2', + defaultPosition: -1, + draw_order: 560, + positionable: true, + preview: 'DBG2 0 0 0 0', + }, }; if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47) && have_sensor(FC.CONFIG.activeSensors, 'gps')) { @@ -1960,6 +1969,11 @@ OSD.chooseFields = function() { ]); } + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([ + F.DEBUG2, + ]); + } // Choose statistic fields // Nothing much to do here, I'm preempting there being new statistics F = OSD.constants.ALL_STATISTIC_FIELDS;