<?xml version="1.0"?>

<PropertyList>

	<path>mag_switch.ac</path>
	
	 <animation>
		<type>scale</type>
		<x-offset>0.85</x-offset>
		<y-offset>0.85</y-offset>
		<z-offset>0.85</z-offset>
	</animation>

	<animation>
		<type>pick</type>
		<object-name>key</object-name>
		<object-name>mags.outer</object-name>
		<object-name>mags.inner</object-name>
		<action>
			<button>0</button>
			<button>3</button>
			<repeatable type="bool">false</repeatable>
			<binding>
				<command>property-adjust</command>
				<property>controls/engines/engine[0]/magnetos-switch</property>
				<step>1</step>
				<min>0</min>
				<max>4</max>
			</binding>
			<binding>
				<command>nasal</command>
				<script>setprop("/sim/sounde/switch3", 1);</script>
			</binding>
			<mod-up>
				<binding>
					<condition>
						<equals>
							<property>controls/engines/engine[0]/magnetos-switch</property>
							<value>4</value>
						</equals>
					</condition>
					<command>property-assign</command>
					<property>controls/engines/engine[0]/magnetos-switch</property>
					<value>3</value>
				</binding>
				<binding>
					<command>nasal</command>
					<script>setprop("/sim/sounde/switch3", 1);</script>
				</binding>
			</mod-up>
		</action>
		<action>
			<button>1</button>
			<button>4</button>
			<repeatable type="bool">false</repeatable>
			<binding>
				<command>property-adjust</command>
				<property>controls/engines/engine[0]/magnetos-switch</property>
				<step>-1</step>
				<min>0</min>
				<max>4</max>
			</binding>
			<binding>
				<command>nasal</command>
				<script>setprop("/sim/sounde/switch3", 1);</script>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>magneto-switch</tooltip-id>
				<label>Magnetos: %s</label>
				<property>controls/engines/engine/magnetos-switch</property>
				<mapping>nasal</mapping>
				<script>
				var m = getprop("/controls/engines/engine/magnetos-switch");
				if (m == 1) return 'RIGHT';
				if (m == 2) return 'LEFT';
				if (m == 3) return 'BOTH';
				if (m == 4) return 'START';
				return 'OFF';
				</script>
			</binding>
		</hovered>
	</animation>
  
	<animation>
		<name>mags-key</name>
		<type>rotate</type>
		<object-name>mags.inner</object-name>
		<object-name>key</object-name>
		<property>controls/engines/engine[0]/magnetos-switch</property>
		<factor>30</factor>
		<center>
			<x-m>0</x-m>
			<y-m>0</y-m>
			<z-m>0</z-m>
		</center>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>
  
</PropertyList>


