Review handling is global function detection.

Fixes !sensor been selectable in global scripts

Thanks to @Max for his help
This commit is contained in:
3djc
2017-06-09 09:47:34 +02:00
parent 2e4775b19a
commit bae44d2812
4 changed files with 10 additions and 7 deletions
+6 -3
View File
@@ -99,7 +99,7 @@ bool isTelemetryFieldComparisonAvailable(int index)
{
if (!isTelemetryFieldAvailable(index))
return false;
TelemetrySensor & sensor = g_model.telemetrySensors[index];
if (sensor.unit >= UNIT_DATETIME)
return false;
@@ -354,7 +354,10 @@ bool isSwitchAvailable(int swtch, SwitchContext context)
}
if (swtch >= SWSRC_FIRST_SENSOR && swtch <= SWSRC_LAST_SENSOR) {
return isTelemetryFieldAvailable(swtch - SWSRC_FIRST_SENSOR);
if (context == GeneralCustomFunctionsContext)
return false;
else
return isTelemetryFieldAvailable(swtch - SWSRC_FIRST_SENSOR);
}
return true;
@@ -701,4 +704,4 @@ void editStickHardwareSettings(coord_t x, coord_t y, int idx, event_t event, Lcd
editName(x, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, event, flags);
else
lcdDrawMMM(x, y, flags);
}
}