A little script help for kgpanels
Ok so heres the deal. For my raid healing ui i have 2 panels created for kgpanels. one for 10 and one for 25. The thing is i want the proper panels to show up based on the number of people i have in the raid.
I tired to work out the sample scripts on the page containing them over at wowace but im having the hardest time getting it to work. (translation i suck at anything pertaining to code) In short: In a 10 man raid id like panel 1 to show and panel 2 to hide. And the reverse to happen when in a 25 (1 to hide and 2 to show) and both hidden if im in a 5 man. Any assistance would be appreciated. |
Code:
local party, mode = GetNumPartyMembers(), GetCurrentDungeonDifficulty() |
Thanks for the help. ill give it a test run and let you know =)
|
Take those two Hide() lines and move them into the OnLoad section of your scripts (where you register for the events).
|
Quote:
|
Quote:
Put PANEL1:Hide() PANEL2:Hide() in OnLoad and the OnEvent should be: Code:
local party, mode = GetNumPartyMembers(), GetCurrentDungeonDifficulty() |
Just to experiment i did it both ways and they hide in both versions. What i did change however is in each panel i only had it hide itself
simply self:Hide() and that worked just fine. having a panel name or number was causing issues. the numbers changed each time i did a /reloadui so that wasnt going to work. and the names kept throwing errors. What i ended up with after much fussing and trying to learn what the hell was going on ( as well as learing a little bit anout the local tyhingy at the beginning) i have this: Code:
local inRaid = UnitInRaid("player") For the OnLoad bit i just slapped in there what was on the wowace page with examples. No idea if its necessary ot not but here it is (be gentle im still learning hehe): Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") As always thanks for the help. =) |
You can't do this in each panel though. You can only register an event once. Unless that was just a restriction of eePanels (or it has changed since kgPanels was first released...) In the kgPanels in-game FAQ is a way to get a reference to a panel so you can call multiple panels from one script. I think it's
Code:
kgPanels:Fetch("the name you gave the panel when you made it") OnLoad: Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local inRaid = UnitInRaid("player") |
Ahh so thats how you use the fetch bit. ill have to do that then and see how it goes.
As for registering the event in both panels i recall it being mentioned on the sample scripts page though i may have misread it. I just went to look abnd the page is throwing an error at the moment so ill edit later once i can access the page. As far as putting the scripts in the panel with the higher number when ever i use the script to find a frame and get the numbers then do a /reloadui the numbers kept changing. Example being the 10 man panel listed as panel 1 initially then after reload it was panel 3. To be fair i havent updated kgpanels in forever since ive never had an issue so ill try that first. Thanks again for the assist. Learning little by little hehe. EDIT: Finally got the page of the sample scripts to load, this is a direct quote: Quote:
|
been trying out these codes for a while and i would like too bring up this old thread.
I need help with hiding 2 textures (background and overlayer) when i go in too 10 man aswell as hiding 2 textures when im 10 man (2 different textures for 10 and 25 man). Party dosen't matter So when im in raid 2>10 i want Raid 10 and Raid 10 ol (panel name) only being seen and Panel name: Raid 25 with Raid 25 ol hiding. and then Raid 25 with Raid 25 ol shown when its 11 ppl in the raid. I have anchor'd raid 25 so it shows when some one enter the 3d group in a raid. so all i have too do is hide 10 man raid texture when the 25 one pops up. ive been trying to go on lazy stile and tryed too cower the other texture with panel lvls but it does not work as i want becouse of the overlayer. Edit: So after a few hours i think i got it right. but i would like someone too take an eye pop if i got it right.. For OnLoad: Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local pmems = GetNumPartyMembers() Code:
local pmems = GetNumPartyMembers() Many thanks and spank's Kapone over and out. |
anyone =/?
|
Your code looks fine. Your post was very hard to follow between the long run-on sentences, the shortage of punctuation, and the surplus of spelling errors. If you really need to use such long sentences, please use commas to break them up into more readable pieces. If there was a question in there that needed an answer, I missed it. Is your code not working the way you want it to? If not, what behavior do you need to change, and what trouble are you having trying to change it?
|
Sorry for bad spelling.
My Question is if that code will Load the 10 man raid texture when at least 1 person is in raid. A switch too 25 man raid texture when the raid hits 11 member's and higher also. I'd rather ask someone that knows before i upload a new version of my ui. and looking for raids when i barley have any time too play aint a option. Thanks for a answer Phanx and i hope this one was more read-able. |
No; the way you've written your code, the 10-man texture will show when:
To get something that shows when there are 1-10 raid members, and hides otherwise, it doesn't matter how many people are in your party, so you don't need to check that: Code:
local raid = GetNumRaidMembers() Code:
local raid = GetNumRaidMembers() |
Thanks allot =) it did the trick i had some issues tooday with that 11th persone.
|
thanks too blizzards new update allot of my code is broken.. this is what i have at the moment
On load: All panels get it (10 man + 10man ol and 25man etc) Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local raid = GetNumRaidMembers() Code:
local raid = GetNumRaidMembers() Anyways and eighter way thanks already |
GetNumRaidMembers has been replaced with GetNumGroupMembers and IsInRaid.
Use the IsInRaid() boolean to make sure you are in a raid, and use GetNumGroupMembers to replace the functionality of GetNumRaidMembers. Try: Lua Code:
Expand the concepts to where ever else you need. Edit: I suppose you could remove the "raid" variable, and change the IF statement to: Lua Code:
|
Quote:
Code:
if IsInRaid() and GetNumGroupMembers() >=1 and GetNumGroupMembers() <= 10 then Code:
local n = GetNumGroupMembers() |
Oops >.<. That's what I get for thinking too hard, then not trying the code. Thanks Phanx.
|
Okey. but ive tried out
Code:
local n = GetNumGroupMembers() Code:
local n = GetNumGroupMembers() Code:
if IsInRaid() and GetNumGroupMembers() >=1 and GetNumGroupMembers() <= 10 then Code:
local raid = GetNumGroupMembers() Im not sure if the onload is right or if i just put things in wrong place's =/ Onload: Code:
self:RegisterEvent("GROUP_ROSTER_UPDATE") |
All times are GMT -6. The time now is 01:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI