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

<PropertyList>

  <path>keystart.ac</path>

  <animation>
    <object-name>base</object-name>
    <object-name>ignition-turn</object-name>
    <object-name>ignition-key</object-name>

    <object-name>start</object-name>
  </animation>

  <animation>
    <type>noshadow</type>
    <object-name>base</object-name>
    <object-name>ignition-turn</object-name>
    <object-name>ignition-key</object-name>
    <object-name>start</object-name>
  </animation>

  <animation>
    <type>material</type>
    <object-name>ignition-key</object-name>
    <condition>
      <property>/controls/electric/battery-switch</property>
    </condition>
    <emission>
      <factor-prop>controls/lighting/instruments-norm</factor-prop>
      <red>   0.50 </red>
      <green> 0.40 </green>
      <blue>  0.30 </blue>
    </emission>
  </animation>

  <animation>
    <type>select</type>
    <object-name>ignition-key</object-name>
    <condition>
      <property>/controls/engines/key</property>
    </condition>
  </animation>

  <animation>
    <type>pick</type>
    <object-name>base</object-name>
    <object-name>ignition-turn</object-name>
    <action>
      <name>get_key</name>
      <button>0</button>
      <binding>
        <condition>
          <equals>
            <property>/controls/engines/engine/magnetos</property>
            <value>0</value>
          </equals>
          <not><property>/controls/engines/engine/starter</property></not>
        </condition>
        <command>property-toggle</command>
        <property>/controls/engines/key</property>
      </binding>
    </action>
    <hovered>
      <binding>
        <condition>
          <equals>
            <property>/controls/engines/engine/magnetos</property>
            <value>0</value>
          </equals>
          <not><property>/controls/engines/engine/starter</property></not>
        </condition>
        <command>set-tooltip</command>
        <tooltip-id>get-key</tooltip-id>
        <label>Put key</label>
      </binding>
    </hovered>
  </animation>

  <!-- Magneto switch -->
  <animation>
    <type>knob</type>
    <object-name>ignition-key</object-name>
    <visible>true</visible>
    <action>
      <binding>
        <command>property-adjust</command>
        <property>/controls/engines/engine/magnetos</property>
        <factor>1</factor>
        <min>0</min>
        <max>3</max>
      </binding>
    </action>
    <hovered>
      <binding>
        <command>set-tooltip</command>
        <tooltip-id>magneto-switch</tooltip-id>
        <label>Magnetos: %s</label>
        <property>controls/engines/engine/magnetos</property>
        <mapping>nasal</mapping>
        <script>
          var m = arg[0];
          if (m == 1) return 'RIGHT';
          if (m == 2) return 'LEFT';
          if (m == 3) return 'BOTH';
          return 'OFF';
        </script>
      </binding>
    </hovered>
  </animation>

  <!-- Key rotation animation -->
  <animation>
    <type>rotate</type>
    <object-name>ignition-key</object-name>
    <object-name>ignition-turn</object-name>
    <property>controls/engines/engine/magnetos</property>
    <interpolation>
      <entry><ind> 0 </ind><dep>   0 </dep></entry>
      <entry><ind> 1 </ind><dep>  35 </dep></entry>
      <entry><ind> 2 </ind><dep>  80 </dep></entry>
      <entry><ind> 3 </ind><dep> 130 </dep></entry>
    </interpolation>
    <axis>
      <x> -1 </x>
      <y>  0 </y>
      <z>  0 </z>
    </axis>
  </animation>

  <!-- Starter -->
  <animation>
    <type>pick</type>
    <object-name>start</object-name>
    <visible>false</visible>
    <action>
      <name>starter</name>
      <button>0</button>
      <binding>
        <command>property-assign</command>
        <property>/controls/engines/engine/starter</property>
        <value>1</value>
      </binding>
      <mod-up>
        <binding>
          <command>property-assign</command>
          <property>/controls/engines/engine/starter</property>
          <value>0</value>
        </binding>
      </mod-up>
    </action>
    <hovered>
      <binding>
        <command>set-tooltip</command>
        <tooltip-id>starter-switch</tooltip-id>
        <label>Engine Starter</label>
      </binding>
    </hovered>
  </animation>

</PropertyList>
