<?xml version="1.0" encoding="ISO-8859-1"?>

<PropertyList>

  <name>config</name>
  <modal>false</modal>
  <layout>vbox</layout>
  <padding>80</padding>

  <group>
    <layout>hbox</layout>
    <empty>
      <stretch>1</stretch>
    </empty>
    <text>
      <label>D510 options</label>
    </text>
    <empty>
      <stretch>1</stretch>
    </empty>
    <button>
      <pref-width>16</pref-width>
      <pref-height>16</pref-height>
      <legend></legend>
      <keynum>27</keynum>
      <border>2</border>
      <binding>
        <command>nasal</command>
        <script>d510.load_dialog.toggle()</script>
      </binding>
      <binding>
        <command>dialog-close</command>
      </binding>
    </button>
  </group>

  <hrule/>

  <group>

    <halign>center</halign>
    <layout>hbox</layout>
    <checkbox>
      <halign>left</halign>
      <label>Show/Hide color tank</label>
      <!-- <property>/sim/model/show-tank</property> -->
      <property>sim/multiplay/generic/bool[1]</property>
      <binding>
        <command>property-toggle</command>
        <!-- <property>/sim/model/show-tank</property> -->
        <property>sim/multiplay/generic/bool[1]</property>
      </binding>
    </checkbox>

    <layout>vbox</layout>
    <padding>6</padding>
    <checkbox>
      <halign>left</halign>
      <label>Smoke On/Off</label>
      <!-- <property>sim/model/smokeOnOff</property> -->
      <property>sim/multiplay/generic/bool[6]</property>
      <live>true</live>
      <binding>
        <command>property-toggle</command>
        <!-- <property>sim/model/smokeOnOff</property> -->
        <property>sim/multiplay/generic/bool[6]</property>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </checkbox>

    <layout>vbox</layout>
    <padding>6</padding>
    <checkbox>
      <halign>left</halign>
      <label>Show/Hide Weapons</label>
      <!-- <property>sim/model/show-weapons</property> -->
      <property>sim/multiplay/generic/bool[7]</property>
      <live>true</live>
      <binding>
        <command>property-toggle</command>
        <!-- <property>sim/model/show-weapons</property> -->
        <property>sim/multiplay/generic/bool[7]</property>
      </binding>
      <binding>
        <condition>
          <not><property>sim/multiplay/generic/bool[7]</property></not>
        </condition>
        <command>property-assign</command>
        <!-- <property>controls/armament/master-arm</property> -->
        <property>sim/multiplay/generic/bool[0]</property>
        <value>0</value>
      </binding>
      <binding>
        <command>nasal</command>
        <script>
          screen.log.write("Master-arm "~(getprop("sim/multiplay/generic/bool[0]")==0?"OFF":"ON"), 1, 0, 0);
        </script>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </checkbox>

  </group>

  <hrule/>

  <group>

    <layout>vbox</layout>
    <padding>6</padding>
    <radio>
      <halign>left</halign>
      <label>Smoke blue</label>
      <property>sim/model/color-blue</property>
      <live>true</live>
      <binding>
        <command>property-assign</command>
        <!-- <property>sim/model/smoke-color</property> -->
        <property>sim/multiplay/generic/int[6]</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-blue</property>
        <value> 1 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-white</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-red</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </radio>

    <layout>vbox</layout>
    <padding>6</padding>
    <radio>
      <halign>left</halign>
      <label>Smoke White</label>
      <property>sim/model/color-white</property>
      <live>true</live>
      <binding>
        <command>property-assign</command>
        <!-- <property>sim/model/smoke-color</property> -->
        <property>sim/multiplay/generic/int[6]</property>
        <value> 1 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-blue</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-white</property>
        <value> 1 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-red</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </radio>

    <layout>vbox</layout>
    <padding>6</padding>
    <radio>
      <halign>left</halign>
      <label>Smoke Red</label>
      <property>sim/model/color-red</property>
      <live>true</live>
      <binding>
        <command>property-assign</command>
        <!-- <property>sim/model/smoke-color</property> -->
        <property>sim/multiplay/generic/int[6]</property>
        <value> 2 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-blue</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-white</property>
        <value> 0 </value>
      </binding>
      <binding>
        <command>property-assign</command>
        <property>sim/model/color-red</property>
        <value> 1 </value>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </radio>

  </group>

  <hrule/>

  <group>

    <layout>vbox</layout>
    <button>
      <row>0</row>
      <legend>Reload Weapons</legend>
      <binding>
        <command>nasal</command>
        <script>guns.reload_guns();</script>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </button>

    <button>
      <row>0</row>
      <legend>Weapons unlimited</legend>
      <binding>
        <command>nasal</command>
        <script>guns.unlimited_guns();</script>
      </binding>
      <binding>
        <command>dialog-update</command>
      </binding>
    </button>

  </group>

  <hrule/>

  <button>
    <legend>Close</legend>
    <default>true</default>
    <key>Esc</key>
    <binding>
      <command>nasal</command>
      <script>d510.load_dialog.toggle()</script>
    </binding>
    <binding>
      <command>dialog-apply</command>
    </binding>
    <binding>
      <command>dialog-close</command>
    </binding>
  </button>

  <nasal>
    <open></open>
  </nasal>

</PropertyList>
