From c655ced36abd344896ca3f03ab3f8c8417929cfd Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 3 Oct 2016 15:29:28 +0100 Subject: [PATCH] Add crosshairs option to OSD --- tabs/osd.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tabs/osd.js b/tabs/osd.js index c2c3451b..d43bd0b0 100755 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -291,6 +291,11 @@ OSD.constants = { positionable: true, preview: 'DISARMED' }, + CROSSHAIRS: { + name: 'CROSSHAIRS', + default_position: -1, + positionable: false + }, ARTIFICIAL_HORIZON: { name: 'ARTIFICIAL_HORIZON', default_position: -1, @@ -363,10 +368,12 @@ OSD.constants = { // Pick display fields by version, order matters, so these are going in an array... pry could iterate the example map instead OSD.chooseFields = function () { var F = OSD.constants.ALL_DISPLAY_FIELDS; + // version 3.0.1 if (semver.gte(CONFIG.flightControllerVersion, "3.0.1")) { OSD.constants.DISPLAY_FIELDS = [ F.RSSI_VALUE, F.MAIN_BATT_VOLTAGE, + F.CROSSHAIRS, F.ARTIFICIAL_HORIZON, F.HORIZON_SIDEBARS, F.ONTIME, @@ -750,6 +757,9 @@ TABS.osd.initialize = function (callback) { for (var i = 0; i < 9; i++) { OSD.data.preview[centerishPosition - 4 + i] = SYM.AH_BAR9_0 + 4; } + } + // crosshairs + if ($('input[name="CROSSHAIRS"]').prop('checked')) { OSD.data.preview[centerishPosition - 1] = SYM.AH_CENTER_LINE; OSD.data.preview[centerishPosition + 1] = SYM.AH_CENTER_LINE_RIGHT; OSD.data.preview[centerishPosition] = SYM.AH_CENTER;