mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 16:25:19 +03:00
fix OSD bug, no HD variants in select
This commit is contained in:
parent
4db2ece0df
commit
ae09caf0fe
2 changed files with 15 additions and 2 deletions
|
@ -1635,6 +1635,12 @@ var mspHelper = (function (gui) {
|
||||||
|
|
||||||
var index = 0;
|
var index = 0;
|
||||||
|
|
||||||
|
if(data.byteLength == 0){
|
||||||
|
OSD_CUSTOM_ELEMENTS.settings.customElementsCount = 0;
|
||||||
|
OSD_CUSTOM_ELEMENTS.settings.customElementTextSize = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
OSD_CUSTOM_ELEMENTS.settings.customElementsCount = data.getUint8(index++);
|
OSD_CUSTOM_ELEMENTS.settings.customElementsCount = data.getUint8(index++);
|
||||||
OSD_CUSTOM_ELEMENTS.settings.customElementTextSize = data.getUint8(index++);
|
OSD_CUSTOM_ELEMENTS.settings.customElementTextSize = data.getUint8(index++);
|
||||||
|
|
||||||
|
|
11
tabs/osd.js
11
tabs/osd.js
|
@ -2147,7 +2147,10 @@ OSD.reload = function(callback) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP2_INAV_CUSTOM_OSD_ELEMENTS);
|
if(semver.gte(CONFIG.flightControllerVersion, '7.1.0'))
|
||||||
|
{
|
||||||
|
MSP.send_message(MSPCodes.MSP2_INAV_CUSTOM_OSD_ELEMENTS);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
OSD.updateSelectedLayout = function(new_layout) {
|
OSD.updateSelectedLayout = function(new_layout) {
|
||||||
|
@ -3384,13 +3387,16 @@ TABS.osd.initialize = function (callback) {
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
mspHelper.loadOsdCustomElements(createCustomElements);
|
if(semver.gte(CONFIG.flightControllerVersion, '7.1.0')) {
|
||||||
|
mspHelper.loadOsdCustomElements(createCustomElements);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
function createCustomElements(){
|
function createCustomElements(){
|
||||||
if(OSD_CUSTOM_ELEMENTS.settings.customElementsCount == 0){
|
if(OSD_CUSTOM_ELEMENTS.settings.customElementsCount == 0){
|
||||||
$('.custom-element-container').remove();
|
$('.custom-element-container').remove();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var customElementsContainer = $('#osdCustomElements');
|
var customElementsContainer = $('#osdCustomElements');
|
||||||
|
@ -3602,6 +3608,7 @@ function customElementGetDataForRow(row){
|
||||||
switch (parseInt(elementVisibilityType.val())){
|
switch (parseInt(elementVisibilityType.val())){
|
||||||
case 1:
|
case 1:
|
||||||
visibilityValue = parseInt(valueVisibilityCell.find('.gv').find(':selected').val());
|
visibilityValue = parseInt(valueVisibilityCell.find('.gv').find(':selected').val());
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
visibilityValue = parseInt(valueVisibilityCell.find('.lc').find(':selected').val());
|
visibilityValue = parseInt(valueVisibilityCell.find('.lc').find(':selected').val());
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue