<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">

	<Script file="XPerl_TargetTarget.lua"/>

	<Button name="XPerl_TargetTarget_Template" inherits="SecureUnitButtonTemplate" clampedToScreen="true" frameStrata="LOW" virtual="true" movable="true" parent="UIParent" hidden="true">
		<Size>
			<!-- The size of this frame determines what can be clicked for the menu and moving, hence it is the same size as the name frame. -->
			<AbsDimension x="160" y="60"/>
		</Size>

		<!-- Script Events -->

		<Scripts>
			<OnLoad function="XPerl_TargetTarget_OnLoad"/>
			<OnEnter function="XPerl_Unit_OnEnter"/>
			<OnLeave function="XPerl_Unit_OnLeave"/>
			<OnDragStart>
				if (XPerlLocked == 0) then
					self:StartMoving()
				end
			</OnDragStart>
			<OnDragStop>
				self:StopMovingOrSizing()
				XPerl_SavePosition(self)
			</OnDragStop>
			<OnEnter>
				self.highlight:Select()
				XPerl_PlayerTip(self)
				if (self == XPerl_TargetTarget) then
					XPerl_Tutorial(8)
				else
					XPerl_Tutorial(9)
				end
			</OnEnter>
			<OnLeave>
				self.highlight:Deselect()
				XPerl_PlayerTipHide()
			</OnLeave>
			<OnEvent function="XPerl_TargetTarget_OnEvent"/>
		</Scripts>

		<Frames>
			<!-- TargetTarget Name -->

			<Button name="$parentnameFrame" inherits="SecureUnitButtonTemplate">
				<Scripts>
					<OnLoad>
						self:RegisterForClicks("AnyUp")
						self:RegisterForDrag("LeftButton")
						XPerl_RegisterUnitText(_G[self:GetName().."text"])
						self:SetScript("OnEnter", function(self) XPerl_Unit_OnEnter(self:GetParent()) end)
						self:SetScript("OnLeave", function(self) XPerl_Unit_OnLeave(self:GetParent()) end)
					</OnLoad>
					<OnDragStart>
						if (XPerlLocked == 0) then
							self:GetParent():StartMoving()
						end
					</OnDragStart>
					<OnDragStop>
						self:GetParent():StopMovingOrSizing()
						XPerl_SavePosition(self:GetParent())
					</OnDragStop>
				</Scripts>
				<Size>
					<AbsDimension x="136" y="24"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT"/>
				</Anchors>
				<Backdrop bgFile="Interface\Addons\XPerl\Images\XPerl_FrameBack" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
						<AbsValue val="32"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="4" right="4" top="4" bottom="4"/>
					</BackgroundInsets>
				</Backdrop>
				<Layers>
					<Layer level="OVERLAY">
						<!-- PVP Icon -->
						<Texture name="$parentpvpIcon" file="Interface\TargetingFrame\UI-PVP-FFA" hidden="true">
							<Size>
								<AbsDimension x="40" y="40"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
									<Offset>
										<AbsDimension x="-5" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<!-- Raid Target Icon -->
						<Texture name="$parentraidIcon" file="Interface\TargetingFrame\UI-RaidTargetingIcons" hidden="true">
							<Size>
								<AbsDimension x="32" y="32"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER"/>
							</Anchors>
						</Texture>

						<!-- Combat Icon -->
						<Texture name="$parentcombatIcon" file="Interface\CharacterFrame\UI-StateIcon" hidden="true">
							<Size>
								<AbsDimension x="32" y="31"/>
							</Size>
							<Anchors>
								<Anchor point="RIGHT"/>
							</Anchors>
							<TexCoords left="0.5" right = "1.0" top="0.0" bottom="0.5"/>
						</Texture>

						<!-- Warning Icon -->
						<Texture name="$parentwarningIcon" file="Interface\Minimap\Ping\ping6" alphaMode="ADD" hidden="true">
							<Size>
								<AbsDimension x="32" y="31"/>
							</Size>
							<Anchors>
								<Anchor point="TOP" relativePoint="TOP">
									<Offset>
										<AbsDimension x="0" y="2"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>

						<FontString name="$parenttext" inherits="GameFontNormal">
							<Anchors>
								<Anchor point="TOPLEFT"/>
								<Anchor point="BOTTOMRIGHT">
									<Offset>
										<AbsDimension x="0" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<!--Texture name="$parentpvpRankIcon">
							<Size><AbsDimension x="32" y="32"/></Size>
							<Anchors>
								<Anchor point="TOP">
									<Offset><AbsDimension x="-40" y="3"/></Offset>
								</Anchor>
							</Anchors>
						</Texture-->
					</Layer>
				</Layers>
			</Button>

			<!--Level Frame-->

			<Frame name="$parentlevelFrame" inherits="XPerl_BorderStyleTemplate">
				<Size>
					<AbsDimension x="27" y="24"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentnameFrame">
						<Offset>
							<AbsDimension x="-3" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parenttext" inherits="GameFontNormalSmall" text="0" setAllPoints="true"/>
						<Texture name="$parentskull" file="Interface\TargetingFrame\UI-TargetingFrame-Skull" hidden="true">
							<Size>
								<AbsDimension x="16" y="16"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER"/>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						XPerl_RegisterUnitText(_G[self:GetName().."text"])
					</OnLoad>
				</Scripts>
			</Frame>

			<!-- TargetTarget Stats -->
			<Frame name="$parentstatsFrame" inherits="XPerl_Stats_Template">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentnameFrame">
						<Offset>
							<AbsDimension x="0" y="2"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>

			<Frame name="$parenthighlight" inherits="XPerl_HighlightTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentnameFrame"/>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentstatsFrame"/>
				</Anchors>
			</Frame>

			<Frame name="$parentbuffFrame">
				<Size>
					<AbsDimension x="100" y="50"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentstatsFrame">
						<Offset>
							<AbsDimension x="2" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Frame>

			<Frame name="$parentdebuffFrame">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentbuffFrame"/>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentbuffFrame"/>
				</Anchors>
			</Frame>
		</Frames>
	</Button>

	<Button name="XPerl_TargetTarget" inherits="XPerl_TargetTarget_Template" movable="true" parent="UIParent" hidden="true">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="590" y="-12"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Button>
</Ui>
