Thread: KGPanels script
View Single Post
11-10-14, 12:01 AM   #24
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
In addition to what Seerah said, you don't check which event fired by calling their names (e.g. GOSSIP_SHOW()), they're not functions.

kgPanels provides the OnEvent handler with an event argument whose value is the name of the event that fired.

So the code would look like this:
lua Code:
  1. if event == "GOSSIP_SHOW" or event == "BANKFRAME_OPENED" then
  2.     ChatFrame1:Hide()
  3.     ChatFrame3:Hide()
  4.     ChatFrame1ButtonFrame:Hide()
  5.     ChatFrame3ButtonFrame:Hide()
  6.     ChatFrameMenuButton:Hide()
  7.     GeneralDockManager:Hide()
  8.     FriendsMicroButton:Hide()
  9. else
  10.     ChatFrame1:Show()
  11.     ChatFrame3:Show()
  12.     ChatFrame1ButtonFrame:Show()
  13.     ChatFrame3ButtonFrame:Show()
  14.     ChatFrameMenuButton:Show()
  15.     GeneralDockManager:Show()
  16.     FriendsMicroButton:Show()
  17. end

Keep in mind that you need to register these events in the OnLoad script if you want them to fire for your panel.
  Reply With Quote