-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rates type support #365
Rates type support #365
Conversation
Wow! Awesome work @klutvott123 , thankyou! |
4ffb6d9
to
dd5c220
Compare
@asizon Thanks! 😸 |
src/SCRIPTS/BF/ui.lua
Outdated
@@ -358,6 +358,7 @@ local function run_ui(event) | |||
end | |||
elseif pageState == pageStatus.editing then | |||
if event == EVT_VIRTUAL_EXIT or event == EVT_VIRTUAL_ENTER then | |||
pcall(Page.fields[currentField].postEdit, Page) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the pcall()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just prevents the script from crashing if the field doesn't have postEdit
.
Could have done this too
if Page.fields[currentField].postEdit then
Page.fields[currentField].postEdit(Page)
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think this is a better way, as it is more specific. Otherwise any error that snuck into a postEdit()
function could go undetected for a long time, causing debug nightmares.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'll change it
Nicely done! |
Adds support for changing rates type.
dd5c220
to
4974c94
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Adds support for changing rates type.
Works like in the configurator. Changes labels, scaling, min, max, and applies default values for the selected rates type.
For testing: betaflight-tx-lua-scripts_1.5.0.zip