Originally Posted by BabyRay
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 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:
self:RegisterEvent("ZONE_CHANGED")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
self:RegisterEvent("ZONE_CHANGED_INDOORS")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("GROUP_ROSTER_UPDATE")
if IsResting() or IsInGroup() then -- See I learned Phanx! <3
_G["ChatFrame1"]:Show()
_G["ChatFrame3"]:Show()
_G["ChatFrame1ButtonFrame"]:Show()
_G["ChatFrame3ButtonFrame"]:Show()
_G["ChatFrameMenuButton"]:Show()
_G["GeneralDockManager"]:Show()
_G["FriendsMicroButton"]:Show()
else
_G["ChatFrame1"]:Hide()
_G["ChatFrame3"]:Hide()
_G["ChatFrame1ButtonFrame"]:Hide()
_G["ChatFrame3ButtonFrame"]:Hide()
_G["ChatFrameMenuButton"]:Hide()
_G["GeneralDockManager"]:Hide()
_G["FriendsMicroButton"]:Hide()
end
OnEvent -- Do Checks
Lua Code:
if IsResting() or IsInGroup() then then
_G["ChatFrame1"]:Show()
_G["ChatFrame3"]:Show()
_G["ChatFrame1ButtonFrame"]:Show()
_G["ChatFrame3ButtonFrame"]:Show()
_G["ChatFrameMenuButton"]:Show()
_G["GeneralDockManager"]:Show()
_G["FriendsMicroButton"]:Show()
else
_G["ChatFrame1"]:Hide()
_G["ChatFrame3"]:Hide()
_G["ChatFrame1ButtonFrame"]:Hide()
_G["ChatFrame3ButtonFrame"]:Hide()
_G["ChatFrameMenuButton"]:Hide()
_G["GeneralDockManager"]:Hide()
_G["FriendsMicroButton"]:Hide()
end
OnClick --
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