Hmm I do not get it to work,
This is the way we creating the template:
Code:
<ItemButton name="GwPaperDollButtonTemplate" registerForDrag="LeftButton" registerForClicks="LeftButtonUp RightButtonUp" mixin="ContainerFrameItemButtonMixin" virtual="true">
<Size x="49" y="49"></Size>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="BACKGROUND" file="Interface\AddOns\GW2_UI\textures\character\slot-bg">
<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">
<Texture name="$parentRepair" hidden="true" parentKey="repairIcon" file="Interface\AddOns\GW2_UI\textures\repair">
<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>
<Frames>
<CheckButton hidden="true" name="$parentCheckButton" checked="false">
<Size x="160" y="160"></Size>
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="10" y="0"></Anchor>
</Anchors>
<NormalTexture file="Interface\AddOns\GW2_UI\textures\checkbox"></NormalTexture>
<CheckedTexture file="Interface\AddOns\GW2_UI\textures\checkboxchecked"></CheckedTexture>
</CheckButton>
</Frames>
</Layers>
</ItemButton>
<ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>
And this to use it:
Code:
<ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>
or
Code:
<ItemButton name="GwPaperDollHeadSlot" parentKey="head" inherits="GwPaperDollButtonTemplate,PaperDollAzeriteItemOverlayTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY" textureSubLevel="2">
<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>
</Layer>
</Layers>
<Frames>
<CheckButton hidden="true" name="$parentCheckButton" parentKey="ignoreSlotCheck" checked="false">
<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\checkbox"></NormalTexture>
<CheckedTexture file="Interface\AddOns\GW2_UI\textures\checkboxchecked"></CheckedTexture>
</CheckButton>
</Frames>
</ItemButton>
but we get this error all the time:
Code:
3x ...faceGW2_UI\character/paperdoll_equipment.lua:194: attempt to index field 'IconBorder' (a nil value)
...faceGW2_UI\character/paperdoll_equipment.lua:194: in function <...faceGW2_UI\character/paperdoll_equipment.lua:193>
...faceGW2_UI\character/paperdoll_equipment.lua:504: in function <...faceGW2_UI\character/paperdoll_equipment.lua:487>
...faceGW2_UI\character/paperdoll_equipment.lua:531: in function <...faceGW2_UI\character/paperdoll_equipment.lua:512>
...faceGW2_UI\character/paperdoll_equipment.lua:933: in function `LoadPDBagList'
GW2_UI\character/paperdoll.lua:100: in function `?'
GW2_UI\character/character.lua:423: in function `LoadCharacter'
GW2_UI\GW2_ui.lua:506: in function <GW2_UI\GW2_ui.lua:423>
GW2_UI\GW2_ui.lua:588: in function <GW2_UI\GW2_ui.lua:584>
Locals:
self = gwPaperDollBagSlotButton1 {
0 = <userdata>
in this Code:
Code:
self.IconBorder:SetSize(self:GetSize(), self:GetSize())
Hope you can help me