Quantcast
WoWInterface - View Single Post - "Unhiding" RuneFrame
View Single Post
08-03-16, 09:24 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, rather than setting generic keys like "unit" on arbitrary frames that don't belong to you (like the UIParent) it's probably better to create an intermediate frame, and parent the RuneFrame to that. Then you don't have to worry about overriding, or being overridden by, other addons or default UI code.

lua Code:
  1. local f = CreateFrame("Frame", "RuneFrameContainer", UIParent)
  2. f:SetSize(130, 18) -- default size of RuneFrame, but doesn't actually matter
  3. f:SetPoint("TOP", UIParent, "CENTER") -- use this to set your desired position
  4.  
  5. f.unit = "player"
  6. -- set any other things the RuneFrame needs here
  7.  
  8. RuneFrame:SetParent(f)
  9. RuneFrame:ClearAllPoints()
  10. RuneFrame:SetPoint("TOP", f) -- position the container, not this
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!