searchlight-options-dialog.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?xml version="1.0"?>
  2. <!-- Searchlight Options Dialog
  3. This file is part of FlightGear, the free flight simulator
  4. http://www.flightgear.org/
  5. Copyright (C) 2014 Michael Habarta, mhabarta@freenet.de
  6. animations, search light effects
  7. Lightcones are based on the lightcone of the Alphajet
  8. done by BARANGER Emmanuel: email: embaranger@free.fr
  9. aka helijah in the FG world
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License as
  12. published by the Free Software Foundation; either version 2 of the
  13. License, or (at your option) any later version.
  14. This program is distributed in the hope that it will be useful, but
  15. WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. General Public License for more details.
  18. -->
  19. <PropertyList>
  20. <name>Searchlight-Options</name>
  21. <layout>vbox</layout>
  22. <resizable>false</resizable>
  23. <modal>false</modal>
  24. <draggable>true</draggable>
  25. <default-padding>3</default-padding>
  26. <nasal>
  27. <open>
  28. <!-- init light cone visible -->
  29. var p = getprop("/sim/model/searchlight/cone-visibility");
  30. setprop("/sim/model/searchlight/cone_flag_0",0);
  31. setprop("/sim/model/searchlight/cone_flag_1",0);
  32. setprop("/sim/model/searchlight/cone_flag_2",0);
  33. setprop("/sim/model/searchlight/cone_flag_3",0);
  34. if ( p == 0 ) { setprop("/sim/model/searchlight/cone_flag_0",1); }
  35. if ( p == 1 ) { setprop("/sim/model/searchlight/cone_flag_1",1); }
  36. if ( p == 2 ) { setprop("/sim/model/searchlight/cone_flag_2",1); }
  37. if ( p == 3 ) { setprop("/sim/model/searchlight/cone_flag_3",1); }
  38. </open>
  39. <close># just kept for educational purposes :-)</close>
  40. </nasal>
  41. <!-- Title with Esc knob for closing -->
  42. <group>
  43. <layout>hbox</layout>
  44. <empty><stretch>1</stretch></empty>
  45. <text>
  46. <label>Searchlight Options (AltGr-s)</label>
  47. </text>
  48. <empty><stretch>true</stretch></empty>
  49. <button>
  50. <legend></legend>
  51. <key>Esc</key>
  52. <pref-width>16</pref-width>
  53. <pref-height>16</pref-height>
  54. <binding>
  55. <command>nasal</command>
  56. <script>ec130.searchlight_options_dialog.toggle()</script>
  57. </binding>
  58. </button>
  59. </group>
  60. <hrule/>
  61. <text>
  62. <label> Light-Cone Visibility: (Alt-L)</label>
  63. <halign>left</halign>
  64. <enable>
  65. <property>controls/electric/engine/generator</property>
  66. <property>/sim/model/searchlight/active</property>
  67. </enable>
  68. </text>
  69. <group>
  70. <layout>table</layout>
  71. <default-padding>5</default-padding>
  72. <halign>left</halign>
  73. <!-- only to get a gap between left border and checkbox -->
  74. <text>
  75. <row>0</row>
  76. <col>0</col>
  77. <label> </label>
  78. <halign>left</halign>
  79. </text>
  80. <text>
  81. <row>0</row>
  82. <col>1</col>
  83. <label> </label>
  84. <halign>left</halign>
  85. </text>
  86. <radio>
  87. <row>0</row>
  88. <col>2</col>
  89. <halign>left</halign>
  90. <label> invisible</label>
  91. <property>/sim/model/searchlight/cone_flag_0</property>
  92. <live>true</live>
  93. <binding>
  94. <command>dialog-apply</command>
  95. </binding>
  96. <binding>
  97. <command>nasal</command>
  98. <script>
  99. setprop("/sim/model/searchlight/cone-visibility",0);
  100. <!--
  101. setprop("/sim/model/searchlight/cone_flag_0",0);
  102. -->
  103. setprop("/sim/model/searchlight/cone_flag_1",0);
  104. setprop("/sim/model/searchlight/cone_flag_2",0);
  105. setprop("/sim/model/searchlight/cone_flag_3",0);
  106. </script>
  107. </binding>
  108. </radio>
  109. <radio>
  110. <row>0</row>
  111. <col>3</col>
  112. <halign>left</halign>
  113. <label> low</label>
  114. <property>/sim/model/searchlight/cone_flag_1</property>
  115. <live>true</live>
  116. <binding>
  117. <command>dialog-apply</command>
  118. </binding>
  119. <binding>
  120. <command>nasal</command>
  121. <script>
  122. setprop("/sim/model/searchlight/cone-visibility",1);
  123. setprop("/sim/model/searchlight/cone_flag_0",0);
  124. <!--
  125. setprop("/sim/model/searchlight/cone_flag_1",0);
  126. -->
  127. setprop("/sim/model/searchlight/cone_flag_2",0);
  128. setprop("/sim/model/searchlight/cone_flag_3",0);
  129. </script>
  130. </binding>
  131. </radio>
  132. <radio>
  133. <row>1</row>
  134. <col>2</col>
  135. <halign>left</halign>
  136. <label> medium</label>
  137. <property>/sim/model/searchlight/cone_flag_2</property>
  138. <live>true</live>
  139. <binding>
  140. <command>dialog-apply</command>
  141. </binding>
  142. <binding>
  143. <command>nasal</command>
  144. <script>
  145. setprop("/sim/model/searchlight/cone-visibility",2);
  146. setprop("/sim/model/searchlight/cone_flag_0",0);
  147. setprop("/sim/model/searchlight/cone_flag_1",0);
  148. <!--
  149. setprop("/sim/model/searchlight/cone_flag_2",0);
  150. -->
  151. setprop("/sim/model/searchlight/cone_flag_3",0);
  152. </script>
  153. </binding>
  154. </radio>
  155. <radio>
  156. <row>1</row>
  157. <col>3</col>
  158. <halign>left</halign>
  159. <label> bright </label>
  160. <property>/sim/model/searchlight/cone_flag_3</property>
  161. <live>true</live>
  162. <binding>
  163. <command>dialog-apply</command>
  164. </binding>
  165. <binding>
  166. <command>nasal</command>
  167. <script>
  168. setprop("/sim/model/searchlight/cone-visibility",3);
  169. setprop("/sim/model/searchlight/cone_flag_0",0);
  170. setprop("/sim/model/searchlight/cone_flag_1",0);
  171. setprop("/sim/model/searchlight/cone_flag_2",0);
  172. <!--
  173. setprop("/sim/model/searchlight/cone_flag_3",0);
  174. -->
  175. </script>
  176. </binding>
  177. </radio>
  178. </group>
  179. <hrule/>
  180. <group>
  181. <layout>hbox</layout>
  182. <default-padding>3</default-padding>
  183. <button>
  184. <legend>Close</legend>
  185. <equal>true</equal>
  186. <key>Esc</key>
  187. <default>true</default>
  188. <binding>
  189. <command>nasal</command>
  190. <script>ec130.searchlight_options_dialog.toggle()</script>
  191. </binding>
  192. </button>
  193. </group>
  194. </PropertyList>