Repository navigation
Hide VTXAdmin lua fields if disabled - #3608
Conversation
We could make it reload FOLDER and COMMAND types as well, just make the check Line 678 in 34a6888 |
Yeah we could but we can't. What I was trying to say is that we can't rely on people updating their Lua, therefore we have to code this in the safer way which is assuming that the user did not update their Lua. If the user:
That's why I chose to keep Send VTX always visible, because I'd rather have it always visible regardless of how old the lua script is so there isn't a "blame the user for not updating" issue. Having it visible all the time isn't as bad as it not working and then telling them it is their fault. EDIT: Or do you think I should change the lua as well so it refreshes commands, then we circle back to that line of code in a year or two and assume that folks will have updated their lua at least once in that time? I made it not refresh commands back in the day in order to make the update as fast as possible and didn't consider visibility changes at the time since we didn't really use them at all back then. |
|
Yeah, if we do both then it works nicer for folk that do update their Lua script. And the lazy sods see the error message. |
But the issue is that the initial state when turning it on has Send VTX hidden. When you turn it on, you don't see the Send VTX at all because it isn't refreshing, so the user will just think it isn't working because their change can't be committed to the VTX. |
Ah, I see what you are saying now. If the admin is disabled and the button is hidden, then they enable admin we don't refresh the button in the Lua (cause they haven't upgraded), so they don't see the button till they exit the Lua script, then come back. Guess they really should follow the upgrade instructions and update the Lua then too 😓 |
mha1
left a comment
There was a problem hiding this comment.
Works as advertised on T15/Nomad
Hides the
VTX Channel,VTX Power,VTX Pit Modefields if VTX Admin is disabled. Also changes "Off" option to "Disabled" and the label to include the fact thatBandis also used to enable the feature.Details
It has come to my attention now from a couple different people that they did not understand that setting the Band to Off in VTX Admin disabled the feature, opting to jump straight to the "Channel" field and then being confused why it never worked. Who can blame them, there's really just 1 band as far as anyone is concerned. This tries to make it clearer by hiding the Channel field until the Band is set, and updating the label to assist in that discovery.
I'd love to hide
[Send VTX]as well, but the lua doesn't check COMMAND type fields for updates when a value changes. We could also change that, but I can see that being a major issue if most don't update their lua and suddenly Send VTX isn't there unless they exit and come back.Instead, when you
[Send VTX]now instead of sayingSending...it will sayNot enabled. This is better than nothing?B&W Screens
The new "Band/Enable" label has 1 space after it before the value so this still fits. I'm open to changing this label but it has to be at most this many characters.