|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Development Help Need help from other developers, come here to talk about it! |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Newbie
Join Date: Oct 2007
Posts: 6
|
Hey guys!
I'm almost done with my first addon, but there's one small thing i'm missing. I have one frame (made in XML) and one LUA file. The frame is called AzDKPForm. Basicly, I want this frame to always be hidden outside of raids, and always shown in raids. I've Understood that I have to use the RAID_ROOSTER_UPDATE event to check this, and also GetNumRaidMembers(), but I just can't get it to work. Anyone got some kind of standarized code for this? Thanks Last edited by nosscire; 3 Weeks Ago at 12:07 AM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2005
Posts: 494
|
|
|
|
|
|
|
#3 |
|
Wiki Master
Join Date: Feb 2005
Posts: 4,853
|
If you want help, paste your code.
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Oct 2007
Posts: 6
|
Alright, the code I tried using was the following:
Code:
local frame = CreateFrame("AzDKP_Frame")
AzDKP_Frame:SetSecript("OnEvent", function()
if GetNumRaidMembers() > 0 and AzDKPForm:IsShown() then
AzDKPForm:Hide();
elseif not AzDKPForm:IsShown() then
AzDKPForm:Show();
end
end)
AzDKP_Frame:RegisterEvent("RAID_ROSTER_UPDATE")
I have also uploaded my code here on Curseforge, if you want to have a look at all of it, however there I don't have this code included: http://wow.curseforge.com/addons/azdkp/ |
|
|
|
|
|
#5 |
|
Wiki Master
Join Date: Feb 2005
Posts: 4,853
|
You've got a lot of typos and errors in there. I assume AzDKPForm is a frame that's already defined somewhere else? If so than all you need is...
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Oct 2007
Posts: 6
|
I thought events could only be recorded by a frame when it was visible? Or is that only valid for the OnUpdate event?
In any case, will try that out when I get home this afternoon, thanks for the help man ![]() (And yeah, what I posted had allot of typos and stuff, not quite sure how that happened when I copy-pasted in here. It didn't have that in my real code.) |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Oct 2007
Posts: 6
|
Ah, got it to work. For some reason I couldn't set these things in my LUA files, as it said the value of AzDKPForm was nil. Guess i'm doing it wrong somewhere.
Added the scripts right into the XML instead, and that works nicely ![]() Thanks! |
|
|
|
|
|
#8 | |
|
Super Moderator
|
Quote:
Also, OnUpdate isn't an event.
__________________
Author of PhanxChat, OnScreenHealth, Ankh Cooldown Timer, ShieldsUp, Creature Comforts, and more. |
|
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 10:46 PM.










