Go Back   CurseForge Forums > World of Warcraft > Development Help
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!

Reply
 
Thread Tools
Old 3 Weeks Ago   #1
nosscire
Newbie
 
Join Date: Oct 2007
Posts: 6
Default Hiding frame outside of raid

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.
nosscire is offline   Reply With Quote
Old 3 Weeks Ago   #2
Farmbuyer
Senior Member
 
Join Date: Feb 2005
Posts: 494
Default Re: Hiding frame outside of raid

Post what code you're currently using someplace and we'll have a look at it.

Quote:
Originally Posted by nosscire View Post
the RAID_ROOSTER_UPDATE
*mental image of raid roosters*
Farmbuyer is offline   Reply With Quote
Old 3 Weeks Ago   #3
Tekkub
Wiki Master
 
Tekkub's Avatar
 
Join Date: Feb 2005
Posts: 4,853
Default Re: Hiding frame outside of raid

If you want help, paste your code.
Tekkub is offline   Reply With Quote
Old 3 Weeks Ago   #4
nosscire
Newbie
 
Join Date: Oct 2007
Posts: 6
Default Re: Hiding frame outside of raid

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")
This code looks alright to me, but unfortunally it doesn't seem to do anything. Also doesn't spit any errors.

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/
nosscire is offline   Reply With Quote
Old 3 Weeks Ago   #5
Tekkub
Wiki Master
 
Tekkub's Avatar
 
Join Date: Feb 2005
Posts: 4,853
Default Re: Hiding frame outside of raid

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...

Tekkub is offline   Reply With Quote
Old 3 Weeks Ago   #6
nosscire
Newbie
 
Join Date: Oct 2007
Posts: 6
Default Re: Hiding frame outside of raid

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.)
nosscire is offline   Reply With Quote
Old 3 Weeks Ago   #7
nosscire
Newbie
 
Join Date: Oct 2007
Posts: 6
Default Re: Hiding frame outside of raid

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!
nosscire is offline   Reply With Quote
Old 3 Weeks Ago   #8
Phanx
Super Moderator
 
Phanx's Avatar
 
Join Date: May 2005
Posts: 5,296
Send a message via AIM to Phanx Send a message via MSN to Phanx Send a message via Yahoo to Phanx
Default Re: Hiding frame outside of raid

Quote:
Originally Posted by nosscire View Post
I thought events could only be recorded by a frame when it was visible? Or is that only valid for the OnUpdate event?
Frames continue to receive events regardless of their visibility.

Also, OnUpdate isn't an event.
__________________
Author of PhanxChat, OnScreenHealth, Ankh Cooldown Timer, ShieldsUp, Creature Comforts, and more.
Phanx is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:46 PM.