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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  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, 522 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
11-10-14, 04:02 AM   #7
BabyRay
An Aku'mai Servant
Join Date: Sep 2009
Posts: 39
Thanks guys,
even if I only understand a quarter of the what you have written.

Here again summarized as my scripts in KGPanels are registered.
I hope the "OnEvent" script is in the right place.

EDIT:

I made malygos and see that there is a UI like in Ulduar (1 Boss) oder the PetBattle UI.
Is this the right ones for the Event?

VEHICLE_ANGLE_SHOW
PET_BATTLE_OPENING_START

So that the UI is disabled when i´m in a vihicle or in petbattle




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. --table with the Skada frames that should be handled
  2. self.SkadaWindowsToToggle = {
  3.  Recount = true,
  4.  Omen = true,
  5. }
  6.  
  7. function self:ToggleAllSkadaWindows()
  8.  for name,v in pairs(self.SkadaWindowsToToggle) do
  9.  if v then
  10.  local f = _G["SkadaBarWindow"..name]
  11.  if f then
  12.  f[IsInGroup() and "Show" or "Hide"](f)
  13.  end
  14.  end
  15.  end
  16. end
  17.  
  18. --Get LibStub's Skada table
  19. local skada = LibStub("AceAddon-3.0"):GetAddon("Skada")
  20.  
  21. --hook the settings application that is run after a Skada window is created
  22. hooksecurefunc(skada,"ApplySettings", function() self:ToggleAllSkadaWindows() end)
  23.  
  24. --hide any asociated Skada windows that are already created
  25. self:ToggleAllSkadaWindows()
  26.  
  27. --register events
  28. self:RegisterEvent("PLAYER_ENTERING_WORLD")
  29. self:RegisterEvent("GROUP_ROSTER_UPDATE")


OnEvent -- Do checks

Lua Code:
  1. self:ToggleAllSkadaWindows()


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.
If i replaced this:

Lua Code:
  1. self:RegisterEvent("ZONE_CHANGED")
  2. self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  3. self:RegisterEvent("ZONE_CHANGED_INDOORS")

with this one

Lua Code:
  1. self: Register Event ("PLAYER_UPDATE_RESTING")

but should fix my problem with the chat window to sensitive, right?
So that the Chat is only to see when i´m resting?


OnLoad

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

Lua Code:
  1. if IsResting() or IsInGroup() 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 -- 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


OnEvent

Lua Code:
  1. local oEvents = {
  2.     "GOSSIP_SHOW",
  3.     "BANKFRAME_OPENED",
  4.     "GUILDBANKFRAME_OPENED"
  5. }
  6.  
  7. if tContains(oEvents,event) then
  8.     ChatFrame1:Hide()
  9.     ChatFrame3:Hide()
  10.     ChatFrame1ButtonFrame:Hide()
  11.     ChatFrame3ButtonFrame:Hide()
  12.     ChatFrameMenuButton:Hide()
  13.     GeneralDockManager:Hide()
  14.     FriendsMicroButton:Hide()
  15. else
  16.     ChatFrame1:Show()
  17.     ChatFrame3:Show()
  18.     ChatFrame1ButtonFrame:Show()
  19.     ChatFrame3ButtonFrame:Show()
  20.     ChatFrameMenuButton:Show()
  21.     GeneralDockManager:Show()
  22.     FriendsMicroButton:Show()
  23. end

Last edited by BabyRay : 11-10-14 at 09:05 AM.
  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