<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
	<CheckButton name="MovePadCheckboxTemplate" inherits="UIPanelSquareButton" virtual="true">
		<Size x="38" y="38" />
		<CheckedTexture file="Interface\Buttons\CheckButtonGlow" alphaMode="ADD">
			<TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9"/>
		</CheckedTexture>
	</CheckButton>
	
	<Frame name="MovePadFrame" parent="UIParent" movable="true" toplevel="true" frameStrata="BACKGROUND">
		<Size x="126" y="124" />
		<Anchors>
			<Anchor point="TOPRIGHT" x="-90" y="-180"/>
		</Anchors>
		<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
			<EdgeSize>
				<AbsValue val="16"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="16"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="5" right="5" top="5" bottom="5"/>
			</BackgroundInsets>
			<Color r="0.09" g="0.09" b="0.19" a="0.5"/>
			<BorderColor r="1.0" g="1.0" b="1.0"/>
		</Backdrop>
		<Frames>
			<CheckButton name="MovePadLock">
				<Size x="32" y="32"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" x="0" y="-1"/>
				</Anchors>
				<Backdrop bgFile="Interface\Buttons\LockButton-Border"/>
				<Scripts>
					<OnLoad>
						self:SetChecked(false);
						MovePadFrame.canMove = false;
					</OnLoad>
					<OnClick>
						MovePadFrame.canMove = self:GetChecked();
					</OnClick>
				</Scripts>
				<NormalTexture file="Interface\Buttons\LockButton-Locked-Up"/>
				<PushedTexture file="Interface\Buttons\LockButton-Unlocked-Down"/>
				<HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/>
				<CheckedTexture file="Interface\Buttons\LockButton-Unlocked-Up"/>
			</CheckButton>
			<CheckButton name="MovePadForward" inherits="MovePadCheckboxTemplate">
				<Anchors>
					<Anchor point="TOP" x="0" y="-5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						SquareButton_SetIcon(self, "UP");
						self:RegisterForClicks("AnyUp");
					</OnLoad>
					<OnClick>
						local start = self:GetChecked();
						if ( MovePadStrafeLeft:GetChecked() ) then
							StrafeLeftStop();
							MovePadStrafeLeft:SetChecked(false);
							start = true;
						end
						if ( MovePadStrafeRight:GetChecked() ) then
							StrafeRightStop();
							MovePadStrafeRight:SetChecked(false);
							start = true;
						end
						if ( start ) then
							MovePadBackward:SetChecked(false);
							MoveBackwardStop();
							MoveForwardStart();
							self:SetChecked(true);
						else
							MoveForwardStop();
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<Button name="MovePadJump" inherits="UIPanelSquareButton">
				<Size x="38" y="38" />
				<Anchors>
					<Anchor point="TOP" relativeTo="MovePadForward" relativePoint="BOTTOM" x="0" y="0"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:RegisterForClicks("AnyDown", "AnyUp");
						self.icon:SetTexture("Interface\\Buttons\\JumpUpArrow");
						self.icon:SetTexCoord(0,1,0,1);
						self.icon:SetSize(18,18);
					</OnLoad>
					<OnMouseDown>
						self.jump = true;
						if self:IsEnabled() then
							self.icon:SetPoint("CENTER", -1, -1);
						end
					</OnMouseDown>
					<OnMouseUp>
						self.jump = nil;
						self.icon:SetPoint("CENTER", 0, 0);
					</OnMouseUp>
					<OnClick>
						if ( self.jump ) then
							JumpOrAscendStart();
						else
							AscendStop();
						end
					</OnClick>
				</Scripts>
			</Button>
			<CheckButton name="MovePadBackward" inherits="MovePadCheckboxTemplate">
				<Anchors>
					<Anchor point="TOP" relativeTo="MovePadJump" relativePoint="BOTTOM" x="0" y="0"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						SquareButton_SetIcon(self, "DOWN");
						self:RegisterForClicks("AnyUp");
					</OnLoad>
					<OnClick>
						local start = self:GetChecked();
						if ( MovePadStrafeLeft:GetChecked() ) then
							StrafeLeftStop();
							MovePadStrafeLeft:SetChecked(false);
							start = true;
						end
						if ( MovePadStrafeRight:GetChecked() ) then
							StrafeRightStop();
							MovePadStrafeRight:SetChecked(false);
							start = true;
						end
						if ( start ) then
							MovePadForward:SetChecked(false);
							MoveForwardStop();
							MoveBackwardStart();
							self:SetChecked(true);
						else
							MoveBackwardStop();
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<CheckButton name="MovePadStrafeLeft" inherits="MovePadCheckboxTemplate">
				<Anchors>
					<Anchor point="RIGHT" relativeTo="MovePadForward" relativePoint="LEFT"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						SquareButton_SetIcon(self, "LEFT");
						self:RegisterForClicks("AnyUp");
					</OnLoad>
					<OnClick>
						if ( self:GetChecked() ) then
							MovePadStrafeRight:SetChecked(false);
							StrafeRightStop();
							StrafeLeftStart();
						else
							StrafeLeftStop();
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<CheckButton name="MovePadStrafeRight" inherits="MovePadCheckboxTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="MovePadForward" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						SquareButton_SetIcon(self, "RIGHT");
						self:RegisterForClicks("AnyUp");
					</OnLoad>
					<OnClick>
						if ( self:GetChecked() ) then
							MovePadStrafeLeft:SetChecked(false);
							StrafeLeftStop();
							StrafeRightStart();
						else
							StrafeRightStop();
						end
					</OnClick>
				</Scripts>
			</CheckButton>
		</Frames>
		<Scripts>
			<OnLoad>
				self:RegisterForDrag("LeftButton");
			</OnLoad>
			<OnDragStart>
				if( self.canMove ) then
					self.moving = true;
					self:SetFrameStrata("DIALOG");
					self:StartMoving();
				end
			</OnDragStart>
			<OnDragStop>
				if( self.canMove and self.moving ) then
					self.moving = false;
					self:StopMovingOrSizing();
					self:SetFrameStrata("BACKGROUND");
					ValidateFramePosition(self, 25);
				end
			</OnDragStop>
		</Scripts>
	</Frame>
</Ui>