mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 08:45:24 +03:00
Re #2469: part1: Menu system renaming of variables and refactoring (ported #3087 from master commits 3186a5d99..94d8b8b0e8d)
This commit is contained in:
parent
ab99740e1b
commit
51b8f9b054
96 changed files with 2150 additions and 2167 deletions
|
@ -616,23 +616,23 @@ Run function (key pressed)
|
|||
static int luaPopupInput(lua_State *L)
|
||||
{
|
||||
uint8_t event = luaL_checkinteger(L, 2);
|
||||
s_warning_input_value = luaL_checkinteger(L, 3);
|
||||
s_warning_input_min = luaL_checkinteger(L, 4);
|
||||
s_warning_input_max = luaL_checkinteger(L, 5);
|
||||
s_warning = luaL_checkstring(L, 1);
|
||||
s_warning_type = WARNING_TYPE_INPUT;
|
||||
warningInputValue = luaL_checkinteger(L, 3);
|
||||
warningInputValueMin = luaL_checkinteger(L, 4);
|
||||
warningInputValueMax = luaL_checkinteger(L, 5);
|
||||
warningText = luaL_checkstring(L, 1);
|
||||
warningType = WARNING_TYPE_INPUT;
|
||||
displayWarning(event);
|
||||
if (s_warning_result) {
|
||||
s_warning_result = 0;
|
||||
if (warningResult) {
|
||||
warningResult = 0;
|
||||
lua_pushstring(L, "OK");
|
||||
}
|
||||
else if (!s_warning) {
|
||||
else if (!warningText) {
|
||||
lua_pushstring(L, "CANCEL");
|
||||
}
|
||||
else {
|
||||
lua_pushinteger(L, s_warning_input_value);
|
||||
lua_pushinteger(L, warningInputValue);
|
||||
}
|
||||
s_warning = NULL;
|
||||
warningText = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -481,10 +481,10 @@ void displayLuaError(const char * title)
|
|||
|
||||
void displayAcknowledgeLuaError(evt_t event)
|
||||
{
|
||||
s_warning_result = false;
|
||||
displayLuaError(s_warning);
|
||||
warningResult = false;
|
||||
displayLuaError(warningText);
|
||||
if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||
s_warning = NULL;
|
||||
warningText = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ void luaError(uint8_t error, bool acknowledge)
|
|||
}
|
||||
|
||||
if (acknowledge) {
|
||||
s_warning = errorTitle;
|
||||
warningText = errorTitle;
|
||||
popupFunc = displayAcknowledgeLuaError;
|
||||
}
|
||||
else {
|
||||
|
@ -664,9 +664,9 @@ bool luaDoOneRunPermanentScript(uint8_t evt, int i, uint32_t scriptType)
|
|||
#endif
|
||||
if ((scriptType & RUN_TELEM_FG_SCRIPT) &&
|
||||
#if defined(COLORLCD)
|
||||
(g_menuStack[0]==menuMainView && sid.reference==SCRIPT_TELEMETRY_FIRST+g_eeGeneral.view-VIEW_TELEM1)) {
|
||||
(menuHandlers[0]==menuMainView && sid.reference==SCRIPT_TELEMETRY_FIRST+g_eeGeneral.view-VIEW_TELEM1)) {
|
||||
#else
|
||||
(g_menuStack[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
|
||||
(menuHandlers[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
|
||||
#endif
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
||||
lua_pushinteger(L, evt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue