... | ... |
@@ -10,7 +10,7 @@ Hat down | look down | zoom out | trim elevator down | |
10 | 10 |
Hat left | look left | reset FoV + heading | trim rudder left | trim aileron left |
11 | 11 |
Hat right | look right | reset FoV | trim rudder right | trim aileron right |
12 | 12 |
|
13 |
-Button 2 | heli view | permanent heli view | | |
|
13 |
+Button 2 | heli view | permanent heli view | show/hide pins | declutter pins |
|
14 | 14 |
Button 3 | brakes | | | |
15 | 15 |
Button 4 | PTT COMM 1 | PTT COMM 2 | | |
16 | 16 |
Button 5 | flaps down | inHg += 0.01 | | |
... | ... |
@@ -99,20 +99,72 @@ state when back to normal view |
99 | 99 |
joystick_button = { |
100 | 100 |
2 : func (pressed) { |
101 | 101 |
if (pressed) { |
102 |
+ if (getprop(pressed_button[10])) { |
|
103 |
+ setprop("/sim/marker-pins/master", !getprop("/sim/marker-pins/master")); |
|
104 |
+ } |
|
105 |
+ elsif (getprop(pressed_button[11])) { |
|
106 |
+ var clutter = { |
|
107 |
+ "airports": 1, |
|
108 |
+ "pois" : 2, |
|
109 |
+ "traffic" : 4, |
|
110 |
+ "navaids" : 8, |
|
111 |
+ "fixes" : 16 |
|
112 |
+ }; |
|
113 |
+ var clutter_sum = 0; |
|
114 |
+ foreach (var c; keys(clutter)) { |
|
115 |
+ clutter_sum += getprop("/sim/marker-pins/" ~ c) * clutter[c] |
|
116 |
+ } |
|
117 |
+ if (clutter_sum == 1) { |
|
118 |
+ setprop("/sim/marker-pins/fixes", 0); |
|
119 |
+ setprop("/sim/marker-pins/navaids", 0); |
|
120 |
+ setprop("/sim/marker-pins/airports", 1); |
|
121 |
+ setprop("/sim/marker-pins/pois", 1); |
|
122 |
+ setprop("/sim/marker-pins/traffic", 0); |
|
123 |
+ gui.popupTip("Pins: AIRPORTS + POI", 1); |
|
124 |
+ } |
|
125 |
+ elsif (clutter_sum == 3) { |
|
126 |
+ setprop("/sim/marker-pins/fixes", 0); |
|
127 |
+ setprop("/sim/marker-pins/navaids", 0); |
|
128 |
+ setprop("/sim/marker-pins/airports", 0); |
|
129 |
+ setprop("/sim/marker-pins/pois", 0); |
|
130 |
+ setprop("/sim/marker-pins/traffic", 1); |
|
131 |
+ gui.popupTip("Pins: TRAFFIC", 1); |
|
132 |
+ } |
|
133 |
+ elsif (clutter_sum == 4) { |
|
134 |
+ setprop("/sim/marker-pins/fixes", 1); |
|
135 |
+ setprop("/sim/marker-pins/navaids", 1); |
|
136 |
+ setprop("/sim/marker-pins/airports", 1); |
|
137 |
+ setprop("/sim/marker-pins/pois", 0); |
|
138 |
+ setprop("/sim/marker-pins/traffic", 0); |
|
139 |
+ gui.popupTip("Pins: AIRPORTS + NAVAIDS + FIXES", 1); |
|
140 |
+ } |
|
141 |
+ else { |
|
142 |
+ setprop("/sim/marker-pins/fixes", 0); |
|
143 |
+ setprop("/sim/marker-pins/navaids", 0); |
|
144 |
+ setprop("/sim/marker-pins/airports", 1); |
|
145 |
+ setprop("/sim/marker-pins/pois", 0); |
|
146 |
+ setprop("/sim/marker-pins/traffic", 0); |
|
147 |
+ gui.popupTip("Pins: AIRPORTS", 1); |
|
148 |
+ } |
|
149 |
+ setprop("/sim/marker-pins/master", 1); |
|
150 |
+ } |
|
151 |
+ elsif (getprop(pressed_button[0])) { |
|
152 |
+ locked_view = 1; |
|
153 |
+ setprop("/sim/current-view/view-number", pressed); |
|
154 |
+ } |
|
155 |
+ else { |
|
156 |
+ locked_view = 0; |
|
157 |
+ setprop("/devices/status/mice/mouse[0]/mode", previousMouseMode); |
|
158 |
+ setprop("/sim/current-view/view-number", pressed); |
|
159 |
+ } |
|
160 |
+ } |
|
161 |
+ else { |
|
102 | 162 |
if (getprop("/sim/current-view/view-number") > 1 or locked_view) |
103 | 163 |
return; |
104 | 164 |
previousMouseMode = getprop("/devices/status/mice/mouse[0]/mode"); |
105 | 165 |
setprop("/devices/status/mice/mouse[0]/mode", 2); |
166 |
+ setprop("/sim/current-view/view-number", pressed); |
|
106 | 167 |
} |
107 |
- elsif (getprop(pressed_button[0])) { |
|
108 |
- locked_view = 1; |
|
109 |
- return; |
|
110 |
- } |
|
111 |
- else { |
|
112 |
- locked_view = 0; |
|
113 |
- setprop("/devices/status/mice/mouse[0]/mode", previousMouseMode); |
|
114 |
- } |
|
115 |
- setprop("/sim/current-view/view-number", pressed); |
|
116 | 168 |
}, |
117 | 169 |
|
118 | 170 |
3 : func (pressed) { |