<?xml version="1.0"?>

<!-- flap lever -->

<PropertyList>

  <path>flap.ac</path>

  <animation>
    <type>slider</type>
    <object-name>lever</object-name>
    <visible>true</visible>

    <drag-direction>vertical</drag-direction>
    <!-- no translation, we handle that seperately -->

    <increase>
      <binding>
        <condition>
          <!--disable normal flap control if emgy lowering used-->
          <equals>
            <property>controls/flight/flaps-alternate-extension</property>
            <value>1</value>
          </equals>
        </condition>
        <command>nasal</command>
        <script>
          controls.flapsDown(-1)
        </script>
      </binding>
      <mod-up>
        <binding>
          <command>nasal</command>
          <script>controls.flapsDown(0)</script>
        </binding>
      </mod-up>
    </increase>

    <decrease>
      <binding>
        <condition>
          <!--disable normal flap control if emgy lowering used-->
          <equals>
            <property>controls/flight/flaps-alternate-extension</property>
            <value>1</value>
          </equals>
        </condition>
        <command>nasal</command>
        <script>
          controls.flapsDown(1)
        </script>
      </binding>
      <mod-up>
        <binding>
          <command>nasal</command>
          <script>controls.flapsDown(0)</script>
        </binding>
      </mod-up>
    </decrease>

    <hovered>
      <binding>
        <command>set-tooltip</command>
        <label>Flaps: %3d%%</label>
        <tooltip-id>flap</tooltip-id>
        <mapping>percent</mapping>
        <property>/controls/flight/flaps</property>
      </binding>
    </hovered>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>lever</object-name>
    <property>controls/flight/flaps</property>
    <interpolation>
      <entry>
        <ind>0</ind>
        <dep>-45</dep>
      </entry>
      <entry>
        <ind>0.5</ind>
        <dep>0</dep>
      </entry>
      <entry>
        <ind>1</ind>
        <dep>45</dep>
      </entry>
    </interpolation>
    <center>
      <x-m>-0.01</x-m>
      <y-m>0</y-m>
      <z-m>0</z-m>
    </center>
    <axis>
      <x>0</x>
      <y>1</y>
      <z>0</z>
    </axis>
  </animation>

  <animation>
    <type>material</type>
    <emission>
      <factor-prop>/controls/lighting/panel-norm</factor-prop>
      <red>0.75</red>
      <green>0.25</green>
      <blue>0.25</blue>
    </emission>
  </animation>

  <!-- *** LoD *** -->
  <animation>
    <type>range</type>
    <min-m>0</min-m>
    <max-m>5</max-m>
  </animation>

</PropertyList>
