@@ -48,6 +48,32 @@ let categoryTable = [
48
48
{ name : 'VTX' , buildKey : [ 'vtx' ] , modes : [ 'STICK COMMANDS DISABLE' , 'VTX CONTROL DISABLE' , 'VTX PIT MODE' ] } ,
49
49
] ;
50
50
51
+ function isInBuildKey ( map , name ) {
52
+ if ( name === 'all' ) {
53
+ return true ;
54
+ }
55
+ for ( let i = 0 ; i < map . length ; i ++ ) {
56
+ if ( name == map [ i ] . buildKey ) {
57
+ return FC . CONFIG . buildOptions . includes ( map [ i ] . buildOption ) ;
58
+ }
59
+ }
60
+ return false ;
61
+ }
62
+
63
+ function isFlightMode ( name ) {
64
+ return flightModes . includes ( name ) ;
65
+ }
66
+
67
+ function createCategorySelect ( table ) {
68
+ let categorySelect = $ ( 'select.auxiliary_category_select' ) ;
69
+
70
+ for ( let i = 0 ; i < table . length ; i ++ ) {
71
+ if ( isInBuildKey ( buildMap , table [ i ] . buildKey ) ) {
72
+ categorySelect . append ( `<option value="${ table [ i ] . name } ">${ table [ i ] . name } </option>` ) ;
73
+ }
74
+ }
75
+ }
76
+
51
77
function createTable ( data ) {
52
78
// Create a dynamic table with fixed values
53
79
let table = [ ] ;
@@ -104,29 +130,6 @@ The simulateMouseoverAndSelectForEachOption function iterates over each option i
104
130
You can also add a delay between each iteration if needed (commented out in the code). Adjust the delay according to your requirements.
105
131
*/
106
132
107
- function isInBuildKey ( map , name ) {
108
-
109
- if ( name === 'all' ) {
110
- return true ;
111
- }
112
- for ( let i = 0 ; i < map . length ; i ++ ) {
113
- return flightModes . includes ( name ) ;
114
- }
115
- }
116
-
117
- function isFlightMode ( name ) {
118
- return flightModes . includes ( name ) ;
119
- }
120
-
121
- function createCategorySelect ( table ) {
122
- let categorySelect = $ ( 'select.auxiliary_category_select' ) ;
123
-
124
- for ( let i = 0 ; i < table . length ; i ++ ) {
125
- if ( isInBuildKey ( buildMap , table [ i ] . buildKey ) ) {
126
- categorySelect . append ( `<option value="${ table [ i ] . name } ">${ table [ i ] . name } </option>` ) ;
127
- }
128
- }
129
- }
130
133
131
134
auxiliary . initialize = function ( callback ) {
132
135
GUI . active_tab_ref = this ;
0 commit comments