Thread Tools Display Modes
11-09-09, 11:01 PM   #1
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
kgPanels -- Chat Frame Switching

I need some help. I'm kinda copying what ncUI did and trying to put it into my crazy changed LUI interface by Loui. However, I can't figure out what to do with the onClick to make the buttons switch. Do I have to separate the chat windows and attach them to a kgpanel ?

Heres what my chat looks like, minus the buttons working.
Attached Thumbnails
Click image for larger version

Name:	chatissue.jpg
Views:	1485
Size:	101.2 KB
ID:	3540  
__________________
  Reply With Quote
11-09-09, 11:25 PM   #2
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
For the first button, you'll need to hide the second frame and show the first:
ChatFrame1:Show()
ChatFrame2:Hide()

And for the second button, just reverse the order.
  Reply With Quote
11-10-09, 12:11 AM   #3
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by Katae View Post
For the first button, you'll need to hide the second frame and show the first:
ChatFrame1:Show()
ChatFrame2:Hide()

And for the second button, just reverse the order.
Which I presume I need to move each channel (Chat) and (Combat) to a frame built inside kgPanels for ChatFrame1 and ChatFrame2?
__________________
  Reply With Quote
11-10-09, 12:14 AM   #4
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
It doesn't matter where the chat frames are, they'll toggle when you click your buttons.
  Reply With Quote
11-10-09, 12:18 AM   #5
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by Katae View Post
It doesn't matter where the chat frames are, they'll toggle when you click your buttons.
Not working for me. I set the chat onClick to

ChatFrame1:Show()
ChatFrame2:Hide()

and reversed it for combat OnClick and nadda.

I'm wondering if it's because I have Prat. Nope, not prat..

I noticed that LUI has two kgpanels called chatFrame1 and chatFrame2, however I haven't figured out where they go LOL.
__________________

Last edited by Ither : 11-10-09 at 12:23 AM.
  Reply With Quote
11-10-09, 09:35 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
They're likely backgrounds for chat frames 1 and 2.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-13-09, 07:59 AM   #7
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
It was. I went back in and removed the panels, however I still can't get it to switch. Is ChatFrame1 and ChatFrame2 default names for General and Combat? Do I need to separate them from each other or keep them tab'd together?
__________________
  Reply With Quote
11-13-09, 09:04 AM   #8
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
You need this texture:
http://bitbucket.org/nightcracker/nc...edia/blank.tga

Ok, here it comes:
lua Code:
  1. local function CreatePanel(f, h, w, a1, p, a2, x, y)
  2.     f:SetFrameLevel(1)
  3.     f:SetHeight(h)
  4.     f:SetWidth(w)
  5.     f:SetFrameStrata("BACKGROUND")
  6.     f:SetPoint(a1, p, a2, x, y)
  7.     f:SetBackdrop( {
  8.       bgFile = "Interface\\Addons\\YourAddon\\blank",
  9.       edgeFile = "Interface\\Addons\\YourAddon\\blank",
  10.       tile = false, tileSize = 0, edgeSize = 1,
  11.       insets = { left = -1, right = -1, top = -1, bottom = -1 }
  12.     })
  13.     f:SetBackdropColor(.1,. .1, .1, 1)
  14.     f:SetBackdropBorderColor(.6, .6, .6, 1)
  15. end
  16. local f, g = CreateFrame("Frame"), CreateFrame("Frame")
  17. local ftext, gtext = f:CreateFontString(nil, "OVERLAY"), g:CreateFontString(nil, "OVERLAY")
  18. CreatePanel(f, 10, 30, "CENTER", "UIParent", "CENTER", 5, -1)
  19. f:EnableMouse(true)
  20. g:EnableMouse(true)
  21. f:SetScript("OnMouseDown", function(self, button)
  22.     f:SetBackdropColor(.2,.2,.2)
  23.     ChatFrame1:Show()
  24.     ChatFrame2:Hide()
  25.     g:SetBackdropColor(.1,.1,.1)
  26. end)
  27. g:SetScript("OnMouseDown", function(self, button)
  28.     g:SetBackdropColor(.2,.2,.2)
  29.     ChatFrame1:Show()
  30.     ChatFrame2:Hide()
  31.     f:SetBackdropColor(.1,.1,.1)
  32. end)
  33. f:SetBackdropColor(.2,.2,.2)
  34. ChatFrame1:Show()
  35. ChatFrame2:Hide()
  36. ftext:SetFont("Fonts\\FRIZQT__.TTF", 7, "MONOCHROME")
  37. ftext:SetPoint("CENTER", f)
  38. ftext:SetText("Chat")
  39. gtext:SetFont("Fonts\\FRIZQT__.TTF", 7, "MONOCHROME")
  40. gtext:SetPoint("CENTER", f)
  41. gtext:SetText("Chat")
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
11-13-09, 09:52 AM   #9
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by nightcracker View Post
You need this texture:
http://bitbucket.org/nightcracker/nc...edia/blank.tga

Ok, here it comes:
lua Code:
  1. local function CreatePanel(f, h, w, a1, p, a2, x, y)
  2.     f:SetFrameLevel(1)
  3.     f:SetHeight(h)
  4.     f:SetWidth(w)
  5.     f:SetFrameStrata("BACKGROUND")
  6.     f:SetPoint(a1, p, a2, x, y)
  7.     f:SetBackdrop( {
  8.       bgFile = "Interface\\Addons\\YourAddon\\blank",
  9.       edgeFile = "Interface\\Addons\\YourAddon\\blank",
  10.       tile = false, tileSize = 0, edgeSize = 1,
  11.       insets = { left = -1, right = -1, top = -1, bottom = -1 }
  12.     })
  13.     f:SetBackdropColor(.1,. .1, .1, 1)
  14.     f:SetBackdropBorderColor(.6, .6, .6, 1)
  15. end
  16. local f, g = CreateFrame("Frame"), CreateFrame("Frame")
  17. local ftext, gtext = f:CreateFontString(nil, "OVERLAY"), g:CreateFontString(nil, "OVERLAY")
  18. CreatePanel(f, 10, 30, "CENTER", "UIParent", "CENTER", 5, -1)
  19. f:EnableMouse(true)
  20. g:EnableMouse(true)
  21. f:SetScript("OnMouseDown", function(self, button)
  22.     f:SetBackdropColor(.2,.2,.2)
  23.     ChatFrame1:Show()
  24.     ChatFrame2:Hide()
  25.     g:SetBackdropColor(.1,.1,.1)
  26. end)
  27. g:SetScript("OnMouseDown", function(self, button)
  28.     g:SetBackdropColor(.2,.2,.2)
  29.     ChatFrame1:Show()
  30.     ChatFrame2:Hide()
  31.     f:SetBackdropColor(.1,.1,.1)
  32. end)
  33. f:SetBackdropColor(.2,.2,.2)
  34. ChatFrame1:Show()
  35. ChatFrame2:Hide()
  36. ftext:SetFont("Fonts\\FRIZQT__.TTF", 7, "MONOCHROME")
  37. ftext:SetPoint("CENTER", f)
  38. ftext:SetText("Chat")
  39. gtext:SetFont("Fonts\\FRIZQT__.TTF", 7, "MONOCHROME")
  40. gtext:SetPoint("CENTER", f)
  41. gtext:SetText("Chat")
AH. So I need to use this as an addon to make the chat channels switch?
__________________
  Reply With Quote
11-13-09, 10:00 AM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Really, all you need to do is what Katae posted in the first reply. Make sure that you have the mouse enabled for your kgPanels (where it doesn't let you click through the frame) - that option is on the main window for the panel, up by where you rename it, delete it, etc.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-13-09, 11:32 AM   #11
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by Seerah View Post
Really, all you need to do is what Katae posted in the first reply. Make sure that you have the mouse enabled for your kgPanels (where it doesn't let you click through the frame) - that option is on the main window for the panel, up by where you rename it, delete it, etc.
I will take a look again tonight and see.
__________________
  Reply With Quote
11-13-09, 11:23 PM   #12
Ither
A Firelord
 
Ither's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 497
Originally Posted by Seerah View Post
Really, all you need to do is what Katae posted in the first reply. Make sure that you have the mouse enabled for your kgPanels (where it doesn't let you click through the frame) - that option is on the main window for the panel, up by where you rename it, delete it, etc.
Seerah thanks for the help! I got it to work. I forgot to enable the intercept mouse option.
__________________
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » kgPanels -- Chat Frame Switching


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