View Single Post
05-08-11, 10:48 AM   #31
Aprikot
A Frostmaul Preserver
 
Aprikot's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 284
Unhappy TotemFrame buttons

Everything I thought I learned in this thread is availing me little in trying to color the TotemFrame button "borders".

I've tried arbitrarily checking args 1-30 (via select()) for both GetRegions() & GetChildren() against each of the TotemFrame* frames shown in the below framestack screenshot (layers 7-10):



I'm now trying to do it via CreateTexture(), and I think there is trouble with the way I'm interpreting TotemFrame.xml:
lua Code:
  1. local frame = CreateFrame("Button", "TotemButtonTemplate", PlayerFrame)
  2. local texture = frame:CreateTexture("$parentIcon", "OVERLAY")
TotemFrame.xml below for reference. I appreciate any help!
xml Code:
  1. <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/
  2. ..\FrameXML\UI.xsd">
  3.     <Script file="TotemFrame.lua"/>
  4.     <Button name="TotemButtonTemplate" virtual="true" hidden="true">
  5.         <Size>
  6.             <AbsDimension x="37" y="37"/>
  7.         </Size>
  8.         <Layers>
  9.             <Layer level="BACKGROUND">
  10.                 <Texture name="$parentBackground" urgency="5" file="Interface\Minimap\UI-Minimap-Background">
  11.                     <Size x="34" y="34"/>
  12.                     <Anchors>
  13.                         <Anchor point="CENTER">
  14.                             <Offset x="0" y="0"/>
  15.                         </Anchor>
  16.                     </Anchors>
  17.                     <Color r="1" g="1" b="1" a="0.6"/>
  18.                 </Texture>
  19.                 <FontString name="$parentDuration" inherits="GameFontNormalSmall" parentKey="duration">
  20.                     <Anchors>
  21.                         <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent">
  22.                             <Offset x="0" y="5"/>
  23.                         </Anchor>
  24.                     </Anchors>
  25.                 </FontString>
  26.             </Layer>
  27.         </Layers>
  28.         <Frames>
  29.             <Frame name="$parentIcon">
  30.                 <Size x="22" y="22"/>
  31.                 <Anchors>
  32.                     <Anchor point="CENTER">
  33.                         <Offset x="0" y="0"/>
  34.                     </Anchor>
  35.                 </Anchors>
  36.                 <Layers>
  37.                     <Layer level="ARTWORK">
  38.                         <Texture name="$parentTexture"/>
  39.                     </Layer>
  40.                 </Layers>
  41.                 <Frames>
  42.                     <Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate" reverse="true"/>
  43.                 </Frames>
  44.             </Frame>
  45.             <Frame>
  46.                 <Size x="38" y="38"/>
  47.                 <Anchors>
  48.                     <Anchor point="CENTER">
  49.                         <Offset x="0" y="0"/>
  50.                     </Anchor>
  51.                 </Anchors>
  52.                 <Layers>
  53.                     <Layer level="OVERLAY">
  54.                         <Texture file="Interface\CharacterFrame\TotemBorder"/>
  55.                     </Layer>
  56.                 </Layers>
  57.                 <Scripts>
  58.                     <OnLoad>
  59.                         self:SetFrameLevel(_G[self:GetParent():GetName().."Icon"]:GetFrameLevel() + 1);
  60.                     </OnLoad>
  61.                 </Scripts>
  62.             </Frame>
  63.         </Frames>
  64.         <Scripts>
  65.             <OnClick>
  66.                 TotemButton_OnClick(self, button, down);
  67.             </OnClick>
  68.             <OnLoad>
  69.                 TotemButton_OnLoad(self);
  70.             </OnLoad>
  71.             <OnEnter>
  72.                 GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT");
  73.                 GameTooltip:SetTotem(self.slot);
  74.             </OnEnter>
  75.             <OnLeave>
  76.                 GameTooltip:Hide();
  77.             </OnLeave>
  78.         </Scripts>
  79.     </Button>
  80.     <Frame name="TotemFrame" toplevel="true" parent="PlayerFrame" hidden="true">
  81.         <Size>
  82.             <AbsDimension x="128" y="53"/>
  83.         </Size>
  84.         <Anchors>
  85.             <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent">
  86.                 <Offset>
  87.                     <AbsDimension x="99" y="38"/>
  88.                 </Offset>
  89.             </Anchor>
  90.         </Anchors>
  91.         <Frames>
  92.             <Button name="$parentTotem1" inherits="TotemButtonTemplate" id="1">
  93.                 <Anchors>
  94.                     <Anchor point="TOPLEFT">
  95.                         <Offset>
  96.                             <AbsDimension x="0" y="0"/>
  97.                         </Offset>
  98.                     </Anchor>
  99.                 </Anchors>
  100.             </Button>
  101.             <Button name="$parentTotem2" inherits="TotemButtonTemplate" id="2">
  102.                 <Anchors>
  103.                     <Anchor point="LEFT" relativeTo="$parentTotem1" relativePoint="RIGHT">
  104.                         <Offset>
  105.                             <AbsDimension x="-4" y="0"/>
  106.                         </Offset>
  107.                     </Anchor>
  108.                 </Anchors>
  109.             </Button>
  110.             <Button name="$parentTotem3" inherits="TotemButtonTemplate" id="3">
  111.                 <Anchors>
  112.                     <Anchor point="LEFT" relativeTo="$parentTotem2" relativePoint="RIGHT">
  113.                         <Offset>
  114.                             <AbsDimension x="-4" y="0"/>
  115.                         </Offset>
  116.                     </Anchor>
  117.                 </Anchors>
  118.             </Button>
  119.             <Button name="$parentTotem4" inherits="TotemButtonTemplate" id="4">
  120.                 <Anchors>
  121.                     <Anchor point="LEFT" relativeTo="$parentTotem3" relativePoint="RIGHT">
  122.                         <Offset>
  123.                             <AbsDimension x="-4" y="0"/>
  124.                         </Offset>
  125.                     </Anchor>
  126.                 </Anchors>
  127.             </Button>
  128.         </Frames>
  129.         <Scripts>
  130.             <OnLoad function="TotemFrame_OnLoad"/>
  131.             <OnEvent function="TotemFrame_OnEvent"/>
  132.         </Scripts>
  133.     </Frame>
  134. </Ui>
  Reply With Quote