Just noticed .. swap the self:Hide with self:Show, and vice versa!
So 5-Man Party goes from:
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems > 0 and pmems < 6 and rmems < 6) then
[B]self:Hide()[/B]
else
[B]self:Show()[/B]
end
to:
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems > 0 and pmems < 6 and rmems < 6) then
[B]self:Show()[/B]
else
[B]self:Hide()[/B]
end
That should fix it.
awsome ill check it out as soon as i get home .. thanks so much for your help :)
I'm trying to make a panel that is for my classbuttons and it should only be shown if I am on my warrior or my deathknight and not on any other classes, how do I make that happen ?
I've been through all these 99 pages but I couldn't find a solution for that.
local playerClass, englishClass = UnitClass("player");
if englishClass == "DEATHKNIGHT" or englishClass == "WARRIOR" then
self:Show()
else
self:Hide()
end
Out of lazieness I built myself this little script to switch between my talents.
I'm a complete noob, when it comes to scripting, so don't wonder, if the code is not the best.^^
if (GetActiveTalentGroup() == 1) then
self.text:SetText("[color=blue][i]Talent Tree 1[/i][/color]")
else
self.text:SetText("[color=blue][i]Talent Tree 2[/i][/color]")
end
OnEnter or OnClick
if
(GetActiveTalentGroup() == 1) then SetActiveTalentGroup(2) else SetActiveTalentGroup(1)
end;
The OnEvent section is only used for a dynamic text. Basically what it does, it "listens" to my spellbook for one talent I only get from spending talent points.
If I have Heart-Strike in my spell book it should display "DPS Spec" on the panel otherwise "Tank Spec". EDIT: Figured out yesterday how to make the OnEvent part it less complicated when I started wondering why I just didn't take the code snipped from the OnEnter part. -.-
The blue italicized text can be replaced by anything you want to call the current active spec, just don't forget the quotation marks. ;)
I only did this to have a fast look, which spec is currently active rather than opening the menu or analyzing my buttons.^^
The OnEnter and OnClick is a personal taste. I for myself prefer the OnEnter method, as I'm too lazy to click the panel. -.-
If you know how to improve this code, please feel free to help out. As I said I am not very skilled in coding.
ok i am a complete novice to scripting to make these panels do something.
Im looking to make a Panel show when a party member gets aggro, and hide once he loses it. [next step would be to color a panel based on the same condition, but i can figure that out once i figure out the general code]
i put this in the OnEvent
if UnitAffectingCombat("party1")
then
self:Show()
else
self:Hide()
end
but that doesn't work. Can anybody give me some direction, lol. Thanks
How can you parent something to a kgPanel? For example, I want to parent SLDataText's Gold display to a panel named "MyFrameName." Parenting it to kgPanel# (# being any numeral) doesn't work because kgPanels re-uses panel numbers. I can't figure out how to refer to the panel by the name I defined it as. Simply using the name doesn't work either.
Using the latest version.
And by "doesn't work" I mean it either doesn't do anything, or throws an "object is nil" error.
With scripts I have been able to hide recount and omen within kgpanels and have them show fine for a raid/party. My question is can I do this for a chat frame? I tried to do it but it caused kgpanels to error out. I don't have the errors but let me retrace my steps...
Create chat tab and drag it out.
Create kgpanel.
Parent and Anchor set to chat window
Put in scripts for the hide and show of the panel for raid/chat (this is where it bugs out)
Am I missing a step or can this not be done? I basically want to show a RAID/party chat box only when in a raid/party.
ok i am a complete novice to scripting to make these panels do something.
Im looking to make a Panel show when a party member gets aggro, and hide once he loses it. [next step would be to color a panel based on the same condition, but i can figure that out once i figure out the general code]
i put this in the OnEvent
if UnitAffectingCombat("party1")
then
self:Show()
else
self:Hide()
end
but that doesn't work. Can anybody give me some direction, lol. Thanks
Check, if you have the following statements in the OnLoad section of your panel:
They "listen", if your normal regeneration eg. Health is stopped (which happens during combat) and if this happens this will fire the OnEvent script.
I tried it and it worked.
ok this time no errors, yet when I use
OnEvent....
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems < 1 and rmems < 1) then
self:Hide()
ChatFrame5Tab:Hide()
else
self:Show()
ChatFrame5Tab:Show()
end
With Chatter the kgpanel hides but not the chatframe even though its I think locked to the panel....any ideas?
awsome ill check it out as soon as i get home .. thanks so much for your help :)
Edit:Code worked .. thanks again!
I'm trying to make a panel that is for my classbuttons and it should only be shown if I am on my warrior or my deathknight and not on any other classes, how do I make that happen ?
I've been through all these 99 pages but I couldn't find a solution for that.
-Strongbow-
-Strongbow-
I'm a complete noob, when it comes to scripting, so don't wonder, if the code is not the best.^^
OnLoad:
OnEvent:
OnEnter or OnClick
The OnEvent section is only used for a dynamic text.
Basically what it does, it "listens" to my spellbook for one talent I only get from spending talent points.
If I have Heart-Strike in my spell book it should display "DPS Spec" on the panel otherwise "Tank Spec".
EDIT: Figured out yesterday how to make the OnEvent part it less complicated when I started wondering why I just didn't take the code snipped from the OnEnter part. -.-
The blue italicized text can be replaced by anything you want to call the current active spec, just don't forget the quotation marks. ;)
I only did this to have a fast look, which spec is currently active rather than opening the menu or analyzing my buttons.^^
The OnEnter and OnClick is a personal taste. I for myself prefer the OnEnter method, as I'm too lazy to click the panel. -.-
If you know how to improve this code, please feel free to help out. As I said I am not very skilled in coding.
Im looking to make a Panel show when a party member gets aggro, and hide once he loses it. [next step would be to color a panel based on the same condition, but i can figure that out once i figure out the general code]
i put this in the OnEvent
but that doesn't work. Can anybody give me some direction, lol. Thanks
Using the latest version.
And by "doesn't work" I mean it either doesn't do anything, or throws an "object is nil" error.
I might be missing something obvious, but is there a link to the API reference? Or is it just a matter of poking through kgPanels.lua?
However, now I get this error:
[string "kgPanels:FetchFrame(ChatPanelKG)"] line 1:
attempt to index global 'kgPanels' (a nil value)
where ChatPanelKG is the name of my frame. Putting the name in quotes yields the same error.
Create chat tab and drag it out.
Create kgpanel.
Parent and Anchor set to chat window
Put in scripts for the hide and show of the panel for raid/chat (this is where it bugs out)
Am I missing a step or can this not be done? I basically want to show a RAID/party chat box only when in a raid/party.
Check, if you have the following statements in the OnLoad section of your panel:
They "listen", if your normal regeneration eg. Health is stopped (which happens during combat) and if this happens this will fire the OnEvent script.
I tried it and it worked.
OnEvent....
With Chatter the kgpanel hides but not the chatframe even though its I think locked to the panel....any ideas?
Is it - SetCVar("MusicVolume", 0.9);