Quantcast
KGPanels script - WoWInterface
Thread Tools Display Modes
09-17-12, 11:14 AM   #1
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
KGPanels script

Hello together,

can someone help me with some kgpanels scripts?

i want that the "skada panels" only shown infight in group/raid.
than i want when i klick on "DPS/HPS" that the "skada panels" manually shown and hide.
and when i klick on "chat" that the both chat windows shown and hide.

the"show" and the "hide" button shoud show and hide all panels but that optional



it would be pretty cool if some can edit my settings, i would send you the profil^^
  Reply With Quote
09-17-12, 01:28 PM   #2
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by BabyRay View Post
Hello together,
can someone help me with some kgpanels scripts?
it would be pretty cool if some can edit my settings, i would send you the profil^^
Feel free to pm me your saved variables for both kgPanels and Skada. Ill help you out
  Reply With Quote
09-17-12, 07:15 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You should really just post your saved variables on the forums, and post solutions on the forums. The whole point of a forum is that questions and answers benefit everyone. If you take questions and answers to PMs, then they are not helping anyone but the original poster, and anyone with a similar question in the future has to spend their time asking the same question, and you or someone else has to spend time giving them the same answer.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addon Turn any code into an addon More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please dont PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
09-17-12, 08:28 PM   #4
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Phanx View Post
You should really just post your saved variables on the forums, and post solutions on the forums. The whole point of a forum is that questions and answers benefit everyone. If you take questions and answers to PMs, then they are not helping anyone but the original poster, and anyone with a similar question in the future has to spend their time asking the same question, and you or someone else has to spend time giving them the same answer.
Ill be sure to post how I helped him or her later tonight

Originally Posted by BabyRay
Hello suicidalkatt,

thank very very very much for your help

http://rapidgator.net/file/43187983/KGPanel.rar.html

Name of the frames if you need that.

ChatFrame1Tab -> left one
ChatFrame3Tab -> right one
SkadaBarWindowRecount -> left panel
SkadaBarWindowOmen -> right panel


http://imageshack.us/a/img52/6383/wo...1712182920.jpg

-the skada panels shoud hide when i log in
-i want to see the both skada panels only in raid/group/scenarios
-the DPS/HPS button for manually show/hide the skada windows
-Chat button when i klick show and hide the both chat windows, but nothing automatic that shoud only work when i klick
-the "show" and the "hide" button shoud show and hide all panels but that optional




If you want a baby feel free to ask

Last edited by suicidalkatt : 09-17-12 at 08:34 PM.
  Reply With Quote
09-18-12, 02:28 AM   #5
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Final product

* Double Post *

So, few things I want to point out about the layout:
  1. Most objects are not parented to any frames, which may or may not hide specific elements you're looking to do. (I'll go into more detail)
  2. Also, I wasn't sure if you wanted to simply not load the DPS/HPS button should you not have Skada loaded.
  3. Chatframes were limited to hiding only ChatFrame1 and ChatFrame3 and no other additional chat frames will be toggled. I also did not include the edit box (the box which comes up when you want to type.

Import text attached!


There are 4 buttons involved and I'll be discussing each:


Button labeled as 'DPS'
...which is intended to toggle the Skada windows has a few key features implemented.
  • Automatically show or hide the frames depending on if you're in group or raid.
  • Toggle the frames cleanly, with audio feedback.
  • Reset skada with a simple holding of CTRL and clicking the button.
Scripts Dependency -- This will disable / remove this button should Skada not be enabled.
Lua Code:
  1. Skada
OnLoad -- Register appropriate events and do an initial check OnLoad.
Lua Code:
  1. self:RegisterEvent("PLAYER_ENTERING_WORLD")
  2. self:RegisterEvent("GROUP_ROSTER_UPDATE")
  3.  
  4. if IsInRaid() or IsInGroup() then
  5.     SkadaBarWindowRecount:Show()
  6.     SkadaBarWindowOmen:Show()
  7. else
  8.     SkadaBarWindowRecount:Hide()
  9.     SkadaBarWindowOmen:Hide()
  10. end
OnEvent -- Do checks
Lua Code:
  1. if IsInRaid() or IsInGroup() then
  2.     SkadaBarWindowRecount:Show()
  3.     SkadaBarWindowOmen:Show()
  4. else
  5.     SkadaBarWindowRecount:Hide()
  6.     SkadaBarWindowOmen:Hide()
  7. end
OnClick -- Show or hide frames and play sound. Should CTRL be held, reset instead
Lua Code:
  1. if IsAddOnLoaded("Skada") and pressed then
  2.     if IsControlKeyDown() then
  3.         Skada:Reset()
  4.         PlaySoundFile("Sound\\Interface\\iAbilitiesTurnPageA.wav")
  5.     else
  6.         CombatLogClearEntries()
  7.         Skada:ToggleWindow()
  8.         if SkadaBarWindowRecount:IsShown() and SkadaBarWindowOmen:IsShown() then
  9.             PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
  10.         else
  11.             PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
  12.         end
  13.     end
  14. end

Button labeled as 'Chat'
...which is intended to toggle the chat windows.
OnClick -- Only specific frames are toggled. I had to reparent the kgpanels 'Chatframe_links' to the absolute center of ChatFrame1 and 'Chatframe_rechts' to the absolute center of ChatFrame3.
Lua Code:
  1. if pressed then
  2.     if _G["ChatFrame1"]:IsShown() then
  3.         _G["ChatFrame1"]:Hide()
  4.         _G["ChatFrame3"]:Hide()
  5.         _G["ChatFrame1ButtonFrame"]:Hide()
  6.         _G["ChatFrame3ButtonFrame"]:Hide()
  7.         _G["ChatFrameMenuButton"]:Hide()
  8.         _G["GeneralDockManager"]:Hide()
  9.         _G["FriendsMicroButton"]:Hide()
  10.         PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
  11.     else
  12.         _G["ChatFrame1"]:Show()
  13.         _G["ChatFrame3"]:Show()
  14.         _G["ChatFrame1ButtonFrame"]:Show()
  15.         _G["ChatFrame3ButtonFrame"]:Show()
  16.         _G["ChatFrameMenuButton"]:Show()
  17.         _G["GeneralDockManager"]:Show()
  18.         _G["FriendsMicroButton"]:Show()
  19.         PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
  20.     end
  21. end

Button labeled as 'Show'
...which is intended to show the chat and Skada windows.
OnClick --
Lua Code:
  1. if IsAddOnLoaded("Skada") and pressed then
  2.     if not SkadaBarWindowOmen:IsShown() or not SkadaBarWindowRecount:IsShown() then
  3.         PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
  4.     end
  5.     SkadaBarWindowRecount:Show()
  6.     SkadaBarWindowOmen:Show()
  7. end
  8. if pressed then
  9.     _G["ChatFrame1"]:Show()
  10.     _G["ChatFrame3"]:Show()
  11.     _G["ChatFrame1ButtonFrame"]:Show()
  12.     _G["ChatFrame3ButtonFrame"]:Show()
  13.     _G["ChatFrameMenuButton"]:Show()
  14.     _G["GeneralDockManager"]:Show()
  15.     _G["FriendsMicroButton"]:Show()
  16. end

Button labeled as 'Hide'
...which is intended to hide the chat and Skada windows.
OnClick --
Lua Code:
  1. if IsAddOnLoaded("Skada") and pressed then
  2.     if SkadaBarWindowOmen:IsShown() or SkadaBarWindowRecount:IsShown() then
  3.         PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
  4.     end
  5.     SkadaBarWindowRecount:Hide()
  6.     SkadaBarWindowOmen:Hide()
  7. end
  8. if pressed then
  9.     _G["ChatFrame1"]:Hide()
  10.     _G["ChatFrame3"]:Hide()
  11.     _G["ChatFrame1ButtonFrame"]:Hide()
  12.     _G["ChatFrame3ButtonFrame"]:Hide()
  13.     _G["ChatFrameMenuButton"]:Hide()
  14.     _G["GeneralDockManager"]:Hide()
  15.     _G["FriendsMicroButton"]:Hide()
  16. end

If you have any questions about my script please feel free to post!
Attached Files
File Type: txt BabyUI kgPanels Import.txt (16.4 KB, 445 views)

Last edited by suicidalkatt : 09-18-12 at 02:34 AM.
  Reply With Quote
09-18-12, 04:08 AM   #6
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
Thank you very much, it works great.
  Reply With Quote
09-18-12, 04:11 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
FYI:
Code:
if IsInRaid() or IsInGroup() then
...is redundant; IsInGroup() returns true if you are in *any* kind of group. You don't need to check IsInRaid() unless you want to do something different in raid groups vs. party groups.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addon Turn any code into an addon More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please dont PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
09-18-12, 04:41 AM   #8
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Phanx View Post
FYI:
Code:
if IsInRaid() or IsInGroup() then
...is redundant; IsInGroup() returns true if you are in *any* kind of group. You don't need to check IsInRaid() unless you want to do something different in raid groups vs. party groups.
Not going to kill anyone.
  Reply With Quote
09-18-12, 08:52 AM   #9
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 361
Originally Posted by suicidalkatt View Post
Not going to kill anyone.
No, of course not. That wasn't the point; Phanx is informing you for future reference.
  Reply With Quote
09-18-12, 03:22 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,732
Well, that and it's an extra function call that you don't need. It will be 0.000001 seconds faster if you eliminate it.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-19-12, 04:36 AM   #11
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
Hello,

i have a small problem.
the show and hide function from skada doesnt work right.

sometimes i log in and the panels are hidden <- thats right
and sometimes they are shown.

and is it right that i cant find anything in the script function?



maybe im stupid

I delete KGPanels and reinstall it, then inport the profil, but the problem still there.
  Reply With Quote
09-19-12, 10:16 AM   #12
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by BabyRay View Post
Hello,

i have a small problem.
the show and hide function from skada doesnt work right.

sometimes i log in and the panels are hidden <- thats right
and sometimes they are shown.

and is it right that i cant find anything in the script function?

maybe im stupid

I delete KGPanels and reinstall it, then inport the profil, but the problem still there.
Are these the panels that are 'backgrounds' for the Skada windows? If so, you just need to parent them to the Skada frames. I did not add any scripting to those windows, only to the DPS / HPS button for showing and hiding of the Skada frames themselves, not any kgPanels.
  Reply With Quote
09-20-12, 05:55 AM   #13
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
ok, now it work.

i delete kgpanels again incl. settings and reinstall it. import your settings and now it work.

while questing i love the clean without chat.
is it possible that the chat works like the skada windows?

only in group/raid and in cities?
  Reply With Quote
09-20-12, 03:44 PM   #14
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by BabyRay View Post
ok, now it work.

i delete kgpanels again incl. settings and reinstall it. import your settings and now it work.

while questing i love the clean without chat.
is it possible that the chat works like the skada windows?

only in group/raid and in cities?
It most definitely can. I'm out for today but perhaps someone here can help you while I'm out.
  Reply With Quote
09-21-12, 04:16 AM   #15
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Well since no one could assist!!

Button labeled as 'Chat'
...which is intended to toggle the chat windows, and now to hide while resting.
OnLoad -- Set proper Events and do initial check.
Lua Code:
  1. self:RegisterEvent("ZONE_CHANGED")
  2. self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  3. self:RegisterEvent("ZONE_CHANGED_INDOORS")
  4.  
  5. if IsResting() then
  6.     _G["ChatFrame1"]:Hide()
  7.     _G["ChatFrame3"]:Hide()
  8.     _G["ChatFrame1ButtonFrame"]:Hide()
  9.     _G["ChatFrame3ButtonFrame"]:Hide()
  10.     _G["ChatFrameMenuButton"]:Hide()
  11.     _G["GeneralDockManager"]:Hide()
  12.     _G["FriendsMicroButton"]:Hide()
  13. else
  14.     _G["ChatFrame1"]:Show()
  15.     _G["ChatFrame3"]:Show()
  16.     _G["ChatFrame1ButtonFrame"]:Show()
  17.     _G["ChatFrame3ButtonFrame"]:Show()
  18.     _G["ChatFrameMenuButton"]:Show()
  19.     _G["GeneralDockManager"]:Show()
  20.     _G["FriendsMicroButton"]:Show()
  21. end

OnEvent -- Do Checks
Lua Code:
  1. if IsResting() then
  2.     _G["ChatFrame1"]:Hide()
  3.     _G["ChatFrame3"]:Hide()
  4.     _G["ChatFrame1ButtonFrame"]:Hide()
  5.     _G["ChatFrame3ButtonFrame"]:Hide()
  6.     _G["ChatFrameMenuButton"]:Hide()
  7.     _G["GeneralDockManager"]:Hide()
  8.     _G["FriendsMicroButton"]:Hide()
  9. else
  10.     _G["ChatFrame1"]:Show()
  11.     _G["ChatFrame3"]:Show()
  12.     _G["ChatFrame1ButtonFrame"]:Show()
  13.     _G["ChatFrame3ButtonFrame"]:Show()
  14.     _G["ChatFrameMenuButton"]:Show()
  15.     _G["GeneralDockManager"]:Show()
  16.     _G["FriendsMicroButton"]:Show()
  17. end

OnClick --
Lua Code:
  1. if pressed then
  2.     if _G["ChatFrame1"]:IsShown() then
  3.         _G["ChatFrame1"]:Hide()
  4.         _G["ChatFrame3"]:Hide()
  5.         _G["ChatFrame1ButtonFrame"]:Hide()
  6.         _G["ChatFrame3ButtonFrame"]:Hide()
  7.         _G["ChatFrameMenuButton"]:Hide()
  8.         _G["GeneralDockManager"]:Hide()
  9.         _G["FriendsMicroButton"]:Hide()
  10.         PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
  11.     else
  12.         _G["ChatFrame1"]:Show()
  13.         _G["ChatFrame3"]:Show()
  14.         _G["ChatFrame1ButtonFrame"]:Show()
  15.         _G["ChatFrame3ButtonFrame"]:Show()
  16.         _G["ChatFrameMenuButton"]:Show()
  17.         _G["GeneralDockManager"]:Show()
  18.         _G["FriendsMicroButton"]:Show()
  19.         PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
  20.     end
  21. end

Last edited by suicidalkatt : 09-21-12 at 04:18 AM.
  Reply With Quote
09-21-12, 06:13 AM   #16
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
Thank you suicidalkatt again.

i think something is wrong
i hate my bad english nobody understand me

want to see my chat windows only in group/raid and in /major cities/cities

But now its hidden when im in a city.
do i something wrong?^^
  Reply With Quote
09-21-12, 07:16 AM   #17
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by BabyRay View Post
Thank you suicidalkatt again.

i think something is wrong
i hate my bad english nobody understand me

want to see my chat windows only in group/raid and in /major cities/cities

But now its hidden when im in a city.
do i something wrong?^^
Oh, I got that backwards I spose.

Here...



Button labeled as 'Chat'
...which is intended to toggle the chat windows, and now to show while resting and while in raid or group.
OnLoad -- Set proper Events and do initial check.
Lua Code:
  1. self:RegisterEvent("ZONE_CHANGED")
  2. self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  3. self:RegisterEvent("ZONE_CHANGED_INDOORS")
  4. self:RegisterEvent("PLAYER_ENTERING_WORLD")
  5. self:RegisterEvent("GROUP_ROSTER_UPDATE")
  6.  
  7. if IsResting() or IsInGroup() then -- See I learned Phanx! <3
  8.     _G["ChatFrame1"]:Show()
  9.     _G["ChatFrame3"]:Show()
  10.     _G["ChatFrame1ButtonFrame"]:Show()
  11.     _G["ChatFrame3ButtonFrame"]:Show()
  12.     _G["ChatFrameMenuButton"]:Show()
  13.     _G["GeneralDockManager"]:Show()
  14.     _G["FriendsMicroButton"]:Show()
  15. else
  16.     _G["ChatFrame1"]:Hide()
  17.     _G["ChatFrame3"]:Hide()
  18.     _G["ChatFrame1ButtonFrame"]:Hide()
  19.     _G["ChatFrame3ButtonFrame"]:Hide()
  20.     _G["ChatFrameMenuButton"]:Hide()
  21.     _G["GeneralDockManager"]:Hide()
  22.     _G["FriendsMicroButton"]:Hide()
  23. end

OnEvent -- Do Checks
Lua Code:
  1. if IsResting() or IsInGroup() then then
  2.     _G["ChatFrame1"]:Show()
  3.     _G["ChatFrame3"]:Show()
  4.     _G["ChatFrame1ButtonFrame"]:Show()
  5.     _G["ChatFrame3ButtonFrame"]:Show()
  6.     _G["ChatFrameMenuButton"]:Show()
  7.     _G["GeneralDockManager"]:Show()
  8.     _G["FriendsMicroButton"]:Show()
  9. else
  10.     _G["ChatFrame1"]:Hide()
  11.     _G["ChatFrame3"]:Hide()
  12.     _G["ChatFrame1ButtonFrame"]:Hide()
  13.     _G["ChatFrame3ButtonFrame"]:Hide()
  14.     _G["ChatFrameMenuButton"]:Hide()
  15.     _G["GeneralDockManager"]:Hide()
  16.     _G["FriendsMicroButton"]:Hide()
  17. end

OnClick --
Lua Code:
  1. if pressed then
  2.     if _G["ChatFrame1"]:IsShown() then
  3.         _G["ChatFrame1"]:Hide()
  4.         _G["ChatFrame3"]:Hide()
  5.         _G["ChatFrame1ButtonFrame"]:Hide()
  6.         _G["ChatFrame3ButtonFrame"]:Hide()
  7.         _G["ChatFrameMenuButton"]:Hide()
  8.         _G["GeneralDockManager"]:Hide()
  9.         _G["FriendsMicroButton"]:Hide()
  10.         PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
  11.     else
  12.         _G["ChatFrame1"]:Show()
  13.         _G["ChatFrame3"]:Show()
  14.         _G["ChatFrame1ButtonFrame"]:Show()
  15.         _G["ChatFrame3ButtonFrame"]:Show()
  16.         _G["ChatFrameMenuButton"]:Show()
  17.         _G["GeneralDockManager"]:Show()
  18.         _G["FriendsMicroButton"]:Show()
  19.         PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
  20.     end
  21. end
  Reply With Quote
09-21-12, 05:27 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The only event you need to register for is PLAYER_UPDATE_RESTING. You will probably catch changes in the rest state by listening for all of those other events, but it would be simpler and more efficient to just listen for the one event that fires specifically to notify you of such changes...
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addon Turn any code into an addon More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please dont PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
09-21-12, 05:56 PM   #19
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Phanx View Post
The only event you need to register for is PLAYER_UPDATE_RESTING. You will probably catch changes in the rest state by listening for all of those other events, but it would be simpler and more efficient to just listen for the one event that fires specifically to notify you of such changes...
Didn't know of that event! Good to know!
  Reply With Quote
11-09-14, 12:32 PM   #20
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
You have helped me so far so good but once or twice I have to ask you again for help.

1. Is there a possibility that hides the chat window and skada window when I am standing at a dealer or in the bank?

2. Is there a possibility that respond to the chat window is not quite as sensitive?
I run through Nagrand and during running about changes zone name and my chat window disappears while I just wanted to write something. Maybe it is only on for an entire zone change. Nagrand -> Talador not within the individual areas?

self: Register Event ("ZONE_CHANGED")
self: Register Event ("ZONE_CHANGED_NEW_AREA")
self: Register Event ("ZONE_CHANGED_INDOORS")
self: Register Event ("PLAYER_ENTERING_WORLD")
self: Register Event ("GROUP_ROSTER_UPDATE")


Maybe about the event of Phanx?

self: Register Event ("PLAYER_UPDATE_RESTING")

So just replace the top events through the bottom?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » KGPanels script

Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off