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

    <Frame name="GwPaperDollSelectedIndicator" frameStrata="DIALOG" toplevel="true" hidden="true" virtual="true">
        <size x="16" y="32"></size>
        <Anchors>
            <Anchor point="LEFT"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="OVERLAY" textureSubLevel="2">
                <Texture parentKey="arrow" file="Interface\AddOns\GW2_UI\textures\party\manage-group-arrow.png">
                    <Size x="16" y="32"></Size>
                    <Anchors>
                        <Anchor point="LEFT" x="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
    </Frame>

    <ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>

   <ItemButton name="GwPaperDollButtonTemplate" registerForDrag="LeftButton" registerForClicks="LeftButtonUp, RightButtonUp" inherits="SecureHandlerClickTemplate" virtual="true">
        <Size x="49" y="49"></Size>
        <Layers>
            <Layer level="BACKGROUND">
                <Texture parentKey="BACKGROUND" file="Interface\AddOns\GW2_UI\textures\character\slot-bg.png">
                    <Size x="49" y="49"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                    </Anchors>
                    <TexCoords left="0" right="0.25" top="0" bottom="0.25"/>
                </Texture>
            </Layer>
            <Layer level="OVERLAY">
                <FontString parentKey="itemlevel" inherits="GameFontNormalSmall" justifyH="LEFT">
                    <Size x="100" y="10"/>
                    <Color r="1" g="1" b="1"></Color>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="2" y="2"></Anchor>
                    </Anchors>
                </FontString>
                <Texture name="$parentRepair" hidden="true" parentKey="repairIcon" file="Interface/AddOns/GW2_UI/textures/globe/repair.png">
                    <Size x="20" y="20"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                    </Anchors>
                    <TexCoords left="0" right="1" top="0.5" bottom="1"/>
                </Texture>
            </Layer>
        </Layers>
    </ItemButton>

    <Frame name="GwPaperDollBagItemList" hidden="true" virtual="true">
        <Size x="231" y="498"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="10" y="-70"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <Texture file="Interface\AddOns\GW2_UI\textures\character\item-selectbg.png">
                    <Size x="256" y="512"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
        <Frames>
            <Button name="$parentBackButton" parentKey="backButton" inherits="GwCharacterMenuButtonBack,SecureHandlerClickTemplate" text="Character: Equipment">
                <Size x="231" y="50"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="0" y="60"></Anchor>
                </Anchors>
            </Button>
        </Frames>
    </Frame>

    <Frame name="GwCharacterTabContainer" inherits="SecureHandlerBaseTemplate" protected="true" virtual="true">
        <Size x="853" y="627"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0"></Anchor>
        </Anchors>
    </Frame>

    <Button name="CharacterWindowTabSelect" inherits="SecureHandlerClickTemplate" registerForClicks="LeftButtonUp, RightButtonUp" virtual="true">
        <Size x="64" y="40"></Size>
        <Anchors>
            <Anchor point="TOP" relativePoint="TOP"></Anchor>
        </Anchors>
        <Layers>
            <Layer>
                <Texture  parentKey="icon" file="Interface\AddOns\GW2_UI\textures\character\tabicon_character.png">
                    <Size x="64" y="40"></Size>
                    <Anchors>
                        <Anchor point="CENTER"  relativePoint="CENTER"></Anchor>
                    </Anchors>
                    <TexCoords left="0" right="0.5" top="0" bottom="0.625"/>
                </Texture>
            </Layer>
        </Layers>
    </Button>

    <Frame name="GwPaperDollStat" enableMouse="true" virtual="true">
        <Size x="92" y="30"></Size>
        <Anchors>
            <Anchor point="TOPLEFT"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="OVERLAY">
                <Texture name="$parentIcon" parentKey="icon" file="Interface\AddOns\GW2_UI\textures\character\statsicon.png">
                    <Size x="35" y="35"></Size>
                    <Anchors>
                        <Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT"></Anchor>
                    </Anchors>
                </Texture>
                <FontString parentKey="Value" text="Not Loaded" justifyV="MIDDLE" justifyH="LEFT">
                    <Size x="72" y="35"></Size>
                    <Anchors>
                        <Anchor point="LEFT" x="35"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="Label" text="" justifyH="LEFT">
                    <Size x="72" y="20"></Size>
                    <Anchors>
                        <Anchor point="LEFT"></Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
    </Frame>

    <Frame name="GwCharacterMenu" virtual="true">
        <Size x="231" y="498"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="10" y="-20"></Anchor>
        </Anchors>
    </Frame>

    <Button name="GwCharacterMenuButtonTemplate" inherits="GwStandardButtonNoOutline" virtual="true">
        <Size x="231" y="36"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT"></Anchor>
        </Anchors>
        <NormalTexture file="Interface\AddOns\GW2_UI\textures\character\menu-bg.png"></NormalTexture>
        <Layers>
            <Layer textureSubLevel="OVERLAY">
                <Texture parentKey="activeTexture" file="Interface\AddOns\GW2_UI\textures\character\menu-hover.png" hidden="true">
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT"></Anchor>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer>
                <Texture parentKey="arrow" file="Interface\AddOns\GW2_UI\textures\character\menu-arrow.png">
                    <Size x="10" y="20"></Size>
                    <Anchors>
                        <Anchor point="RIGHT" relativePoint="RIGHT"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
    </Button>

    <Button name="GwCharacterMenuButtonBack" inherits="GwStandardButtonNoOutline" virtual="true">
        <Layers>
            <Layer level="OVERLAY" textureSubLevel="8">
                <Texture parentKey="backarrow" file="Interface\AddOns\GW2_UI\textures\character\backicon.png">
                    <Size x="32" y="32"></Size>
                    <Anchors>
                        <Anchor point="LEFT" relativePoint="LEFT"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
    </Button>

    <Button name="GwCharacterMenuBlank" inherits="GwStandardButtonNoOutline" text="Not yet loaded" virtual="true">
        <Scripts>
            <OnLoad>
                self.hover:SetTexture("Interface\\AddOns\\GW2_UI\\textures\\character\\menu-hover.png")
                self.limitHoverStripAmount = 1
                self:ClearNormalTexture()
                local fontString = self:GetFontString()
                fontString:SetTextColor(1, 1, 1, 1)
                fontString:SetShadowColor(0, 0, 0, 0)
                fontString:SetShadowOffset(1, -1)
                fontString:SetFont(DAMAGE_TEXT_FONT, 14, "")
            </OnLoad>
        </Scripts>
    </Button>

    <Frame name="GwCharacterMenuTemplate" virtual="true">
        <Size x="231" y="498"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="10" y="-20"></Anchor>
        </Anchors>
    </Frame>

    <Frame name="GwCharacterMenuFilledTemplate" inherits="GwCharacterMenu,SecureHandlerBaseTemplate" hidden="true" virtual="true">
        <Frames>
            <Button name="$parentTitle" parentKey="titleMenu" inherits="GwCharacterMenuButtonTemplate,SecureHandlerClickTemplate" text="PAPERDOLL_SIDEBAR_TITLES" >
                <Size x="231" y="36"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"></Anchor>
                </Anchors>
            </Button>
            <Button name="$parentGear" parentKey="gearMenu" inherits="GwCharacterMenuButtonTemplate,SecureHandlerClickTemplate" text="EQUIPMENT_MANAGER" >
                <Size x="231" y="36"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeKey="$parent.titleMenu" relativePoint="BOTTOMLEFT"></Anchor>
                </Anchors>
            </Button>
            <Button name="$parentEquipement" parentKey="equipmentMenu" inherits="GwCharacterMenuButtonTemplate,SecureHandlerClickTemplate,SecureHandlerStateTemplate" text="BAG_FILTER_EQUIPMENT" >
                <Size x="231" y="36"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeKey="$parent.gearMenu" relativePoint="BOTTOMLEFT"></Anchor>
                </Anchors>
            </Button>
            <Button name="$parentPet" parentKey="petMenu" inherits="GwCharacterMenuButtonTemplate,SecureHandlerClickTemplate,SecureHandlerStateTemplate" text="PET" >
                <Size x="231" y="36"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeKey="$parent.equipmentMenu" relativePoint="BOTTOMLEFT"></Anchor>
                </Anchors>
            </Button>
        </Frames>
        <Scripts>
            <OnLoad>
                self.petMenu:SetText(PET)
                self.gearMenu:SetText(EQUIPMENT_MANAGER)
                self.equipmentMenu:SetText(BAG_FILTER_EQUIPMENT)
            </OnLoad>
        </Scripts>
    </Frame>

    <CheckButton hidden="true" name="GWIgnoreSlotCheck" parentKey="ignoreSlotCheck" checked="false" virtual="true">
        <Size x="16" y="16"></Size>
        <Anchors>
            <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0"></Anchor>
        </Anchors>
        <NormalTexture file="Interface/AddOns/GW2_UI/textures/uistuff/checkbox.png"></NormalTexture>
        <CheckedTexture file="Interface/AddOns/GW2_UI/textures/uistuff/checkboxchecked.png"></CheckedTexture>
    </CheckButton>

    <Frame name="GwPetPaperdoll" inherits="SecureHandlerBaseTemplate" virtual="true">
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
            <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <Texture parentKey="background" file="Interface\AddOns\GW2_UI\textures\character\windowbg-pet.png">
                    <Size x="853" y="853"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="ARTWORK" textureSubLevel="2">
                <Texture parentKey="classIcon" alphaMode="ADD" file="Interface\AddOns\GW2_UI\textures\character\pet-happiness.png">
                    <Size x="64" y="64"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-145" y="-45"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="OVERLAY">
                <FontString parentKey="characterName" text="Unknown" justifyH="LEFT">
                    <Size x="170" y="40"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-10"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="characterData" text="Level %d class" justifyH="LEFT" justifyV="TOP">
                    <Size x="170" y="40"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-30"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="itemLevel" text="100" justifyH="LEFT">
                    <Anchors>
                        <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.classIcon" x="-5" y="-5"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="itemLevelLabel" text="Level %d class" justifyH="LEFT" justifyV="BOTTOM">
                    <Size x="110" y="40"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeKey="$parent.itemLevel" x="5" y="4"></Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Frames>
            <Button name="$parentBackButton" parentKey="backButton" inherits="GwCharacterMenuButtonBack,SecureHandlerClickTemplate" text="Character: Pet">
                <Size x="231" y="50"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="13" y="-15"></Anchor>
                </Anchors>
            </Button>
            <PlayerModel name="PaperDoll3dModel" inherits="ModelWithZoomTemplate ModelTemplate" enableMouse="true" parentKey="model">
                <Size x="355" y="598"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                    <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        self:SetUnit("pet")
                        Model_OnLoad(self, 4, -0.5, 0, CharacterModelFrame_OnMouseUp)
                    </OnLoad>
                </Scripts>
                <Frames>
                    <StatusBar name="$parentExpBar" minValue="0" maxValue="1" hidden="false" parentKey="expBar">
                        <Size x="380" y="10"></Size>
                        <Anchors>
                            <Anchor point="BOTTOM" relativePoint="BOTTOM"  x="0" y="40"></Anchor>
                        </Anchors>
                        <BarTexture file="Interface\AddOns\GW2_UI\textures\uistuff\gwstatusbar.png"/>
                        <Layers>
                            <Layer level="BACKGROUND">
                                <Texture file="Interface\AddOns\GW2_UI\textures\uistuff\gwstatusbar-bg.png">
                                    <Anchors>
                                    <Anchor point="TOPLEFT"  relativePoint="TOPLEFT" x="-2" y="2"></Anchor>
                                    <Anchor point="BOTTOMRIGHT"  relativePoint="BOTTOMRIGHT" x="2" y="-2"></Anchor>
                                </Anchors>
                            </Texture>
                        </Layer>
                            <Layer level="ARTWORK">
                                <Texture name="$parentSpark" file="Interface\AddOns\GW2_UI\textures\uistuff\statusbar-spark-white.png">
                                    <Size x="10" y="10"></Size>
                                    <Anchors>
                                        <Anchor point="RIGHT" relativePoint="LEFT" x="0" y="0"></Anchor>
                                    </Anchors>
                                </Texture>
                                <FontString parentKey="value" text="%s / %s" justifyH="CENTER">
                                    <Size x="380" y="8"></Size>
                                    <Anchors>
                                        <Anchor point="CENTER"></Anchor>
                                    </Anchors>
                                </FontString>
                            </Layer>
                        </Layers>
                        <Scripts>
                            <OnLoad>
                                self:SetStatusBarColor(GW2_ADDON.Colors.FactionBarColors[4]:GetRGB())
                                self.value:SetFont(UNIT_NAME_FONT, 12, "")
                                self.value:SetShadowColor(0, 0, 0, 1)
                                self.value:SetShadowOffset(1, -1)

                                local BNAME = self:GetName()
                                hooksecurefunc(self, "SetValue", function(self)
                                    local min, max = self:GetMinMaxValues()
                                    local v = self:GetValue()
                                    local width = math.max(1, math.min(10, 10 * ((v / max) / 0.1)))
                                    _G[BNAME .. "Spark"]:SetPoint("RIGHT", self, "LEFT", self:GetWidth() * (v / max), 0)
                                    _G[BNAME .. "Spark"]:SetWidth(width)
                                end)
                            </OnLoad>
                        </Scripts>
                    </StatusBar>
                </Frames>
            </PlayerModel>
            <Frame parentKey="stats">
                <Size x="184" y="301"></Size>
                <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-120"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="ARTWORK">
                        <Texture file="Interface\AddOns\GW2_UI\textures\character\statsbg.png">
                            <Size x="256" y="512"></Size>
                            <Anchors>
                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                    </Layer>
                    <Layer level="OVERLAY">
                        <FontString parentKey="header" text="Attributes" justifyH="LEFT">
                            <Size x="180" y="40"></Size>
                            <Anchors>
                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="8" y="2"></Anchor>
                            </Anchors>
                        </FontString>
                    </Layer>
                </Layers>
                <Scripts>
                    <OnLoad>
                        self.header:SetFont(DAMAGE_TEXT_FONT, 14, "")
                        self.header:SetText(STAT_CATEGORY_ATTRIBUTES)

                        self:RegisterEvent("PET_UI_UPDATE")
                        self:RegisterEvent("PET_BAR_UPDATE")
                        self:RegisterEvent("PET_UI_CLOSE")
                        self:RegisterEvent("UNIT_PET")
                        self:RegisterEvent("UNIT_PET_EXPERIENCE")
                        self:RegisterEvent("UNIT_MODEL_CHANGED")
                        self:RegisterEvent("UNIT_LEVEL")
                        self:RegisterEvent("UNIT_RESISTANCES")
                        self:RegisterEvent("UNIT_STATS")
                        self:RegisterEvent("UNIT_DAMAGE")
                        self:RegisterEvent("UNIT_RANGEDDAMAGE")
                        self:RegisterEvent("UNIT_ATTACK_SPEED")
                        self:RegisterEvent("UNIT_ATTACK_POWER")
                        self:RegisterEvent("UNIT_RANGED_ATTACK_POWER")
                        self:RegisterEvent("UNIT_DEFENSE")
                        self:RegisterEvent("UNIT_ATTACK")
                        self:RegisterEvent("UNIT_PET_TRAINING_POINTS")
                        self:RegisterEvent("UNIT_HAPPINESS")
                    </OnLoad>
                </Scripts>
            </Frame>
        </Frames>
    </Frame>

    <Frame name="GwPaperHonor" inherits="SecureHandlerBaseTemplate" hidden="true" virtual="true">
        <Size x="608" y="621"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="245" y="-5"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <Texture file="Interface\AddOns\GW2_UI\textures\character\paperdollbg.png">
                    <Size x="608" y="621"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
        <Frames>
            <Button name="$parentBackButton" parentKey="backButton" inherits="GwCharacterMenuButtonBack,SecureHandlerClickTemplate">
                <Size x="231" y="50"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="-232" y="-10"></Anchor>
                </Anchors>
            </Button>
            <Frame name="$parentHonorDetails" parentKey="HonorDetails" inherits="SecureHandlerBaseTemplate" hidden="true" virtual="true">
                <Size x="580" y="576"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="-2" y="-10"></Anchor>
                </Anchors>
            </Frame>
        </Frames>
        <Scripts>
            <OnLoad>
                self.backButton:SetText(CHARACTER .. ": " .. PVP)
            </OnLoad>
        </Scripts>
    </Frame>

    <Frame name="GwPaperBattleground" inherits="SecureHandlerBaseTemplate" hidden="true" virtual="true">
        <Size x="608" y="621"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="245" y="-5"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <Texture file="Interface\AddOns\GW2_UI\textures\character\paperdollbg.png">
                    <Size x="608" y="621"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
        <Frames>
            <Button name="$parentBackButton" parentKey="backButton" inherits="GwCharacterMenuButtonBack,SecureHandlerClickTemplate">
                <Size x="231" y="50"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="-232" y="-10"></Anchor>
                </Anchors>
            </Button>
            <Frame name="$parentBattlegroundDetails" parentKey="BattlegoundDetails" inherits="SecureHandlerBaseTemplate" hidden="true" virtual="true">
                <Size x="580" y="576"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="-2" y="-10"></Anchor>
                </Anchors>
            </Frame>
        </Frames>
        <Scripts>
            <OnLoad>
                self.backButton:SetText(CHARACTER .. ": " .. BATTLEGROUND)
            </OnLoad>
        </Scripts>
    </Frame>

    <Button name="GwDressingRoom" inherits="SecureHandlerBaseTemplate" enableMouse="true" registerForClicks="LeftButtonUp" virtual="true">
        <Size x="608" y="621"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="245" y="-5"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <Texture file="Interface\AddOns\GW2_UI\textures\character\paperdollbg.png">
                    <Size x="608" y="621"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="ARTWORK" textureSubLevel="2">
                <Texture parentKey="classIcon" alphaMode="ADD" file="Interface\AddOns\GW2_UI\textures\party\classicons.png">
                    <Size x="50" y="50"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-145" y="-45"></Anchor>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="OVERLAY">
                <FontString parentKey="characterName" text="Unknown" justifyH="LEFT">
                    <Size x="180" y="20"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-5"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="characterData" text="Level %d class" justifyH="LEFT">
                    <Size x="180" y="20"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-25"></Anchor>
                    </Anchors>
                </FontString>
                <FontString parentKey="itemLevel" text="100" justifyH="LEFT">
                    <Size x="180" y="40"></Size>
                    <Anchors>
                        <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.classIcon" x="10" y="0"></Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Frames>
             <Frame parentKey="itemLevelFrame" hidden="false">
                <Size x="180" y="20"></Size>
                <Anchors>
                    <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.classIcon" x="10" y="0"></Anchor>
                </Anchors>
                <Scripts>
                    <OnEnter>
                        local avgItemLevel, avgItemLevelEquipped = GetAverageItemLevel();
                        avgItemLevel = floor(avgItemLevel);
                        avgItemLevelEquipped = floor(avgItemLevelEquipped);

                        self.tooltip = HIGHLIGHT_FONT_COLOR_CODE..format(PAPERDOLLFRAME_TOOLTIP_FORMAT, STAT_AVERAGE_ITEM_LEVEL).." "..avgItemLevel;
                        if (avgItemLevelEquipped ~= avgItemLevel) then
                            self.tooltip = self.tooltip .. "  " .. format(STAT_AVERAGE_ITEM_LEVEL_EQUIPPED, avgItemLevelEquipped);
                        end
                        self.tooltip = self.tooltip .. FONT_COLOR_CODE_CLOSE;
                        self.tooltip2 = STAT_AVERAGE_ITEM_LEVEL_TOOLTIP;

                        GameTooltip:SetOwner(self, "ANCHOR_TOP")
                        GameTooltip:SetText(self.tooltip)
                        if self.tooltip2 then
                            GameTooltip:AddLine(self.tooltip2, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true)
                        end
                        GameTooltip:Show()
                    </OnEnter>
                    <OnLeave function="GameTooltip_Hide"/>
                </Scripts>
            </Frame>
            <Frame parentKey="stats">
                <Size x="184" y="301"></Size>
                <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="-105"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="ARTWORK">
                        <Texture file="Interface\AddOns\GW2_UI\textures\character\statsbg.png">
                            <Size x="256" y="512"></Size>
                            <Anchors>
                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                    </Layer>
                    <Layer level="OVERLAY">
                        <FontString parentKey="header" text="Attributes" justifyH="LEFT">
                            <Size x="180" y="40"></Size>
                            <Anchors>
                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="8" y="2"></Anchor>
                            </Anchors>
                        </FontString>
                    </Layer>
                </Layers>
                <Scripts>
                    <OnLoad>
                        self.header:SetFont(DAMAGE_TEXT_FONT, 14, "")
                        self.header:SetText("|TInterface\\AddOns\\GW2_UI\\textures\\party\\roleicon-healer.png:12:12:0:1|t " .. STAT_CATEGORY_ATTRIBUTES)
                        self:RegisterEvent("PLAYER_ENTERING_WORLD")

                        self:RegisterEvent("CHARACTER_POINTS_CHANGED")
                        self:RegisterEvent("UNIT_MODEL_CHANGED")
                        self:RegisterEvent("UNIT_LEVEL")
                        self:RegisterEvent("UNIT_STATS")
                        self:RegisterEvent("UNIT_RANGEDDAMAGE")
                        self:RegisterEvent("UNIT_ATTACK_POWER")
                        self:RegisterEvent("UNIT_RANGED_ATTACK_POWER")
                        self:RegisterEvent("UNIT_ATTACK")
                        self:RegisterEvent("UNIT_SPELL_HASTE")
                        self:RegisterEvent("UNIT_RESISTANCES")
                        self:RegisterEvent("PLAYER_GUILD_UPDATE")
                        self:RegisterEvent("SKILL_LINES_CHANGED")
                        self:RegisterEvent("COMBAT_RATING_UPDATE")
                        self:RegisterEvent("UNIT_NAME_UPDATE")
                        self:RegisterEvent("BAG_UPDATE")
                        self:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
                        self:RegisterEvent("PLAYERBANKSLOTS_CHANGED")
                        self:RegisterEvent("PLAYER_AVG_ITEM_LEVEL_UPDATE")
                        self:RegisterEvent("PLAYER_DAMAGE_DONE_MODS")
                        self:RegisterEvent("SPELL_POWER_CHANGED")
                        self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
                        self:RegisterEvent("CHARACTER_ITEM_FIXUP_NOTIFICATION")
                        self:RegisterEvent("UNIT_NAME_UPDATE")
                        self:RegisterEvent("UNIT_INVENTORY_CHANGED")
                        self:RegisterEvent("UPDATE_INVENTORY_ALERTS")
                        self:RegisterEvent("MASTERY_UPDATE")

                        self:RegisterUnitEvent("UNIT_DAMAGE", "player")
                        self:RegisterUnitEvent("UNIT_ATTACK_SPEED", "player")
                        self:RegisterUnitEvent("UNIT_MAXHEALTH", "player")
                        self:RegisterUnitEvent("UNIT_AURA", "player")
                    </OnLoad>
                </Scripts>
            </Frame>
            <Frame name="$parentGear" parentKey="gear">
                <Size x="184" y="301"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="10" y="-10"></Anchor>
                    <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-10" y="10"></Anchor>
                </Anchors>
            </Frame>
            <PlayerModel inherits="ModelWithZoomTemplate ModelWithControlsTemplate ModelTemplate" enableMouse="true" parentKey="model">
                <Size x="355" y="598"></Size>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="60" y="20"></Anchor>
                </Anchors>
            </PlayerModel>
        </Frames>
    </Button>

    <Frame name="GwCharacterWindowContainer" inherits="SecureHandlerBaseTemplate" protected="true" virtual="true" frameStrata="HIGH">
        <Size x="853" y="627"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0"></Anchor>
        </Anchors>
    </Frame>

    <Frame name="GwPetContainer" inherits="SecureHandlerBaseTemplate" virtual="true">
        <Size x="853" y="627"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0"></Anchor>
        </Anchors>
    </Frame>

    <Frame name="GwCharacterWindow" inherits="SecureHandlerStateTemplate,SecureHandlerAttributeTemplate,SecureHandlerShowHideTemplate,SecureHandlerClickTemplate" enableMouse="true" virtual="true" protected="true" hidden="true" frameStrata="HIGH" movable="true" resizable="true" toplevel="true">
        <Size x="853" y="627"></Size>
        <Layers>
            <Layer level="ARTWORK">
                <Texture parentKey="background" file="Interface\AddOns\GW2_UI\textures\character\windowbg.png">
                    <Size x="853" y="853"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0"></Anchor>
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader.png">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader-right.png">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
                    <Texture name="$parentLeft" file="Interface\AddOns\GW2_UI\textures\bag\bagleftpanel.png">
                    <Size x="40" y="512"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="0" y="20" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="ARTWORK" textureSubLevel="2">
                <Texture name="$parentLeft" parentKey="windowIcon" file="Interface\AddOns\GW2_UI\textures\character\character-window-icon.png">
                    <Size x="84" y="84"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="TOPLEFT" x="18" y="-22" />
                    </Anchors>
                </Texture>
                <Texture  file="Interface\AddOns\GW2_UI\textures\bag\bottom-right.png">
                    <Size x="128" y="128"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <FontString name="$parentHeaderString" parentKey="WindowHeader" text="Character" inherits="GameFontNormalSmall" justifyH="LEFT">
                    <Size x="512" y="40"></Size>
                    <Color r="1" b="0.73" g="0.93"></Color>
                    <Anchors>
                        <Anchor point="TOPLEFT" x="10" y="38"></Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Frames>
            <Button parentKey="secure" name="$parentClick" inherits="SecureHandlerClickTemplate" hidden="true"/>
            <Frame parentKey="mover" enableMouse="true" inherits="SecureHandlerMouseUpDownTemplate">
                <Size y="40"/>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="-40" y="0"></Anchor>
                    <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="-30" y="0"></Anchor>
                </Anchors>
            </Frame>
            <Frame parentKey="sizer" enableMouse="true">
                <Size x="32" y="32"></Size>
                <Anchors>
                    <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="OVERLAY">
                        <Texture parentKey="texture" file="Interface/AddOns/GW2_UI/textures/uistuff/resize.png">
                            <Size x="32" y="32"></Size>
                            <Anchors>
                                <Anchor point="BOTTOMRIGHT" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                    </Layer>
                </Layers>
            </Frame>
            <Button name="$parentClose" parentKey="close" inherits="SecureHandlerClickTemplate" text="" framelevel="10">
                <Size x="20" y="20"/>
                <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="30"/>
                </Anchors>
                <NormalTexture file="Interface\AddOns\GW2_UI\textures\uistuff\window-close-button-normal.png"/>
                <PushedTexture file="Interface\AddOns\GW2_UI\textures\uistuff\window-close-button-hover.png"/>
                <HighlightTexture file="Interface\AddOns\GW2_UI\textures\uistuff\window-close-button-hover.png"/>
                <NormalFont style="ChatBubbleFont"/>
                <HighlightFont style="ChatBubbleFont"/>
            </Button>
        </Frames>
    </Frame>

</Ui>
