PDA

View Full Version : Raid member button name??


Jumpy
22-02-2007, 05:13 AM
Scenario: I form a raid with myself and another player (for testing purposes). Pulling out Group1 from the Blizz Raid panel I now see my name and mana and health bars. Below is the other player with health and mana bars.

I now want to put a non-clickable button next to my name or the other player's name. What do I put in the relativeTo: statement for this button?

For example: When in a Party to put such a button next to the bottom party member of a 5 person party the button relativeTo statement would be relativeTo="PartyMemberFrame4". This I know works.

Wintrow
22-02-2007, 08:39 AM
if i'm correct the default Blizz-raidpullouts are found in the table-var RAID_PULLOUT_LIST

like:
local name = UnitName('raid1');
local framename = RAID_PULLOUT_LIST[name];
if framename then
local frame = getglobal(framename);
if frame then
mybutton.SetPoint('TOPLEFT',frame,'TOPRIGHT');
end
end

Jumpy
22-02-2007, 08:10 PM
When I ran the code the player name showed as expected but the framename was not there. So the framename = did not produce any result.

local name = UnitName('raid1');
Addon_Out("Player name= " .. name)
local framename = RAID_PULLOUT_LIST[name];
if framename then
Addon_Out("Frame name is " .. frame)
local frame = getglobal(framename);
if frame then
Addon_RaidButton1.SetPoint('TOPLEFT',frame,'TOPRIGHT');
Addon_RaidButton1:Show()
end
end

Wintrow
22-02-2007, 10:55 PM
Did you have a pull-out visible for that raidmember?

Jumpy
23-02-2007, 12:32 AM
Did you have a pull-out visible for that raidmember?

Yes.

Wintrow
23-02-2007, 09:03 AM
well... try this:

local unit = 'raid1';
local raidno;
_, _, raidno = string.find(unit,'%d+'); -- find the number in the string
if raidno then
Addon_Out('raidno = ' .. raidno)
local framename = 'RaidGroupButton' .. raidno;
Addon_Out("Frame name is " .. framename)
local frame = getglobal(framename);
if frame then
Addon_Out("Frame found");
Addon_RaidButton1.SetPoint('TOPLEFT',frame,'TOPRIGHT');
Addon_RaidButton1:Show();
Addon_Out("Button attached");
end
end

Jumpy
23-02-2007, 06:13 PM
local unit = 'raid1';

Isn't this just going to result in unit being the string "raid1"?

What's frustrating about testing raid addons is that you have to bother friends to join you in a party, convert to a raid, do the test and then thank them and disband. It's too bad you can't simulate being in a raid.

aspinkorgall
24-02-2007, 03:59 AM
Joining Alterac Valley always seemed to be a good way to get myself a raid for testing purposes. Can't say I really looked at the PVP stuff post-BC, but I'm sure it'll still be a suitable option for you.

Jumpy
24-02-2007, 09:21 AM
aspinkorgall - What you don't know about how I write an addon is that I write some code, log in, see the errors where I left off the right parenthesis, log off, fix the error, log in, see the error where I used if x = y and should have used if x == y, log off and over and over again. If I joined a raid with non friends and kept logging in and out they would kill me.

Duugu
24-02-2007, 02:22 PM
How about just reloading your interface instead of logging out and in? :)

Jumpy
24-02-2007, 06:43 PM
I heard that using reloadui can sometimes cause data corruption in the savedvariables. Whether true or not, I don't want to take the chance.

Wintrow
26-02-2007, 01:45 PM
Way too much hassle to log out and in every time. Even IF it can cause data-corruption :p

Jumpy
28-02-2007, 09:23 PM
To answer my first question the button names in CTRA are CT_RAGroup#Button# where # is a number.

To find the correlation between raid# and button name ...
button = CT_RAUnitIdFrameMap["raid#"]["name"]