Thread Tools Display Modes
05-05-14, 11:25 AM   #1
FaulTier
A Theradrim Guardian
 
FaulTier's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 61
Create a Border for RaidTargetIcons

Hi there.

As i'm currently playing around with my oUF_Fauli, i'd like to set the RaidTargetIcons outside my Unitframes - but as they look quite ugly without an background and border, i'd like to create each of them for the RaidIcons of every Unitframe from oUF.

Sadly, with "/framestack" I won't get any framenames for those RaidIcons.

Anyone got Ideas how to parent anything to oUF generated RaidTargetIcons?

Greetz
__________________
  Reply With Quote
05-05-14, 10:14 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Use framestack to find the name of your unitframes, then append .RaidIcon to it.
If you don't set a name for your frames in :Spawn(), oUF does it for you (oUF_<stylename><unit>)

In your case, try this:
Code:
oUF_FauliGlobalPlayer.RaidIcon
oUF_FauliGlobalFocus.RaidIcon
oUF_FauliBossBoss1.RaidIcon
etc..
  Reply With Quote
05-06-14, 10:39 AM   #3
FaulTier
A Theradrim Guardian
 
FaulTier's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 61
alright - thanks so far!
How ever, it seems I'm too dumb right now, to get it work.
I added the following lines to my lib.lua
Lua Code:
  1. -- Create RaidIconsBackdrop and Border
  2. lib.CreateRaidIconBorder = function(f)
  3.     IB = CreateFrame("Frame", f.IconBorder, f.RaidIcon)
  4.     IB:SetStatusBarTexture(cfg.statusbar_texture)
  5.     IB:SetPoint("CENTER", f.RaidIcon, "CENTER", 0, 0)
  6.     IB:SetFrameLevel(5)
  7.     IB:Show()
  8. end

and ofc added "lib.CreateRaidIconBorder(self) to my frame in core.lua - i'm getting the following error:
Code:
1x Wrong object type for function
<in C code>
<in C code>
oUF_Fauli-r15\lib.lua:303: in function "CreateRaidIconBorder"
oUF_Fauli-r15\core.lua:52: in function <oUF_Fauli\core.lua:12>
(tail call): ?
oUF-1.6.5\ouf-1.6.5.lua:262: in function <oUF\ouf.lua:192>
(tail call): ?
oUF-1.6.5\ouf-1.6.5.lua:552: in function "Spawn"
oUF_Fauli-r15\core.lua:292: in function "func"
oUF-1.6.5\factory.lua:20: in function <oUF\factory.lua:16>
(tail call): ?

Locals:
(*temporary) = "Frame"
(*temporary) = nil
(*temporary) = <unnamed> {
 0 = <userdata>
}
 = <function> defined =[C]:-1
 = <function> defined @Interface\AddOns\kgPanels\kgPanels.lua:296
What am I doing wrong or how would you realise it?
greetz
__________________
  Reply With Quote
05-06-14, 07:20 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If this is your own layout, why are you creating a separate function to put a backdrop on the raid target icon? Just add the backdrop in the same place you create the icon in the first place.

Also, you can't parent a frame to a texture, and the second argument to CreateFrame must be either a string or nil (and for something like this should be nil), one of which is why you're getting that error.

Code:
local iconFrame = CreateFrame("Frame", nil, f)
iconFrame:SetPoint("RIGHT", 5, 0)
iconFrame:SetSize(24, 24)

iconFrame:SetBackdrop({
     bgFile = "Interface\\BUTTONS\\WHITE8x8", tile = true, tileSize = 8,
     edgeFile = "Interface\\BUTTONS\\WHITE8x8", edgeSize = 1,
     insets = { left = 1, right = 1, top = 1, bottom = 1 }
})
iconFrame:SetBackdropColor(0, 0, 0, 0.5)
iconFrame:SetBackdropBorderColor(0, 0, 0, 1)

local icon = iconFrame:CreateTexture(nil, "ARTWORK")
icon:SetAllPoints(true)
icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
iconFrame.icon = icon

iconFrame.Override = function(self, event)
     local index = GetRaidTargetIndex(self.unit)
     if index then
          SetRaidTargetIconTexture(self.RaidIcon.icon, index)
          self.RaidIcon:Show()
     else
          self.RaidIcon:Hide()
     end
end

f.RaidIcon = iconFrame
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Create a Border for RaidTargetIcons

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off