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

<PropertyList>
  
  <!-- If you put the dialog file in the Aircraft/aircraftname/gui/dialog the dialog box is loaded -->
  <name>config</name>
  <modal type="bool">false</modal>
  <layout>vbox</layout>
  
  <group>
    <layout>hbox</layout>
    <empty>
      <stretch>1</stretch>
    </empty>
    
    <text>
      <label>Mirage 2000 Configuration</label>
    </text>
    
    <empty>
      <stretch>1</stretch>
    </empty>
    
    <button>
      <pref-width>16</pref-width>
      <pref-height>16</pref-height>
      <legend></legend>
      
      <default>1</default>
      <keynum>27</keynum>
      <border>2</border>
      <binding>
        <command>dialog-close</command>
      </binding>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </button>
  </group>

  <hrule />

  <group>
    <layout>table</layout>
    <button>
      <row>0</row>
      <col>0</col>
      <legend>Auto-Start</legend>
      <binding>
        <command>nasal</command>
        <script>mirage2000.autostart();</script>
      </binding>
    </button>

  <button>
    <row>0</row>
    <col>1</col>
    <legend>Repair Damage</legend>
    <binding>
      <command>nasal</command>
      <script>
        var failure_modes = FailureMgr._failmgr.failure_modes;
        var mode_list = keys(failure_modes);
        foreach(var failure_mode_id; mode_list) {
          FailureMgr.set_failure_level(failure_mode_id, 0);
        }
        </script>
    </binding>
  </button>
  </group>

  <hrule />

  <!--
  <button>
    <legend>MP Shot Report</legend>
    <binding>
      <command>nasal</command>
      <script>missile.MPReport()</script>
    </binding>
  </button>
  -->
  <group>
    <layout>hbox</layout>
    <text><label>MP Shot Report</label></text>
    <checkbox>
      <property>/payload/armament/msg</property>
      <live>true</live>
      <binding>
        <command>nasal</command>
        <script>
          if(getprop("/gear/gear[0]/wow") or !getprop("payload/armament/msg")){ 
            setprop("payload/armament/msg", !getprop("payload/armament/msg")); 
          }
          screen.log.write("MP messaging : " ~ (getprop("/payload/armament/msg") ? "Activated" : "Deactivated")  , 0.5, 0.5, 1);</script>
      </binding>
    </checkbox>
  </group>
  
  <group>
        <layout>hbox</layout>
        <text><label>Use Interpolation method</label></text>
        <checkbox>
          <property>payload/armament/hit-interpolation</property>
          <live>true</live>
            <binding>
              <command>property-toggle</command>
              <property>payload/armament/hit-interpolation</property>
            </binding>
        </checkbox>
      </group>

  <group>
    <layout>hbox</layout>
    <text><label>Activate Auto missile view</label></text>
    <checkbox>
      <property>/controls/armament/automissileview</property>
      <live>true</live>
        <binding>
          <command>property-toggle</command>
          <property>/controls/armament/automissileview</property>
        </binding>
    </checkbox>
  </group>

  <hrule />

  <button>
    <legend>Ground targeting</legend>
<!--    <binding>
      <command>nasal</command>
      <script>missile.targetingGround()</script>
    </binding>-->
    <binding>
      <command>dialog-show</command>
      <dialog-name>Ground_Targeting</dialog-name>
    </binding>
  </button>

  <hrule />

  <button>
    <legend>Reload Guns, Flares and Chaffs</legend>
    <binding>
      <command>nasal</command>
      <script>
        if(getprop("/gear/gear[0]/wow") or !getprop("payload/armament/msg")){ 
          guns.reload_Cannon()
        }else{
          screen.log.write(mirage2000.msgB);
        }
      </script>
    </binding>
  </button>

  <hrule />

  <text><label>Rate of Fire </label></text>
  <text><label>A/A => A/G => Lower..</label></text>
  <group>
    <layout>hbox</layout>
    <group>
      <layout>vbox</layout>
      <halign>left</halign>
      <text><label>1800rnd/min-1100rnd/min-Lower</label></text>
    </group>
    
    <group>
      <layout>vbox</layout>
      <halign>right</halign>
      <slider>
        <name>Rate</name>
        <property>/ai/submodels/submodel/delay</property>
        <live>1</live>
        <min>0.03</min>
        <max>0.09</max>
        <step>0.03</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>guns.Cannon_rate()</script>
        </binding>
      </slider>
    </group>
  </group>

  <hrule />

  <!-- Bingo Fuel  -->
  <text>
    <label>Enter the Bingo Fuel value</label>
  </text>
  
  
  <input>
    <width>75</width>
    <height>25</height>
    <label> KG</label>
    <property>/instrumentation/consumables/bingo_fuel</property>
  </input>

  <button>
    <legend>Ok</legend>
    <binding>
      <command>dialog-apply</command>
    </binding>
  </button>
  
  <hrule />
  
  <text>
    <label>Everything below is only available on GROUND!</label>
  </text>
  <text>
    <label>Select a Config below</label>
  </text>

  <button>
    <legend>No load</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.lisse()</script>
    </binding>
  </button>
<group>
  <layout>table</layout>
  <button>
    <row>0</row>
    <col>0</col>
    <legend>PO</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_po_old()</script>
    </binding>
  </button>
  <button>
    <row>1</row>
    <col>0</col>
    <legend>Fox Old Years</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_fox_old()</script>
    </binding>
  </button>
  <button>
    <row>2</row>
    <col>0</col>
    <legend>Fox</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_fox_mix()</script>
    </binding>
  </button>
  <button>
    <row>3</row>
    <col>0</col>
    <legend>Fox Full Mica</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_fox_mica()</script>
    </binding>
  </button>
  <button>
    <row>4</row>
    <col>0</col>
    <legend>Bravo</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_bravo_mix()</script>
    </binding>
  </button>
  <button>
    <row>0</row>
    <col>1</col>
    <legend>Kilo</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2a_kilo_mica()</script>
    </binding>
  </button>
  <button>
    <row>1</row>
    <col>1</col>
    <legend>Air to Ground</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2g_bravo_mix()</script>
    </binding>
  </button>
  <button>
    <row>2</row>
    <col>1</col>
    <legend>Anti Radar</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2ouadi_fox()</script>
    </binding>
  </button>
  <button>
    <row>3</row>
    <col>1</col>
    <legend>Air to Sea</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.a2s_fox()</script>
    </binding>
  </button>  
  <button>
    <row>4</row>
    <col>1</col>
    <legend>m2000N</legend>
    <binding>
      <command>nasal</command>
      <script>pylons.nuke()</script>
    </binding>
  </button>
</group>

</PropertyList>
