1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 17:25:16 +03:00

Add display name to config, backup/restore and OSD

This commit is contained in:
Sean M 2018-10-13 00:22:14 -04:00 committed by mikeller
parent d502e69bb2
commit ab83c79315
5 changed files with 25 additions and 2 deletions

View file

@ -295,6 +295,13 @@ OSD.generateCraftName = function (osd_data) {
return preview;
}
OSD.generateDisplayName = function(osd_data) {
var preview = 'DISPLAY_NAME';
if (CONFIG.displayName != '')
preview = CONFIG.displayName.toUpperCase();
return preview;
}
OSD.drawStickOverlayPreview = function () {
function randomInt(count) {
return Math.floor(Math.random() * Math.floor(count));
@ -914,6 +921,16 @@ OSD.constants = {
positionable: true,
preview: OSD.drawStickOverlayPreview
},
DISPLAY_NAME: {
name: 'DISPLAY_NAME',
desc: 'osdDescElementDisplayName',
default_position: -77,
draw_order: 380,
positionable: true,
preview: function(osd_data) {
return OSD.generateDisplayName(osd_data, 1);
}
},
},
UNKNOWN_DISPLAY_FIELD: {
name: 'UNKNOWN_',
@ -1189,6 +1206,7 @@ OSD.chooseFields = function () {
F.FLIGHT_DIST,
F.STICK_OVERLAY_LEFT,
F.STICK_OVERLAY_RIGHT,
F.DISPLAY_NAME,
]);
}
}