WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   KGPanels script (https://www.wowinterface.com/forums/showthread.php?t=44411)

BabyRay 09-17-12 11:14 AM

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 :D



it would be pretty cool if some can edit my settings, i would send you the profil^^

suicidalkatt 09-17-12 01:28 PM

Quote:

Originally Posted by BabyRay (Post 264383)
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 ;)

Phanx 09-17-12 07:15 PM

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.

suicidalkatt 09-17-12 08:28 PM

Quote:

Originally Posted by Phanx (Post 264422)
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 ;)

Quote:

Originally Posted by BabyRay
Hello suicidalkatt,

thank very very very much for your help :banana:

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 :D :p ;)


suicidalkatt 09-18-12 02:28 AM

Final product
 
1 Attachment(s)
* 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!

BabyRay 09-18-12 04:08 AM

Thank you very much, it works great. :banana:

Phanx 09-18-12 04:11 AM

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.

suicidalkatt 09-18-12 04:41 AM

Quote:

Originally Posted by Phanx (Post 264471)
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.

Talyrius 09-18-12 08:52 AM

Quote:

Originally Posted by suicidalkatt (Post 264474)
Not going to kill anyone.

No, of course not. That wasn't the point; Phanx is informing you for future reference.

Seerah 09-18-12 03:22 PM

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

BabyRay 09-19-12 04:36 AM

Hello,

i have a small problem.
the show and hide function from skada doesn´t 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 i´m stupid :D

I delete KGPanels and reinstall it, then inport the profil, but the problem still there.

suicidalkatt 09-19-12 10:16 AM

Quote:

Originally Posted by BabyRay (Post 264544)
Hello,

i have a small problem.
the show and hide function from skada doesn´t 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 i´m stupid :D

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.

BabyRay 09-20-12 05:55 AM

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. :D
is it possible that the chat works like the skada windows?

only in group/raid and in cities?

suicidalkatt 09-20-12 03:44 PM

Quote:

Originally Posted by BabyRay (Post 264609)
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. :D
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.

suicidalkatt 09-21-12 04:16 AM

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

BabyRay 09-21-12 06:13 AM

Thank you suicidalkatt again.

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

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

But now its hidden when i´m in a city.
do i something wrong?^^

suicidalkatt 09-21-12 07:16 AM

Quote:

Originally Posted by BabyRay (Post 264690)
Thank you suicidalkatt again.

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

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

But now its hidden when i´m 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

Phanx 09-21-12 05:27 PM

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

suicidalkatt 09-21-12 05:56 PM

Quote:

Originally Posted by Phanx (Post 264736)
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!

BabyRay 11-09-14 12:32 PM

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?


All times are GMT -6. The time now is 02:38 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI