<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="ModelFrames.lua"/>
	<Button name="ModelControlButtonTemplate" virtual="true">
		<Size x="18" y="18"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentBg" file="Interface\Common\UI-ModelControlPanel" parentKey="bg">
					<Size x="16" y="16"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.29687500" right="0.54687500" top="0.14843750" bottom="0.27343750"/>	
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture name="$parentIcon" file="Interface\Common\UI-ModelControlPanel" virtual="true" parentKey="icon">
					<Size x="16" y="16"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.26562500" top="0.00781250" bottom="0.13281250"/>
				</Texture>
			</Layer>
			<Layer level="HIGHLIGHT">
				<Texture file="Interface\Common\UI-ModelControlPanel">
					<Size x="16" y="16"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.57812500" right="0.82812500" top="0.00781250" bottom="0.13281250"/>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnMouseDown function="ModelControlButton_OnMouseDown"/>
			<OnMouseUp function="ModelControlButton_OnMouseUp"/>
			<OnEnter>
				self:GetParent():SetAlpha(1);
				if ( GetCVar("UberTooltips") == "1" ) then
					GameTooltip_SetDefaultAnchor(GameTooltip, UIParent);
					GameTooltip:SetText(self.tooltip, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					if ( self.tooltipText ) then
						GameTooltip:AddLine(self.tooltipText, _, _, _, 1, 1);
					end
					GameTooltip:Show();
				end
			</OnEnter>
			<OnLeave>
				self:GetParent():SetAlpha(0.5);
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
	<PlayerModel name="MouseDisabledModelTemplate" virtual="true">
		<Scripts>
			<OnLoad function="Model_OnLoad"/>
			<OnEvent function="Model_OnEvent"/>
			<OnUpdate function="Model_OnUpdate"/>
		</Scripts>
	</PlayerModel>
	<PlayerModel name="ModelTemplate" inherits="MouseDisabledModelTemplate" virtual="true">
		<Scripts>
			<OnMouseUp function="Model_OnMouseUp"/>
			<OnMouseDown function="Model_OnMouseDown"/>
		</Scripts>
	</PlayerModel>

	<PlayerModel name="ModelWithZoomTemplate" inherits="ModelTemplate" virtual="true">
		<Scripts>
			<OnMouseWheel function="Model_OnMouseWheel"/>
		</Scripts>
	</PlayerModel>
	<PlayerModel name="ModelWithControlsTemplate" virtual="true">
		<Frames>
			<Frame name="$parentControlFrame" parentKey="controlFrame" alpha="0.5" hidden="true">
				<Size x="112" y="23"/>
				<Anchors>
					<Anchor point="TOP" x="0" y="-2"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentRight" file="Interface\Common\UI-ModelControlPanel">
							<Size x="23" y="23"/>
							<Anchors>
								<Anchor point="RIGHT" x="0" y="0"/>
							</Anchors>
							<TexCoords left="0.01562500" right="0.37500000" top="0.42968750" bottom="0.60937500"/>
						</Texture>
						<Texture name="$parentLeft" file="Interface\Common\UI-ModelControlPanel">
							<Size x="23" y="23"/>
							<Anchors>
								<Anchor point="LEFT" x="0" y="0"/>
							</Anchors>
							<TexCoords left="0.40625000" right="0.76562500" top="0.42968750" bottom="0.60937500"/>
						</Texture>
						<Texture name="$parentMiddle" file="Interface\Common\UI-ModelControlPanel">
							<Size x="32" y="23"/>
							<Anchors>
								<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT" x="0" y="0"/>
								<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT" x="0" y="0"/>
							</Anchors>
							<TexCoords left="0" right="1" top="0.62500000" bottom="0.80468750"/>
						</Texture>
					</Layer>
				</Layers>
				<Frames>
					<Button name="$parentZoomInButton" inherits="ModelControlButtonTemplate">
						<Anchors>
							<Anchor point="LEFT" x="2" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.icon:SetTexCoord(0.57812500, 0.82812500, 0.14843750, 0.27343750);
								self.tooltip = ZOOM_IN;
								self.tooltipText = KEY_MOUSEWHEELUP;
							</OnLoad>
							<OnClick>
								local model = self:GetParent():GetParent();
								Model_OnMouseWheel(model, 1);
								PlaySound("igInventoryRotateCharacter");
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentZoomOutButton" inherits="ModelControlButtonTemplate">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentZoomInButton" relativePoint="RIGHT" x="0" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.icon:SetTexCoord(0.29687500, 0.54687500, 0.00781250, 0.13281250);
								self.tooltip = ZOOM_OUT;
								self.tooltipText = KEY_MOUSEWHEELDOWN;
							</OnLoad>
							<OnClick>
								local model = self:GetParent():GetParent();
								Model_OnMouseWheel(model, -1);
								PlaySound("igInventoryRotateCharacter");
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentPanButton" inherits="ModelControlButtonTemplate" parentKey="panButton">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentZoomOutButton" relativePoint="RIGHT" x="0" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.icon:SetTexCoord(0.29687500, 0.54687500, 0.28906250, 0.41406250);
								self.tooltip = DRAG_MODEL;
								self.tooltipText = DRAG_MODEL_TOOLTIP;
							</OnLoad>
							<OnMouseDown>
								ModelControlButton_OnMouseDown(self);
								Model_StartPanning(self:GetParent():GetParent(), true);
							</OnMouseDown>
							<OnMouseUp>
								PlaySound("igInventoryRotateCharacter");
							</OnMouseUp>
						</Scripts>
					</Button>
					<Button name="$parentRotateLeftButton" inherits="ModelControlButtonTemplate" parentKey="rotateLeftButton">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentPanButton" relativePoint="RIGHT" x="0" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.icon:SetTexCoord(0.01562500, 0.26562500, 0.28906250, 0.41406250);
								self.tooltip = ROTATE_LEFT;
								self.tooltipText = ROTATE_TOOLTIP;
							</OnLoad>
							<OnClick>
								Model_RotateLeft(self:GetParent():GetParent());
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentRotateRightButton" inherits="ModelControlButtonTemplate" parentKey="rotateRightButton">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentRotateLeftButton" relativePoint="RIGHT" x="0" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.icon:SetTexCoord(0.57812500, 0.82812500, 0.28906250, 0.41406250);
								self.tooltip = ROTATE_RIGHT;
								self.tooltipText = ROTATE_TOOLTIP;
							</OnLoad>
							<OnClick>
								Model_RotateRight(self:GetParent():GetParent());
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentRotateResetButton" inherits="ModelControlButtonTemplate">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentRotateRightButton" relativePoint="RIGHT" x="0" y="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								self:RegisterForClicks("AnyUp");
								self.tooltip = RESET_POSITION;
							</OnLoad>
							<OnClick>
								Model_Reset(self:GetParent():GetParent());
								PlaySound("igInventoryRotateCharacter");
							</OnClick>
						</Scripts>
					</Button>
				</Frames>
				<Scripts>
					<OnHide>
						if ( self.buttonDown ) then
							ModelControlButton_OnMouseUp(self.buttonDown);
						end
					</OnHide>
				</Scripts>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad function="Model_OnLoad"/>
			<OnEvent function="Model_OnEvent"/>
			<OnUpdate function="Model_OnUpdate"/>
			<OnMouseUp>
				if ( button == "RightButton" and self.panning ) then
					Model_StopPanning(self);
				elseif ( self.mouseDown ) then
					self.onMouseUpFunc(self, button);
				end
			</OnMouseUp>
			<OnMouseDown>
				if ( button == "RightButton" and not self.mouseDown ) then
					Model_StartPanning(self);
				else
					Model_OnMouseDown(self, button);
				end
			</OnMouseDown>
			<OnMouseWheel>
				Model_OnMouseWheel(self, delta);
			</OnMouseWheel>
			<OnEnter>
				self.controlFrame:Show();
			</OnEnter>
			<OnLeave>
				if ( not self.controlFrame:IsMouseOver() and not ModelPanningFrame:IsShown() ) then
					self.controlFrame:Hide();
				end
			</OnLeave>
			<OnHide>
				if ( self.panning ) then
					Model_StopPanning(self);
				end
				self.mouseDown = false;
				self.controlFrame:Hide();
			</OnHide>
		</Scripts>
	</PlayerModel>

	<Frame name="ModelPanningFrame" parent="UIParent" hidden="true" frameStrata="DIALOG" clampedToScreen="true" enableMouse="true">
		<Size x="32" y="32"/>
		<Layers>
			<Layer level="ARTWORK">
				<Texture file="Interface\Cursor\UI-Cursor-Move" setAllPoints="true"/>
			</Layer>
		</Layers>
		<Scripts>
			<OnUpdate>
				local model = self.model;
				local controlFrame = model.controlFrame;
				if ( not IsMouseButtonDown(controlFrame.panButton) ) then
					Model_StopPanning(model);
					if ( controlFrame.buttonDown ) then
						ModelControlButton_OnMouseUp(controlFrame.buttonDown);
					end
					if ( not controlFrame:IsMouseOver() ) then
						controlFrame:Hide();
					end
				end
			</OnUpdate>
		</Scripts>
	</Frame>
	<Frame name="SideDressUpFrame" toplevel="true" parent="UIParent" enableMouse="true" hidden="true">
		<Size>
			<AbsDimension x="187" y="389"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentTop" file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Top">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Bottom">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTop" relativePoint="BOTTOMLEFT"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture parentKey="BGTopLeft" name="$parentBackgroundTop">
					<Size>
						<AbsDimension x="171" y="282"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="5" y="-14"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="0.61" top="0" bottom="1.0"/>
				</Texture>
				<Texture parentKey="BGBottomLeft" name="$parentBackgroundBot">
					<Size>
						<AbsDimension x="171" y="83"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentBackgroundTop" relativePoint="BOTTOMLEFT"/>
					</Anchors>
					<TexCoords left="0" right="0.61" top="0" bottom="0.588"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<DressUpModel name="SideDressUpModel" scale="1.0" inherits="ModelWithControlsTemplate">
				<Size>
					<AbsDimension x="172" y="400"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" x="5" y="-13"/>
					<Anchor point="BOTTOMRIGHT" x="-11" y="11"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						Model_OnLoad(self, MODELFRAME_MAX_PLAYER_ZOOM);
					</OnLoad>
				</Scripts>
				<Frames>
					<Button parentKey="ResetButton" name="$parentResetButton" inherits="UIPanelButtonTemplate" text="RESET">
						<Size>
							<AbsDimension x="80" y="22"/>
						</Size>
						<Anchors>
							<Anchor point="BOTTOM">
								<Offset>
									<AbsDimension x="0" y="40"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnClick>
								SideDressUpModel:Dress();
								PlaySound("gsTitleOptionOK");
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentCloseButton" inherits="UIPanelCloseButton">
						<Anchors>
							<Anchor point="CENTER" relativeTo="SideDressUpFrame" relativePoint="TOPRIGHT">
								<Offset>
									<AbsDimension x="-15" y="-16"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture file="Interface\AuctionFrame\AuctionHouseDressUpFrame-Corner">
									<Size>
										<AbsDimension x="32" y="32"/>
									</Size>
									<Anchors>
										<Anchor point="TOPRIGHT" relativeTo="SideDressUpFrame">
											<Offset>
												<AbsDimension x="-5" y="-5"/>
											</Offset>
										</Anchor>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnClick>
								HideUIPanel(self:GetParent():GetParent());
							</OnClick>
						</Scripts>
					</Button>
				</Frames>
			</DressUpModel>
		</Frames>
		<Scripts>
			<OnLoad>
				self.ResetButton = SideDressUpModel.ResetButton;
			</OnLoad>
			<OnShow function="SideDressUpFrame_OnShow"/>
			<OnHide function="SideDressUpFrame_OnHide"/>
		</Scripts>
	</Frame> 
	<Frame name="DressUpFrame" toplevel="true" enableMouse="true" parent="UIParent" hidden="true">
		<Size>
			<AbsDimension x="384" y="512"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset>
					<AbsDimension x="512" y="-104"/>
				</Offset>
			</Anchor>
		</Anchors>
		<HitRectInsets>
			<AbsInset left="0" right="30" top="0" bottom="45"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="DressUpFramePortrait">
					<Size>
						<AbsDimension x="60" y="60"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="7" y="-6"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopLeft">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture file="Interface\PaperDollInfoFrame\UI-Character-General-TopRight">
					<Size>
						<AbsDimension x="128" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="256" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<Texture file="Interface\PaperDollInfoFrame\SkillFrame-BotLeft">
					<Size>
						<AbsDimension x="256" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="0" y="-256"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<Texture file="Interface\PaperDollInfoFrame\SkillFrame-BotRight">
					<Size>
						<AbsDimension x="128" y="256"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="256" y="-256"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString name="DressUpFrameTitleText" inherits="GameFontHighlight" text="DRESSUP_FRAME">
					<Size>
						<AbsDimension x="300" y="14"/>
					</Size>
					<Anchors>
						<Anchor point="TOP" relativePoint="TOP">
							<Offset>
								<AbsDimension x="0" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="DressUpFrameDescriptionText" inherits="GameFontNormalSmall" text="DRESSUP_FRAME_INSTRUCTIONS">
					<Size>
						<AbsDimension x="260" y="36"/>
					</Size>
					<Anchors>
						<Anchor point="CENTER" relativeTo="DressUpFrameTitleText" relativePoint="BOTTOM">
							<Offset>
								<AbsDimension x="10" y="-22"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="OVERLAY">
				<Texture parentKey="BGTopLeft" name="DressUpBackgroundTopLeft">
					<Size>
						<AbsDimension x="256" y="255"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="22" y="-76"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<Texture parentKey="BGTopRight" name="DressUpBackgroundTopRight">
					<Size>
						<AbsDimension x="62" y="255"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="DressUpBackgroundTopLeft" relativePoint="TOPRIGHT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="BGBottomLeft" name="DressUpBackgroundBotLeft">
					<Size>
						<AbsDimension x="256" y="128"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="DressUpBackgroundTopLeft" relativePoint="BOTTOMLEFT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="BGBottomRight" name="DressUpBackgroundBotRight">
					<Size>
						<AbsDimension x="62" y="128"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="DressUpBackgroundTopLeft" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button name="DressUpFrameCloseButton" inherits="UIPanelCloseButton">
				<Anchors>
					<Anchor point="CENTER" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-46" y="-25"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="DressUpFrameCancelButton" inherits="UIPanelButtonTemplate" text="CLOSE">
				<Size>
					<AbsDimension x="80" y="22"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER" relativePoint="TOPLEFT">
						<Offset>
							<AbsDimension x="305" y="-422"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick function="HideParentPanel"/>
				</Scripts>
			</Button>
			<Button parentKey="ResetButton" name="DressUpFrameResetButton" inherits="UIPanelButtonTemplate" text="RESET">
				<Size>
					<AbsDimension x="80" y="22"/>
				</Size>
				<Anchors>
					<Anchor point="RIGHT" relativeTo="DressUpFrameCancelButton" relativePoint="LEFT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						DressUpModel:Dress();
						PlaySound("gsTitleOptionOK");
					</OnClick>
				</Scripts>
			</Button>
			<DressUpModel name="DressUpModel" scale="2.0" inherits="ModelWithControlsTemplate">
				<Size>
					<AbsDimension x="316" y="331"/>
				</Size>
				<Anchors>
					<Anchor point="BOTTOM">
						<Offset>
							<AbsDimension x="-11" y="105"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						Model_OnLoad(self, MODELFRAME_MAX_PLAYER_ZOOM);
					</OnLoad>
				</Scripts>
			</DressUpModel>
		</Frames>
		<Scripts>
			<OnShow>
				SetPortraitTexture(DressUpFramePortrait, "player");
				PlaySound("igCharacterInfoOpen");
			</OnShow>
			<OnHide>
				PlaySound("igCharacterInfoClose");
			</OnHide>
		</Scripts>
	</Frame>
</Ui>