SOLVED: Problem Script kgpanels & recount
Hi
I'd like to hide recount when I'm not in a party oder raid. Therefore I wrote some Scripts in kgpanels. OnLoad: Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local party_members = GetNumPartyMembers(); The funny things is that when I create an oncklick event within kgpanels: Code:
Recount.MainWindow:Hide(); Code:
/run Recount.MainWindow:Hide(); Where is the problem in my kgpanel scripts? I can't figure out the misstake. Thanks in advance for any help Cheers lemmi |
Your script is good, it's Recount that's causing your problem. It seems to have a mind of it's own when it comes to showing and hiding.
You can parent the Recount panel to your kgPanels panel though and use the following code: OnLoad Lua Code:
OnEvent Lua Code:
That should work. Because you've told Recount to parent to your own panel at OnLoad, it can only show when your panel does, so you should be in a position where you just need to tell your panel what to do. While I'm at it, you can add this to OnLoad too to ensure that your panel always re-sizes correctly whenever Recount_MainWindow's size changes. Ordinarily, anchoring your frame to 2 opposing corners of another frame at OnLoad should ensure that your frame and the other frame remain the same size regardless, but that doesn't seem to be the case with kgPanels. Hence, the following is required (untested): OnLoad Lua Code:
Put Recount in the "Script Dependences" bit to prevent problems during OnLoad. Hope this helped. |
Ahh :D Great! Thanks for your help.
I just added Code:
Recount.MainWindow:SetParent(self) So for the Frame the working script is: OnLoad: Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local party_members = GetNumPartyMembers(); Thanks a lot for your help, Aanson. Best wishes lemmi |
Doesn't Recount already have an option for this? Turn off data collection for everything except party and raid if you haven't already (since you obviously don't care about such data) and then turn on "hide when not collecting".
|
Quote:
|
Im trying to create a similar panel, but id like it show in raid/party and have a chat tap with it so raid and party chat will show with a panel behind it about my main chat window
|
Quote:
Then, the following code can be used (assuming you're also using kgPanels): OnLoad Lua Code:
OnEvent Lua Code:
This can also be achieved by registering / unregistering to/from Party Chat or Raid chat and using the same ChatFrame (ie ChatFrame1 or ChatFrame3) but I personally think that the above method is the cleanest and most effective solution. |
All times are GMT -6. The time now is 02:50 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI