Thread Tools Display Modes
08-27-09, 09:27 AM   #1
danltiger
A Murloc Raider
 
danltiger's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 9
Secure Group Headers

I've been having problems getting SecureGroupHeaderTemplate to work. Yes, I've looked at examples in oUF, Grid, and other forum posts. I imagine I'm missing something completely simple, though.

Just as a simple test, I have this small bit of code:
Code:
-- Code removed: See updated post, below.
I've also got my character in a raid group. No luck. I expected to see that the client code generated a button frame for me. Are there additional required attributes that I need to set?

Thanks for the help :-)

Last edited by danltiger : 08-27-09 at 10:21 AM.
  Reply With Quote
08-27-09, 09:36 AM   #2
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
You need to use the showRaid attribute for it will create buttons for raid members, see: http://wowprogramming.com/docs/secur.../Group_Headers for more information.
  Reply With Quote
08-27-09, 10:20 AM   #3
danltiger
A Murloc Raider
 
danltiger's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 9
S,

Thanks for the quick response. To be sure, I'd messed with setting the attributes before. (In fact, I had quite a bit of code, but I keep trimming more and more to just get something that works)

Here's what I'm using, now: (edit: which, after testing, did not work. I'm a little stumped)
Code:
-- Updated: See below.
The book apparently has some good examples, but I really hate buying something that'll end up being firewood in a few years.

http://forums.wowace.com/showthread.php?p=271961 includes a little more info.

Last edited by danltiger : 08-27-09 at 08:41 PM.
  Reply With Quote
08-27-09, 08:41 PM   #4
danltiger
A Murloc Raider
 
danltiger's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 9
Ok, after messing around for quite a while, I managed to break it down to this:

Code:
local function OnShowButton(button)
   local unitid = button:GetAttribute("unit") 
   local name = UnitName(unitid)
   print(unitid..":"..name)
end

local function ConfigureUnitButton(button, other)
   -- No attribute data, at this point.
   -- When the button is shown, data will be there.
   button:SetScript("OnShow", OnShowButton)
end

local function CreateRaidFrame()
   local name = "PRHeader1"
   local template = "SecureGroupHeaderTemplate"
   
   frame = CreateFrame("Frame", name, UIParent, template)
   frame:SetAttribute("template", "SecureUnitButtonTemplate")
   frame:SetAttribute("templateType", "Button")
   frame:SetAttribute("groupFilter", "1,2,3,4,5,6,7,8")
   frame:SetAttribute("showRaid", true)
   frame:SetAttribute("showPlayer", true)
   frame:SetAttribute("showSolo", true)
   frame.initialConfigFunction = ConfigureUnitButton
   return frame
end

local RaidFrame =  CreateRaidFrame()
RaidFrame:Show()
That seems to be just about the minimum code to get the frames operational.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Secure Group Headers


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