<?xml version="1.0"?>

<!-- Copyright (c) 2022 Josh Davidson (Octal450) -->

<PropertyList>

	<path>dg.ac</path>
	
	<effect>
		<inherits-from>Effects/model-transparent</inherits-from>
		<object-name>transparent</object-name>
		<object-name>Face</object-name>
	</effect>
	
	<animation>
		<type>material</type>
		<object-name>Face</object-name>
		<object-name>Front</object-name>
		<object-name>HdgBug</object-name>
		<object-name>transparent</object-name>
		<emission>
			<red>0.6</red>
			<green>0.6</green>
			<blue>0.6</blue>
			<factor-prop>controls/lighting/panel-norm</factor-prop>
		</emission>
	</animation>

	<animation>
		<type>rotate</type>
		<object-name>Face</object-name>
		<property>instrumentation/heading-indicator/indicated-heading-deg</property>
		<factor>-1</factor>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>

	<animation>
		<type>rotate</type>
		<object-name>HdgBug</object-name>
		<property>instrumentation/heading-indicator/indicated-heading-deg</property>
		<factor>-1</factor>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>

	<animation>
		<type>rotate</type>
		<object-name>HdgBug</object-name>
		<property>autopilot/settings/heading-bug-deg</property>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>

	<!-- Heading Bug control -->
	<animation>
		<type>pick</type>
		<object-name>Hdg-Knob</object-name>
		<action>
			<button>0</button>
			<button>3</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property>autopilot/settings/heading-bug-deg</property>
				<step>1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property>autopilot/settings/heading-bug-deg</property>
				<step>10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<action>
			<button>1</button>
			<button>4</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property>autopilot/settings/heading-bug-deg</property>
				<step>-1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property>autopilot/settings/heading-bug-deg</property>
				<step>-10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>dg-bug</tooltip-id>
				<mapping>heading</mapping>
				<label>Heading Bug: %3d</label>
				<property>autopilot/settings/heading-bug-deg</property>
			</binding>
		</hovered>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>Hdg-Knob</object-name>
		<property>autopilot/settings/heading-bug-deg</property>
		<factor>6</factor>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<x-m>0</x-m>
			<y-m>0.031892</y-m>
			<z-m>-0.032252</z-m>
		</center>
	</animation>

	<!-- Heading Offset -->
	<animation>
		<type>pick</type>
		<object-name>OBS-Knob</object-name>
		<action>
			<button>0</button>
			<button>3</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property>instrumentation/heading-indicator/offset-deg</property>
				<step>1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property>instrumentation/heading-indicator/offset-deg</property>
				<step>10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<action>
			<button>1</button>
			<button>4</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property>instrumentation/heading-indicator/offset-deg</property>
				<step>-1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property>instrumentation/heading-indicator/offset-deg</property>
				<step>-10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>dg-offset</tooltip-id>
				<mapping>heading</mapping>
				<label>Card Offset</label>
				<property>instrumentation/heading-indicator/offset-deg</property>
			</binding>
		</hovered>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>OBS-Knob</object-name>
		<property>instrumentation/heading-indicator/offset-deg</property>
		<factor>6</factor>
		<axis>
			<x>-1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<x-m>0</x-m>
			<y-m>-0.031892</y-m>
			<z-m>-0.032252</z-m>
		</center>
	</animation>

</PropertyList>
