ec130-model-info-dialog.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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>Model_Info</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. <!-- flag for open dialog -->
  26. setprop("/sim/model/ec130/info_dialog_active",1);
  27. <!-- set path / title -->
  28. if ( getprop("/sim/model/variant") == "1" ) {
  29. var path = getprop("/sim/aircraft-dir") ~ "/Models/Liveries_ec130b4/";
  30. setprop("/sim/gui/dialogs/ec130/model_info/dialog/group/text/label", "EC130-B4 Operator/Model Info (Alt-i)");
  31. } else {
  32. var path = getprop("/sim/aircraft-dir") ~ "/Models/Liveries_ec130t2/";
  33. setprop("/sim/gui/dialogs/ec130/model_info/dialog/group/text/label", "H130 Operator/Model Info (Alt-i)");
  34. }
  35. var info_filename = path ~ getprop("sim/model/livery/file") ~ ".txt";
  36. setprop("/sim/model/ec130/model-info", io.readfile(info_filename));
  37. </open>
  38. <close># just kept for educational purposes :-)</close>
  39. </nasal>
  40. <!-- Title with Esc knob for closing -->
  41. <group>
  42. <layout>hbox</layout>
  43. <empty><stretch>1</stretch></empty>
  44. <!-- title is set through nasal script above -->
  45. <text>
  46. <label>x</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>
  57. if ( getprop("/sim/model/ec130/config_dialog_active") ) {
  58. ec130.config_dialog.toggle();
  59. }
  60. ec130.model_info_dialog.toggle();
  61. setprop("/sim/model/ec130/info_dialog_active",0);
  62. </script>
  63. </binding>
  64. </button>
  65. </group>
  66. <hrule/>
  67. <group>
  68. <layout>table</layout>
  69. <default-padding>5</default-padding>
  70. <halign>center</halign>
  71. <!-- only to get a gap between left border and checkbox -->
  72. <text>
  73. <row>0</row>
  74. <col>0</col>
  75. <label></label>
  76. <halign>left</halign>
  77. </text>
  78. <textbox>
  79. <row>0</row>
  80. <col>1</col>
  81. <!-- dimensions -->
  82. <stretch>true</stretch>
  83. <pref-width>900</pref-width>
  84. <pref-height>550</pref-height>
  85. <halign>fill</halign>
  86. <valign>fill</valign>
  87. <property>/sim/model/ec130/model-info</property>
  88. <slider>20</slider>
  89. <wrap>false</wrap>
  90. <top-line>0</top-line>
  91. <editable>false</editable>
  92. </textbox>
  93. </group>
  94. <hrule/>
  95. <group>
  96. <layout>hbox</layout>
  97. <default-padding>3</default-padding>
  98. <button>
  99. <legend>Close</legend>
  100. <equal>true</equal>
  101. <key>Esc</key>
  102. <default>true</default>
  103. <binding>
  104. <command>nasal</command>
  105. <script>
  106. if ( getprop("/sim/model/ec130/config_dialog_active") ) {
  107. ec130.config_dialog.toggle();
  108. }
  109. ec130.model_info_dialog.toggle();
  110. setprop("/sim/model/ec130/info_dialog_active",0);
  111. </script>
  112. </binding>
  113. </button>
  114. </group>
  115. </PropertyList>