* Double Post *
So, few things I want to point out about the layout:
- 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)
- Also, I wasn't sure if you wanted to simply not load the DPS/HPS button should you not have Skada loaded.
- 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.
OnLoad -- Register appropriate events and do an initial check OnLoad.
Lua Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("GROUP_ROSTER_UPDATE")
if IsInRaid() or IsInGroup() then
SkadaBarWindowRecount:Show()
SkadaBarWindowOmen:Show()
else
SkadaBarWindowRecount:Hide()
SkadaBarWindowOmen:Hide()
end
OnEvent -- Do checks
Lua Code:
if IsInRaid() or IsInGroup() then
SkadaBarWindowRecount:Show()
SkadaBarWindowOmen:Show()
else
SkadaBarWindowRecount:Hide()
SkadaBarWindowOmen:Hide()
end
OnClick -- Show or hide frames and play sound. Should CTRL be held, reset instead
Lua Code:
if IsAddOnLoaded("Skada") and pressed then
if IsControlKeyDown() then
Skada:Reset()
PlaySoundFile("Sound\\Interface\\iAbilitiesTurnPageA.wav")
else
CombatLogClearEntries()
Skada:ToggleWindow()
if SkadaBarWindowRecount:IsShown() and SkadaBarWindowOmen:IsShown() then
PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
else
PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
end
end
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:
if pressed then
if _G["ChatFrame1"]:IsShown() then
_G["ChatFrame1"]:Hide()
_G["ChatFrame3"]:Hide()
_G["ChatFrame1ButtonFrame"]:Hide()
_G["ChatFrame3ButtonFrame"]:Hide()
_G["ChatFrameMenuButton"]:Hide()
_G["GeneralDockManager"]:Hide()
_G["FriendsMicroButton"]:Hide()
PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
else
_G["ChatFrame1"]:Show()
_G["ChatFrame3"]:Show()
_G["ChatFrame1ButtonFrame"]:Show()
_G["ChatFrame3ButtonFrame"]:Show()
_G["ChatFrameMenuButton"]:Show()
_G["GeneralDockManager"]:Show()
_G["FriendsMicroButton"]:Show()
PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
end
end
Button labeled as 'Show'...which is intended to show the chat and Skada windows.
OnClick --
Lua Code:
if IsAddOnLoaded("Skada") and pressed then
if not SkadaBarWindowOmen:IsShown() or not SkadaBarWindowRecount:IsShown() then
PlaySoundFile("Sound\\Interface\\uCharacterSheetOpen.wav")
end
SkadaBarWindowRecount:Show()
SkadaBarWindowOmen:Show()
end
if pressed then
_G["ChatFrame1"]:Show()
_G["ChatFrame3"]:Show()
_G["ChatFrame1ButtonFrame"]:Show()
_G["ChatFrame3ButtonFrame"]:Show()
_G["ChatFrameMenuButton"]:Show()
_G["GeneralDockManager"]:Show()
_G["FriendsMicroButton"]:Show()
end
Button labeled as 'Hide'...which is intended to hide the chat and Skada windows.
OnClick --
Lua Code:
if IsAddOnLoaded("Skada") and pressed then
if SkadaBarWindowOmen:IsShown() or SkadaBarWindowRecount:IsShown() then
PlaySoundFile("Sound\\Interface\\uCharacterSheetClose.wav")
end
SkadaBarWindowRecount:Hide()
SkadaBarWindowOmen:Hide()
end
if pressed then
_G["ChatFrame1"]:Hide()
_G["ChatFrame3"]:Hide()
_G["ChatFrame1ButtonFrame"]:Hide()
_G["ChatFrame3ButtonFrame"]:Hide()
_G["ChatFrameMenuButton"]:Hide()
_G["GeneralDockManager"]:Hide()
_G["FriendsMicroButton"]:Hide()
end
If you have any questions about my script please feel free to post!