Some improvements to the popup menu and the confirmation page functionality.
The popup menu can now be opened by long pressing enter on the main menu and on the page view. The menu is now created on demand so that we can populate it with different items depending on the uiState we're in.
Now we can do this:
and this:
Made a new state uiStatus.confirm for the confirmation dialogue.
Added a confirmation dialogue for downloading vtx tables too.
Changed the behaviour a little so that after calibrating the accelerometer or downloading vtx tables the script will return to the previous uiState on completion. This just makes the user experience a little nicer. The old behaviour was that it returned to the main menu.
Removed getSensorValue and simplified modelActive a lot. This code was a lot more complicated than it had to be.
Moved all lcd writing to ui.lua. ui_init.lua and all the functions called by it will now return a table containing a function and a string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some improvements to the popup menu and the confirmation page functionality.
The popup menu can now be opened by long pressing enter on the main menu and on the page view. The menu is now created on demand so that we can populate it with different items depending on the uiState we're in.
Now we can do this:

and this:

Made a new state uiStatus.confirm for the confirmation dialogue.

Added a confirmation dialogue for downloading vtx tables too.
Changed the behaviour a little so that after calibrating the accelerometer or downloading vtx tables the script will return to the previous uiState on completion. This just makes the user experience a little nicer. The old behaviour was that it returned to the main menu.
Removed getSensorValue and simplified modelActive a lot. This code was a lot more complicated than it had to be.
Moved all lcd writing to ui.lua. ui_init.lua and all the functions called by it will now return a table containing a function and a string.
Test version here:
betaflight-tx-lua-scripts_1.5.0.zip