ec130-options-dialog.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <?xml version="1.0"?>
  2. <!-- Eurocopter EC 130 Helicopter by Heiko Schulz, Michael Habarta
  3. This file is part of FlightGear, the free flight simulator
  4. http://www.flightgear.org/
  5. Copyright (C) 2009 Heiko Schulz, Heiko.H.Schulz@gmx.net
  6. (C) 2016 Michael Habarta, mhabarta@freenet.de
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. -->
  16. <PropertyList>
  17. <name>Options</name>
  18. <layout>vbox</layout>
  19. <resizable>false</resizable>
  20. <modal>false</modal>
  21. <draggable>true</draggable>
  22. <default-padding>3</default-padding>
  23. <nasal>
  24. <open>
  25. <!-- disable shadow if rembrandt enabled -->
  26. if ( getprop("/sim/rendering/rembrandt/enabled")) {
  27. setprop("sim/model/ec130/shadow",0);
  28. }
  29. <!-- init windscreen option -->
  30. var p = getprop("/sim/model/ec130/cockpit-windscreen-option");
  31. setprop("/sim/model/ec130/cockpit_windscreen_flag_0",0);
  32. setprop("/sim/model/ec130/cockpit_windscreen_flag_1",0);
  33. setprop("/sim/model/ec130/cockpit_windscreen_flag_2",0);
  34. if ( p == 0 ) { setprop("/sim/model/ec130/cockpit_windscreen_flag_0",1); }
  35. if ( p == 1 ) { setprop("/sim/model/ec130/cockpit_windscreen_flag_1",1); }
  36. if ( p == 2 ) { setprop("/sim/model/ec130/cockpit_windscreen_flag_2",1); }
  37. <!-- init light cone visible -->
  38. var p = getprop("/sim/model/searchlight/cone-visibility");
  39. setprop("/sim/model/searchlight/cone_flag_0",0);
  40. setprop("/sim/model/searchlight/cone_flag_1",0);
  41. setprop("/sim/model/searchlight/cone_flag_2",0);
  42. setprop("/sim/model/searchlight/cone_flag_3",0);
  43. if ( p == 0 ) { setprop("/sim/model/searchlight/cone_flag_0",1); }
  44. if ( p == 1 ) { setprop("/sim/model/searchlight/cone_flag_1",1); }
  45. if ( p == 2 ) { setprop("/sim/model/searchlight/cone_flag_2",1); }
  46. if ( p == 3 ) { setprop("/sim/model/searchlight/cone_flag_3",1); }
  47. <!-- init wakevisible -->
  48. var p = getprop("rotors/main/wakevisible");
  49. setprop("rotors/main/wake_flag_0",0);
  50. setprop("rotors/main/wake_flag_1",0);
  51. setprop("rotors/main/wake_flag_2",0);
  52. setprop("rotors/main/wake_flag_3",0);
  53. if ( p == 0 ) { setprop("rotors/main/wake_flag_0",1); }
  54. if ( p == 1 ) { setprop("rotors/main/wake_flag_1",1); }
  55. if ( p == 2 ) { setprop("rotors/main/wake_flag_2",1); }
  56. if ( p == 3 ) { setprop("rotors/main/wake_flag_3",1); }
  57. <!-- set title -->
  58. if ( getprop("/sim/model/variant") == "1" ) {
  59. setprop("/sim/gui/dialogs/ec130/options/dialog/group/text/label", "EC130-B4 Simulation Options (AltGr-o)");
  60. } else {
  61. setprop("/sim/gui/dialogs/ec130/options/dialog/group/text/label", " H130 Simulation Options (AltGr-o)");
  62. }
  63. </open>
  64. <close># just kept for educational purposes :-)</close>
  65. </nasal>
  66. <!-- Title with Esc knob for closing -->
  67. <group>
  68. <layout>hbox</layout>
  69. <empty><stretch>1</stretch></empty>
  70. <!-- title is set through nasal script above -->
  71. <text>
  72. <label>x</label>
  73. </text>
  74. <empty><stretch>true</stretch></empty>
  75. <button>
  76. <legend></legend>
  77. <key>Esc</key>
  78. <pref-width>16</pref-width>
  79. <pref-height>16</pref-height>
  80. <binding>
  81. <command>nasal</command>
  82. <script>ec130.options_dialog.toggle()</script>
  83. </binding>
  84. </button>
  85. </group>
  86. <hrule/>
  87. <group>
  88. <layout>table</layout>
  89. <default-padding>5</default-padding>
  90. <halign>left</halign>
  91. <!-- only to get a gap between left border and checkbox -->
  92. <text>
  93. <row>0</row>
  94. <col>0</col>
  95. <label> </label>
  96. <halign>left</halign>
  97. </text>
  98. <checkbox>
  99. <row>0</row>
  100. <col>1</col>
  101. <halign>left</halign>
  102. <label> Shadow enabled (if Rembrandt OFF)</label>
  103. <property>sim/model/ec130/shadow</property>
  104. <live>true</live>
  105. <enable>
  106. <not>
  107. <property>/sim/rendering/rembrandt/enabled</property>
  108. </not>
  109. </enable>
  110. <binding>
  111. <command>dialog-apply</command>
  112. </binding>
  113. </checkbox>
  114. </group>
  115. <!-- only to get a empty line before next -->
  116. <text>
  117. <label> -----------------------</label>
  118. <halign>left</halign>
  119. </text>
  120. <text>
  121. <label> Windscreen:</label>
  122. <halign>left</halign>
  123. </text>
  124. <group>
  125. <layout>table</layout>
  126. <default-padding>5</default-padding>
  127. <halign>left</halign>
  128. <!-- only to get a gap between left border and checkbox -->
  129. <text>
  130. <row>0</row>
  131. <col>0</col>
  132. <label> </label>
  133. <halign>left</halign>
  134. </text>
  135. <radio>
  136. <row>0</row>
  137. <col>1</col>
  138. <halign>left</halign>
  139. <label> clear</label>
  140. <property>sim/model/ec130/cockpit_windscreen_flag_0</property>
  141. <live>true</live>
  142. <binding>
  143. <command>dialog-apply</command>
  144. </binding>
  145. <binding>
  146. <command>nasal</command>
  147. <script>
  148. <!--
  149. setprop("sim/model/ec130/cockpit_windscreen_flag_0",0);
  150. -->
  151. setprop("sim/model/ec130/cockpit_windscreen_flag_1",0);
  152. setprop("sim/model/ec130/cockpit_windscreen_flag_2",0);
  153. setprop("sim/model/ec130/cockpit-windscreen-option",0);
  154. </script>
  155. </binding>
  156. </radio>
  157. <radio>
  158. <row>0</row>
  159. <col>2</col>
  160. <halign>left</halign>
  161. <label> visible</label>
  162. <property>sim/model/ec130/cockpit_windscreen_flag_1</property>
  163. <live>true</live>
  164. <binding>
  165. <command>dialog-apply</command>
  166. </binding>
  167. <binding>
  168. <command>nasal</command>
  169. <script>
  170. setprop("sim/model/ec130/cockpit_windscreen_flag_0",0);
  171. <!--
  172. setprop("sim/model/ec130/cockpit_windscreen_flag_1",0);
  173. -->
  174. setprop("sim/model/ec130/cockpit_windscreen_flag_2",0);
  175. setprop("sim/model/ec130/cockpit-windscreen-option",1);
  176. </script>
  177. </binding>
  178. </radio>
  179. <radio>
  180. <row>0</row>
  181. <col>3</col>
  182. <halign>left</halign>
  183. <label> reflections</label>
  184. <property>sim/model/ec130/cockpit_windscreen_flag_2</property>
  185. <live>true</live>
  186. <binding>
  187. <command>dialog-apply</command>
  188. </binding>
  189. <binding>
  190. <command>nasal</command>
  191. <script>
  192. setprop("sim/model/ec130/cockpit_windscreen_flag_0",0);
  193. setprop("sim/model/ec130/cockpit_windscreen_flag_1",0);
  194. <!--
  195. setprop("sim/model/ec130/cockpit_windscreen_flag_2",0);
  196. -->
  197. setprop("sim/model/ec130/cockpit-windscreen-option",2);
  198. </script>
  199. </binding>
  200. </radio>
  201. </group>
  202. <!-- only to get a empty line before next -->
  203. <text>
  204. <label> -----------------------</label>
  205. <halign>left</halign>
  206. </text>
  207. <text>
  208. <label> Light-Cone Visibility: (Alt-L)</label>
  209. <halign>left</halign>
  210. <enable>
  211. <property>controls/electric/engine/generator</property>
  212. <property>/sim/model/searchlight/active</property>
  213. </enable>
  214. </text>
  215. <group>
  216. <layout>table</layout>
  217. <default-padding>5</default-padding>
  218. <halign>left</halign>
  219. <!-- only to get a gap between left border and checkbox -->
  220. <text>
  221. <row>0</row>
  222. <col>0</col>
  223. <label> </label>
  224. <halign>left</halign>
  225. </text>
  226. <text>
  227. <row>0</row>
  228. <col>1</col>
  229. <label> </label>
  230. <halign>left</halign>
  231. </text>
  232. <radio>
  233. <row>0</row>
  234. <col>2</col>
  235. <halign>left</halign>
  236. <label> invisible</label>
  237. <property>/sim/model/searchlight/cone_flag_0</property>
  238. <live>true</live>
  239. <binding>
  240. <command>dialog-apply</command>
  241. </binding>
  242. <binding>
  243. <command>nasal</command>
  244. <script>
  245. setprop("/sim/model/searchlight/cone-visibility",0);
  246. <!--
  247. setprop("/sim/model/searchlight/cone_flag_0",0);
  248. -->
  249. setprop("/sim/model/searchlight/cone_flag_1",0);
  250. setprop("/sim/model/searchlight/cone_flag_2",0);
  251. setprop("/sim/model/searchlight/cone_flag_3",0);
  252. </script>
  253. </binding>
  254. </radio>
  255. <radio>
  256. <row>0</row>
  257. <col>3</col>
  258. <halign>left</halign>
  259. <label> low</label>
  260. <property>/sim/model/searchlight/cone_flag_1</property>
  261. <live>true</live>
  262. <binding>
  263. <command>dialog-apply</command>
  264. </binding>
  265. <binding>
  266. <command>nasal</command>
  267. <script>
  268. setprop("/sim/model/searchlight/cone-visibility",1);
  269. setprop("/sim/model/searchlight/cone_flag_0",0);
  270. <!--
  271. setprop("/sim/model/searchlight/cone_flag_1",0);
  272. -->
  273. setprop("/sim/model/searchlight/cone_flag_2",0);
  274. setprop("/sim/model/searchlight/cone_flag_3",0);
  275. </script>
  276. </binding>
  277. </radio>
  278. <radio>
  279. <row>1</row>
  280. <col>2</col>
  281. <halign>left</halign>
  282. <label> medium</label>
  283. <property>/sim/model/searchlight/cone_flag_2</property>
  284. <live>true</live>
  285. <binding>
  286. <command>dialog-apply</command>
  287. </binding>
  288. <binding>
  289. <command>nasal</command>
  290. <script>
  291. setprop("/sim/model/searchlight/cone-visibility",2);
  292. setprop("/sim/model/searchlight/cone_flag_0",0);
  293. setprop("/sim/model/searchlight/cone_flag_1",0);
  294. <!--
  295. setprop("/sim/model/searchlight/cone_flag_2",0);
  296. -->
  297. setprop("/sim/model/searchlight/cone_flag_3",0);
  298. </script>
  299. </binding>
  300. </radio>
  301. <radio>
  302. <row>1</row>
  303. <col>3</col>
  304. <halign>left</halign>
  305. <label> bright </label>
  306. <property>/sim/model/searchlight/cone_flag_3</property>
  307. <live>true</live>
  308. <binding>
  309. <command>dialog-apply</command>
  310. </binding>
  311. <binding>
  312. <command>nasal</command>
  313. <script>
  314. setprop("/sim/model/searchlight/cone-visibility",3);
  315. setprop("/sim/model/searchlight/cone_flag_0",0);
  316. setprop("/sim/model/searchlight/cone_flag_1",0);
  317. setprop("/sim/model/searchlight/cone_flag_2",0);
  318. <!--
  319. setprop("/sim/model/searchlight/cone_flag_3",0);
  320. -->
  321. </script>
  322. </binding>
  323. </radio>
  324. </group>
  325. <!-- only to get a empty line before next -->
  326. <text>
  327. <label> -----------------------</label>
  328. <halign>left</halign>
  329. </text>
  330. <text>
  331. <label> Rotor Wake Visibility: (Alt-k)</label>
  332. <halign>left</halign>
  333. </text>
  334. <group>
  335. <layout>table</layout>
  336. <default-padding>5</default-padding>
  337. <halign>left</halign>
  338. <!-- only to get a gap between left border and checkbox -->
  339. <text>
  340. <row>0</row>
  341. <col>0</col>
  342. <label> </label>
  343. <halign>left</halign>
  344. </text>
  345. <text>
  346. <row>0</row>
  347. <col>1</col>
  348. <label> </label>
  349. <halign>left</halign>
  350. </text>
  351. <radio>
  352. <row>0</row>
  353. <col>2</col>
  354. <halign>left</halign>
  355. <label> invisible</label>
  356. <property>rotors/main/wake_flag_0</property>
  357. <live>true</live>
  358. <binding>
  359. <command>dialog-apply</command>
  360. </binding>
  361. <binding>
  362. <command>nasal</command>
  363. <script>
  364. setprop("rotors/main/wakevisible",0);
  365. gui.popupTip("Wake invisible");
  366. <!--
  367. setprop("rotors/main/wake_flag_0",0);
  368. -->
  369. setprop("rotors/main/wake_flag_1",0);
  370. setprop("rotors/main/wake_flag_2",0);
  371. setprop("rotors/main/wake_flag_3",0);
  372. </script>
  373. </binding>
  374. </radio>
  375. <radio>
  376. <row>0</row>
  377. <col>3</col>
  378. <halign>left</halign>
  379. <label> low</label>
  380. <property>rotors/main/wake_flag_1</property>
  381. <live>true</live>
  382. <binding>
  383. <command>dialog-apply</command>
  384. </binding>
  385. <binding>
  386. <command>nasal</command>
  387. <script>
  388. setprop("rotors/main/wakevisible",1);
  389. gui.popupTip("Wake low");
  390. setprop("rotors/main/wake_flag_0",0);
  391. <!--
  392. setprop("rotors/main/wake_flag_1",0);
  393. -->
  394. setprop("rotors/main/wake_flag_2",0);
  395. setprop("rotors/main/wake_flag_3",0);
  396. </script>
  397. </binding>
  398. </radio>
  399. <radio>
  400. <row>1</row>
  401. <col>2</col>
  402. <halign>left</halign>
  403. <label> medium</label>
  404. <property>rotors/main/wake_flag_2</property>
  405. <live>true</live>
  406. <binding>
  407. <command>dialog-apply</command>
  408. </binding>
  409. <binding>
  410. <command>nasal</command>
  411. <script>
  412. setprop("rotors/main/wakevisible",2);
  413. gui.popupTip("Wake medium");
  414. setprop("rotors/main/wake_flag_0",0);
  415. setprop("rotors/main/wake_flag_1",0);
  416. <!--
  417. setprop("rotors/main/wake_flag_2",0);
  418. -->
  419. setprop("rotors/main/wake_flag_3",0);
  420. </script>
  421. </binding>
  422. </radio>
  423. <radio>
  424. <row>1</row>
  425. <col>3</col>
  426. <halign>left</halign>
  427. <label> heavy (dynamic)</label>
  428. <property>rotors/main/wake_flag_3</property>
  429. <live>true</live>
  430. <binding>
  431. <command>dialog-apply</command>
  432. </binding>
  433. <binding>
  434. <command>nasal</command>
  435. <script>
  436. setprop("rotors/main/wakevisible",3);
  437. gui.popupTip("Wake heavy");
  438. setprop("rotors/main/wake_flag_0",0);
  439. setprop("rotors/main/wake_flag_1",0);
  440. setprop("rotors/main/wake_flag_2",0);
  441. <!--
  442. setprop("rotors/main/wake_flag_3",0);
  443. -->
  444. </script>
  445. </binding>
  446. </radio>
  447. </group>
  448. <hrule/>
  449. <group>
  450. <layout>hbox</layout>
  451. <default-padding>3</default-padding>
  452. <button>
  453. <legend>Close</legend>
  454. <equal>true</equal>
  455. <key>Esc</key>
  456. <default>true</default>
  457. <binding>
  458. <command>nasal</command>
  459. <script>ec130.options_dialog.toggle()</script>
  460. </binding>
  461. </button>
  462. </group>
  463. </PropertyList>