<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="PetFrame.lua"/>
	<Button name="PetFrame" frameStrata="LOW" toplevel="true" inherits="SecureUnitButtonTemplate" parent="PlayerFrame">
		<Size>
			<AbsDimension x="128" y="53"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="80" y="-60"/>
				</Offset>
			</Anchor>
		</Anchors>
		<HitRectInsets>
			<AbsInset left="7" right="66" top="6" bottom="7"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="PetFrameFlash" file="Interface\TargetingFrame\UI-PartyFrame-Flash" hidden="true">
					<Size>
						<AbsDimension x="128" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="-4" y="11"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="1.0" top="1.0" bottom="0"/>
				</Texture>
				<Texture name="PetPortrait">
					<Size>
						<AbsDimension x="37" y="37"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="7" y="-6"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="PetFrameDropDown" inherits="UIDropDownMenuTemplate" id="1" hidden="true">
				<Size>
					<AbsDimension x="10" y="10"/>
				</Size>
				<Anchors>
					<Anchor point="TOP">
						<Offset>
							<AbsDimension x="-20" y="-20"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						PetFrameDropDown_OnLoad(self);
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame setAllPoints="true">
				<Frames>
					<Frame setAllPoints="true">
						<Layers>
							<Layer level="BACKGROUND">
								<Texture name="PetFrameTexture" file="Interface\TargetingFrame\UI-SmallTargetingFrame">
									<Size>
										<AbsDimension x="128" y="64"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT">
											<Offset>
												<AbsDimension x="0" y="-2"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
								<FontString name="PetHitIndicator" hidden="true" inherits="NumberFontNormalHuge">
									<Anchors>
										<Anchor point="CENTER" relativePoint="TOPLEFT">
											<Offset>
												<AbsDimension x="28" y="-27"/>
											</Offset>
										</Anchor>
									</Anchors>
								</FontString>
								<FontString name="PetFrameHealthBarText" inherits="TextStatusBarText">
									<Anchors>
										<Anchor point="CENTER" relativePoint="TOPLEFT">
											<Offset>
												<AbsDimension x="82" y="-26"/>
											</Offset>
										</Anchor>
									</Anchors>
								</FontString>
								<FontString name="PetFrameManaBarText" inherits="TextStatusBarText">
									<Anchors>
										<Anchor point="CENTER" relativePoint="TOPLEFT">
											<Offset>
												<AbsDimension x="82" y="-35"/>
											</Offset>
										</Anchor>
									</Anchors>
								</FontString>
							</Layer>
							<Layer level="ARTWORK">
								<FontString name="PetName" inherits="GameFontNormalSmall">
									<Anchors>
										<Anchor point="BOTTOMLEFT">
											<Offset>
												<AbsDimension x="52" y="33"/>
											</Offset>
										</Anchor>
									</Anchors>
								</FontString>
								<Texture name="PetAttackModeTexture" file="Interface\TargetingFrame\UI-Player-AttackStatus" alphaMode="ADD" hidden="true">
									<Size>
										<AbsDimension x="76" y="64"/>
									</Size>
									<Anchors>
										<Anchor point="TOPLEFT">
											<Offset>
												<AbsDimension x="6" y="-9"/>
											</Offset>
										</Anchor>
									</Anchors>
									<TexCoords left="0.703125" right="1.0" top="0" bottom="1.0"/>
								</Texture>
							</Layer>
						</Layers>
					</Frame>
				</Frames>
			</Frame>
			<StatusBar name="PetFrameHealthBar" inherits="TextStatusBar">
				<Size>
					<AbsDimension x="69" y="8"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="47" y="-22"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						TextStatusBar_Initialize(self);
						self.textLockable = 1;
						self.cvar = "petStatusText";
						self.cvarLabel = "STATUS_TEXT_PET";
					</OnLoad>
					<OnValueChanged>
						UnitFrameHealthBar_OnValueChanged(self, value);
					</OnValueChanged>
				</Scripts>
				<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
			</StatusBar>
			<StatusBar name="PetFrameManaBar" inherits="TextStatusBar">
				<Size>
					<AbsDimension x="69" y="8"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="47" y="-29"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						TextStatusBar_Initialize(self);
						self.textLockable = 1;
						self.cvar = "petStatusText";
						self.cvarLabel = "STATUS_TEXT_PET";
					</OnLoad>
				</Scripts>
				<BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
				<BarColor r="0" g="0" b="1.0"/>
			</StatusBar>
			<Button name="$parentDebuff1" inherits="PartyBuffButtonTemplate" id="1">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="48" y="-42"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetUnitDebuff(PetFrame.unit, self:GetID());
					</OnEnter>
				</Scripts>
			</Button>
			<Button name="$parentDebuff2" inherits="PartyBuffButtonTemplate" id="2">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentDebuff1" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="2" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetUnitDebuff(PetFrame.unit, self:GetID());
					</OnEnter>
				</Scripts>
			</Button>
			<Button name="$parentDebuff3" inherits="PartyBuffButtonTemplate" id="3">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentDebuff2" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="2" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetUnitDebuff(PetFrame.unit, self:GetID());
					</OnEnter>
				</Scripts>
			</Button>
			<Button name="$parentDebuff4" inherits="PartyBuffButtonTemplate" id="4">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentDebuff3" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="2" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetUnitDebuff(PetFrame.unit, self:GetID());
					</OnEnter>
				</Scripts>
			</Button>
			<Frame name="PetFrameHappiness" enableMouse="true" hidden="false">
				<Size>
					<AbsDimension x="24" y="23"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="-7" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="PetFrameHappinessTexture" file="Interface\PetPaperDollFrame\UI-PetHappiness" setAllPoints="true">
							<Size>
								<AbsDimension x="24" y="23"/>
							</Size>
							<TexCoords left="0" right="0.1875" top="0" bottom="0.359375"/>
						</Texture>			
					</Layer>
				</Layers>
				<Scripts>
					<OnEnter>
						if ( self.tooltip ) then
							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
							GameTooltip:SetText(self.tooltip);
							if ( self.tooltipDamage ) then
								GameTooltip:AddLine(self.tooltipDamage, "", 1, 1, 1);
							end
							GameTooltip:Show();
						end
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad>
				UnitFrame_Initialize(self, "pet", PetName, PetPortrait,
									 PetFrameHealthBar, PetFrameHealthBarText, 
									 PetFrameManaBar, PetFrameManaBarText,
				                     PetFrameFlash);
				PetFrame_OnLoad(self);
			</OnLoad>
			<OnEvent>
				PetFrame_OnEvent(self, event, ...);
			</OnEvent>
			<OnShow>
				UnitFrame_Update(self);
				PetFrame_Update(self);
				TotemFrame_Update(self);
			</OnShow>
			<OnHide>
				TotemFrame_Update(self);
			</OnHide>
			<OnUpdate>
				PetFrame_OnUpdate(self, elapsed);
			</OnUpdate>
			<OnEnter>
				UnitFrame_OnEnter(self);
				PartyMemberBuffTooltip:SetPoint("TOPLEFT", self, "TOPLEFT", 60, -35);
				PartyMemberBuffTooltip_Update(self);
			</OnEnter>
			<OnLeave>
				UnitFrame_OnLeave(self);
				PartyMemberBuffTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
	<StatusBar name="PetCastingBarFrame" toplevel="true" parent="UIParent" hidden="true" inherits="CastingBarFrameTemplate">
		<Size>
			<AbsDimension x="195" y="13"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOM" relativeTo="CastingBarFrame" relativePoint="TOP">
				<Offset>
					<AbsDimension x="0" y="12"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				PetCastingBarFrame_OnLoad(self);
			</OnLoad>
			<OnEvent>
				PetCastingBarFrame_OnEvent(self, event, ...);
			</OnEvent>
		</Scripts>
	</StatusBar>
</Ui>
