1
0
Fork 0
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:
error414 2024-02-20 18:04:41 +01:00
parent 4db2ece0df
commit ae09caf0fe
2 changed files with 15 additions and 2 deletions

View file

@ -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++);

View file

@ -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;