|
|
|
@ -123,7 +123,7 @@ SYM.AH_AIRCRAFT4 = 0x1A6;
|
|
|
|
|
SYM.AH_CROSSHAIRS = new Array(0x166, 0x1A4, new Array(0x190, 0x191, 0x192), new Array(0x193, 0x194, 0x195), new Array(0x196, 0x197, 0x198), new Array(0x199, 0x19A, 0x19B), new Array (0x19C, 0x19D, 0x19E), new Array (0x19F, 0x1A0, 0x1A1));
|
|
|
|
|
|
|
|
|
|
var video_type = null;
|
|
|
|
|
|
|
|
|
|
var isGuidesChecked = false;
|
|
|
|
|
var FONT = FONT || {};
|
|
|
|
|
|
|
|
|
|
FONT.initData = function () {
|
|
|
|
@ -539,6 +539,7 @@ OSD.constants = {
|
|
|
|
|
'NTSC',
|
|
|
|
|
'HDZERO',
|
|
|
|
|
'DJIWTF',
|
|
|
|
|
'AVATAR',
|
|
|
|
|
'BF43COMPAT'
|
|
|
|
|
],
|
|
|
|
|
VIDEO_LINES: {
|
|
|
|
@ -546,6 +547,7 @@ OSD.constants = {
|
|
|
|
|
NTSC: 13,
|
|
|
|
|
HDZERO: 18,
|
|
|
|
|
DJIWTF: 22,
|
|
|
|
|
AVATAR: 20,
|
|
|
|
|
BF43COMPAT: 16,
|
|
|
|
|
},
|
|
|
|
|
VIDEO_COLS: {
|
|
|
|
@ -553,6 +555,7 @@ OSD.constants = {
|
|
|
|
|
NTSC: 30,
|
|
|
|
|
HDZERO: 50,
|
|
|
|
|
DJIWTF: 60,
|
|
|
|
|
AVATAR: 53,
|
|
|
|
|
BF43COMPAT: 30
|
|
|
|
|
},
|
|
|
|
|
VIDEO_BUFFER_CHARS: {
|
|
|
|
@ -560,6 +563,7 @@ OSD.constants = {
|
|
|
|
|
NTSC: 390,
|
|
|
|
|
HDZERO: 900,
|
|
|
|
|
DJIWTF: 1320,
|
|
|
|
|
AVATAR: 1060,
|
|
|
|
|
BF43COMPAT: 480
|
|
|
|
|
},
|
|
|
|
|
UNIT_TYPES: [
|
|
|
|
@ -2100,15 +2104,20 @@ OSD.updateDisplaySize = function () {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set the preview size if dji wtf
|
|
|
|
|
// set the preview size based on the video type
|
|
|
|
|
// -- AVATAR
|
|
|
|
|
$('.third_left').toggleClass('preview_avatar_side', (video_type == 'AVATAR'))
|
|
|
|
|
$('.preview').toggleClass('preview_avatar cut43_left', (video_type == 'AVATAR'))
|
|
|
|
|
$('.third_right').toggleClass('preview_avatar_side', (video_type == 'AVATAR'))
|
|
|
|
|
// -- DJI WTF
|
|
|
|
|
$('.third_left').toggleClass('preview_dji_hd_side', video_type == 'DJIWTF')
|
|
|
|
|
$('.preview').toggleClass('preview_dji_hd cut43_left', video_type == 'DJIWTF')
|
|
|
|
|
$('.third_right').toggleClass('preview_dji_hd_side', video_type == 'DJIWTF')
|
|
|
|
|
|
|
|
|
|
// set the preview size based on the video type
|
|
|
|
|
// -- HD ZERO
|
|
|
|
|
$('.third_left').toggleClass('preview_hdzero_side', (video_type == 'HDZERO'))
|
|
|
|
|
$('.preview').toggleClass('preview_hdzero cut43_left', (video_type == 'HDZERO'))
|
|
|
|
|
$('.third_right').toggleClass('preview_hdzero_side', (video_type == 'HDZERO'))
|
|
|
|
|
|
|
|
|
|
OSD.GUI.updateGuidesView($('#videoGuides').find('input').is(':checked'));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2392,7 +2401,7 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const mspVideoSystem = [1,3,4,5]; // indexes of PAL, HDZERO, DJIWTF, & BF43COMPAT
|
|
|
|
|
const mspVideoSystem = [1,3,4,5,6]; // indexes of PAL, HDZERO, DJIWTF,AVATAR, & BF43COMPAT
|
|
|
|
|
const analogVideoSystem = [0,1,2]; // indexes of AUTO, PAL, & NTSC
|
|
|
|
|
|
|
|
|
|
OSD.GUI.updateVideoMode = function() {
|
|
|
|
@ -2422,11 +2431,9 @@ OSD.GUI.updateVideoMode = function() {
|
|
|
|
|
if (mspVideoSystem.includes(i))
|
|
|
|
|
{
|
|
|
|
|
$videoTypes.append(
|
|
|
|
|
$('<label/>')
|
|
|
|
|
.append($('<input name="video_system" type="radio"/>' + OSD.constants.VIDEO_TYPES[i] + '</label>')
|
|
|
|
|
.prop('checked', i === OSD.data.preferences.video_system)
|
|
|
|
|
$('<option value="' + OSD.constants.VIDEO_TYPES[i] + '">' + OSD.constants.VIDEO_TYPES[i] + '</option>')
|
|
|
|
|
.prop('selected', i === OSD.data.preferences.video_system)
|
|
|
|
|
.data('type', i)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2435,18 +2442,16 @@ OSD.GUI.updateVideoMode = function() {
|
|
|
|
|
if (analogVideoSystem.includes(i))
|
|
|
|
|
{
|
|
|
|
|
$videoTypes.append(
|
|
|
|
|
$('<label/>')
|
|
|
|
|
.append($('<input name="video_system" type="radio"/>' + OSD.constants.VIDEO_TYPES[i] + '</label>')
|
|
|
|
|
.prop('checked', i === OSD.data.preferences.video_system)
|
|
|
|
|
$('<option value="' + OSD.constants.VIDEO_TYPES[i] + '">' + OSD.constants.VIDEO_TYPES[i] + '</option>')
|
|
|
|
|
.prop('selected', i === OSD.data.preferences.video_system)
|
|
|
|
|
.data('type', i)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$videoTypes.find(':radio').click(function () {
|
|
|
|
|
OSD.data.preferences.video_system = $(this).data('type');
|
|
|
|
|
$videoTypes.change(function () {
|
|
|
|
|
OSD.data.preferences.video_system = $(this).find(':selected').data('type');
|
|
|
|
|
OSD.updateDisplaySize();
|
|
|
|
|
OSD.GUI.saveConfig();
|
|
|
|
|
});
|
|
|
|
@ -2620,9 +2625,10 @@ OSD.GUI.updateFields = function() {
|
|
|
|
|
if ($('#videoGuidesToggle').length == false) {
|
|
|
|
|
$('#videoGuides').prepend(
|
|
|
|
|
$('<input id="videoGuidesToggle" type="checkbox" class="toggle" />')
|
|
|
|
|
.attr('checked', false)
|
|
|
|
|
.attr('checked', isGuidesChecked)
|
|
|
|
|
.on('change', function () {
|
|
|
|
|
OSD.GUI.updateGuidesView(this.checked);
|
|
|
|
|
chrome.storage.local.set({'showOSDGuides': this.checked});
|
|
|
|
|
OSD.GUI.updatePreviews();
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
@ -2664,8 +2670,6 @@ OSD.GUI.removeBottomLines = function(){
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OSD.GUI.updateDjiMessageElements = function(on) {
|
|
|
|
|
$('.display-field').each(function(index, element) {
|
|
|
|
|
var name = $(element).find('input').attr('name');
|
|
|
|
@ -2699,6 +2703,15 @@ OSD.GUI.updateGuidesView = function(on) {
|
|
|
|
|
$('.hd_43_margin_left').toggleClass('dji_hd_43_left', (isDJIWTF && on))
|
|
|
|
|
$('.hd_43_margin_right').toggleClass('dji_hd_43_right', (isDJIWTF && on))
|
|
|
|
|
|
|
|
|
|
isAvatar = OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'AVATAR';
|
|
|
|
|
$('.hd_43_margin_left').toggleClass('hd_avatar_43_left', (isAvatar && on))
|
|
|
|
|
$('.hd_43_margin_right').toggleClass('hd_avatar_43_right', (isAvatar && on))
|
|
|
|
|
$('.hd_avatar_bottom_bar').toggleClass('hd_avatar_bottom', (isAvatar && on))
|
|
|
|
|
$('.hd_avatar_storage_box_top').toggleClass('hd_avatar_storagebox_t', (isAvatar && on))
|
|
|
|
|
$('.hd_avatar_storage_box_bottom').toggleClass('hd_avatar_storagebox_b', (isAvatar && on))
|
|
|
|
|
$('.hd_avatar_storage_box_left').toggleClass('hd_avatar_storagebox_l', (isAvatar && on))
|
|
|
|
|
$('.hd_avatar_storage_box_right').toggleClass('hd_avatar_storagebox_r', (isAvatar && on))
|
|
|
|
|
|
|
|
|
|
isPAL = OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'PAL' || OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'AUTO';
|
|
|
|
|
$('.pal_ntsc_box_bottom').toggleClass('ntsc_bottom', (isPAL && on))
|
|
|
|
|
};
|
|
|
|
@ -2836,7 +2849,7 @@ OSD.GUI.updatePreviews = function() {
|
|
|
|
|
|
|
|
|
|
var centerPosition = (OSD.data.display_size.x * OSD.data.display_size.y / 2);
|
|
|
|
|
if (OSD.data.display_size.y % 2 == 0) {
|
|
|
|
|
centerPosition += OSD.data.display_size.x / 2;
|
|
|
|
|
centerPosition += Math.floor(OSD.data.display_size.x / 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let hudCenterPosition = centerPosition - (OSD.constants.VIDEO_COLS[video_type] * $('#osd_horizon_offset').val());
|
|
|
|
@ -2970,7 +2983,7 @@ OSD.GUI.updateAll = function() {
|
|
|
|
|
OSD.GUI.updateUnits();
|
|
|
|
|
OSD.GUI.updateFields();
|
|
|
|
|
OSD.GUI.updatePreviews();
|
|
|
|
|
OSD.GUI.updateGuidesView(false);
|
|
|
|
|
OSD.GUI.updateGuidesView($('#videoGuides').find('input').is(':checked'));
|
|
|
|
|
OSD.GUI.updateDjiView(OSD.data.isDjiHdFpv && !OSD.data.isMspDisplay);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -3029,6 +3042,12 @@ TABS.osd.initialize = function (callback) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Initialise guides checkbox
|
|
|
|
|
chrome.storage.local.get('showOSDGuides', function (result) {
|
|
|
|
|
if (typeof result.showOSDGuides !== 'undefined') {
|
|
|
|
|
isGuidesChecked = result.showOSDGuides;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Setup switch indicators
|
|
|
|
|
$(".osdSwitchInd_channel option").each(function() {
|
|
|
|
|