Review handling is global function detection.
Fixes !sensor been selectable in global scripts Thanks to @Max for his help
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user