From 6bbcce1010665a3740035ed89b36f4b481f72bbc Mon Sep 17 00:00:00 2001 From: Jeff Hendrix Date: Wed, 5 Oct 2022 00:03:17 -0600 Subject: [PATCH] Updated video systems available based on MSP displayport being selected --- _locales/en/messages.json | 2 +- tabs/osd.js | 42 ++++++++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 011f0a8d5..3194ef676 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -3601,7 +3601,7 @@ "message": "Show preview guides" }, "osd_video_HELP": { - "message": "For HD keep within the red lines for 4:3, HDZero keep within the blue box for a higher refresh rate, AUTO/PAL the green line is NTSC limit ." + "message": "For HD: red lines show 4:3 screen, HDZero: keep within the blue box for a higher refresh rate, AUTO/PAL: green line is NTSC limit." }, "osd_dji_HD_FPV": { "message" : "DJI HD FPV" diff --git a/tabs/osd.js b/tabs/osd.js index 2e068068a..97f12a797 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -2362,6 +2362,9 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) { } }; +const mspVideoSystem = [1,3,4]; // indexes of PAL, HDZERO, & DJIWTF +const analogVideoSystem = [0,1,2]; // indexes of AUTO, PAL, & NTSC + OSD.GUI.updateVideoMode = function() { // video mode var $videoTypes = $('.video-types').empty(); @@ -2371,29 +2374,44 @@ OSD.GUI.updateVideoMode = function() { } if (OSD.data.isMspDisplay) { - if (OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] != 'HDZERO') { + if (mspVideoSystem.includes(OSD.data.preferences.video_system) == false) { OSD.data.preferences.video_system = OSD.constants.VIDEO_TYPES.indexOf('HDZERO'); OSD.updateDisplaySize(); OSD.GUI.saveConfig(); } } else { - if (OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'HDZERO' || OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'DJIWTF') { + if (analogVideoSystem.includes(OSD.data.preferences.video_system) == false) { OSD.data.preferences.video_system = OSD.constants.VIDEO_TYPES.indexOf('AUTO') OSD.updateDisplaySize(); OSD.GUI.saveConfig(); } } - for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) { - if ((OSD.constants.VIDEO_TYPES[i] != 'HDZERO' && OSD.constants.VIDEO_TYPES[i] != 'DJIWTF') || OSD.data.isMspDisplay) - { - $videoTypes.append( - $('') - .prop('checked', i === OSD.data.preferences.video_system) - .data('type', i) - ) - ); + if (OSD.data.isMspDisplay) { + for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) { + if (mspVideoSystem.includes(i)) + { + $videoTypes.append( + $('') + .prop('checked', i === OSD.data.preferences.video_system) + .data('type', i) + ) + ); + } + } + } else { + for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) { + if (analogVideoSystem.includes(i)) + { + $videoTypes.append( + $('') + .prop('checked', i === OSD.data.preferences.video_system) + .data('type', i) + ) + ); + } } }