Fix missing OSD preview symbols (#1494)

Fix missing OSD preview symbols
10.7.0-preview
Michael Keller 2019-06-15 19:11:29 +12:00 committed by GitHub
commit bb555568e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 29 deletions

View File

@ -393,35 +393,10 @@ OSD.drawStickOverlayPreview = function () {
return stickOverlay; return stickOverlay;
} }
OSD.constants = { OSD.loadDisplayFields = function() {
VISIBLE: 0x0800,
VIDEO_TYPES: [
'AUTO',
'PAL',
'NTSC'
],
VIDEO_LINES: {
PAL: 16,
NTSC: 13
},
VIDEO_BUFFER_CHARS: {
PAL: 480,
NTSC: 390
},
UNIT_TYPES: [
'IMPERIAL',
'METRIC'
],
TIMER_PRECISION: [
'SECOND',
'HUNDREDTH',
'TENTH'
],
AHISIDEBARWIDTHPOSITION: 7,
AHISIDEBARHEIGHTPOSITION: 3,
// All display fields, from every version, do not remove elements, only add! // All display fields, from every version, do not remove elements, only add!
ALL_DISPLAY_FIELDS: { OSD.ALL_DISPLAY_FIELDS = {
MAIN_BATT_VOLTAGE: { MAIN_BATT_VOLTAGE: {
name: 'MAIN_BATT_VOLTAGE', name: 'MAIN_BATT_VOLTAGE',
text: 'osdTextElementMainBattVoltage', text: 'osdTextElementMainBattVoltage',
@ -1091,7 +1066,36 @@ OSD.constants = {
positionable: true, positionable: true,
preview: FONT.symbol(SYM.RSSI) + '-130' preview: FONT.symbol(SYM.RSSI) + '-130'
}, },
};
};
OSD.constants = {
VISIBLE: 0x0800,
VIDEO_TYPES: [
'AUTO',
'PAL',
'NTSC'
],
VIDEO_LINES: {
PAL: 16,
NTSC: 13
}, },
VIDEO_BUFFER_CHARS: {
PAL: 480,
NTSC: 390
},
UNIT_TYPES: [
'IMPERIAL',
'METRIC'
],
TIMER_PRECISION: [
'SECOND',
'HUNDREDTH',
'TENTH'
],
AHISIDEBARWIDTHPOSITION: 7,
AHISIDEBARHEIGHTPOSITION: 3,
UNKNOWN_DISPLAY_FIELD: { UNKNOWN_DISPLAY_FIELD: {
name: 'UNKNOWN', name: 'UNKNOWN',
text: 'osdTextElementUnknown', text: 'osdTextElementUnknown',
@ -1311,7 +1315,7 @@ OSD.searchLimitsElement = function (arrayElements) {
// Pick display fields by version, order matters, so these are going in an array... pry could iterate the example map instead // Pick display fields by version, order matters, so these are going in an array... pry could iterate the example map instead
OSD.chooseFields = function () { OSD.chooseFields = function () {
var F = OSD.constants.ALL_DISPLAY_FIELDS; var F = OSD.ALL_DISPLAY_FIELDS;
// version 3.0.1 // version 3.0.1
if (semver.gte(CONFIG.apiVersion, "1.21.0")) { if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
OSD.constants.DISPLAY_FIELDS = [ OSD.constants.DISPLAY_FIELDS = [
@ -2000,6 +2004,7 @@ TABS.osd.initialize = function (callback) {
// Prepare symbols depending on the version // Prepare symbols depending on the version
SYM.loadSymbols(); SYM.loadSymbols();
OSD.loadDisplayFields();
// Generate font type select element // Generate font type select element
var fontPresetsElement = $('.fontpresets'); var fontPresetsElement = $('.fontpresets');