Thread Tools Display Modes
09-11-08, 01:21 AM   #1
STonEDSTonE
A Defias Bandit
 
STonEDSTonE's Avatar
Join Date: Sep 2008
Posts: 3
Hide kg Panels with Minichat

Hello @ all,
I have kg Panels installed, and I found a addon called minichat. Both work fine, but I saw a video where eepanels (eepanels was before kg Panels) was minimized together with minichat. I have 2 chatframes, and both have a kg Panel beneath them. I would like them to minimize and maximize together. My UI is also up here, see
http://www.wowinterface.com/download...DSTonEsUI.html
In the Screenshots there are the 2 chatframes.

I searched on the web (e.g. WoWAce), and I found something:


Originally Posted by WoWAceUser
I basically like the addon - although eePanels fit me well Smiley..

I have been looking around for some scripts.. especially one.. a resizing script..

I use 2 eePanels for each chat.

Example for my one chat called socialchat:

socialchat; This is parrented to ChatFrame1
meta_socialchat; This is parrented to socialchat panel

I used to have a script that hooked my socialchat panel to ChatFrame1 and resized the panel when the panel was folded with MiniChat.

I have been looking through some this and the beta kgpanel post.. but the scripts i found have not been working or responding at all.
I also checked the wowace wiki for kgpanels.. but there's nothing yet.


can anyone post some scripts and tell me very clearly how to do this? Smiley ... i'm a real gimp at these scripts :S


Thx in advance.
This is the Answer:

Originally Posted by WoWAceAdmin
for your socialchat panel

For OnLoad
Code:

Code:

self.resized = false



For OnUpdate
Code:

Code:

if not self.resized then
ChatFrame1:SetScript("OnSizeChanged", function(f)
self:SetWidth(f:GetWidth())
self:SetHeight(f:GetHeight())
end)
self:SetWidth(ChatFrame1:GetWidth())
self:SetHeight(ChatFrame1:GetHeight())
end


For meta_socialchat;
Same OnLoad script

For the OnUpdate


Code:

if not self.resized then
local cf = kgPanels:FetchFrame("socialchat")
if cf then
cf:SetScript("OnSizeChanged", function(f)
self:SetWidth(f:GetWidth())
self:SetHeight(f:GetHeight())
end)
self:SetWidth(cf:GetWidth())
self:SetHeight(cf:GetHeight())
end
end




What this script does:
In OnlLoad we create a variable for the frame called resized, and set it to false
In OnUpdate we check that
1. We havent resized yet
2. The the frame we are trying to resize to exists
Once this check is passed, we set the OnSizechanged script to call back to this frame an adjust according to the other frame, please NOTE this doesnt have to be the parent or the anchor. We use OnUpdate since it is called often and kgPanels may be loaded before the frame you are trying to hook exists yet.

I know it was much to read .. but I really want this to work .. but I have nearly no knowledge in Lua coding (or whatever that is ) ... please help me

Thanks in advance
STonEDSTonE
__________________
!!! Gotta new Shisha !!!

Last edited by STonEDSTonE : 09-11-08 at 01:33 AM.
  Reply With Quote
09-11-08, 11:31 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Did you already try what you quoted and did it not work or something?
__________________
"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
09-11-08, 01:40 PM   #3
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
It doesn't have to be that complex, he's using multiple panels for one ChatFrame. You should be able to simply add the following to the "OnUpdate" script of the panel you want to use backing the ChatFrame:

Code:
local width, height = ChatFrame1:GetWidth(), ChatFrame1:GetHeight()
this:SetWidth(width)
this:SetHeight(height)
I don't remember off the top of my head if kgPanels can use both "this" or "self", try "self" first to see if that works. Parent it to the ChatFrame you're backing (make sure if it's not ChatFrame1, you use the proper #...ie. ChatFrame3, etc).

The only other thing you need to do is make sure you anchor it according to the growth of the ChatFrame animation. By default, MiniChat minimizes "down", so you would want the panel anchored to the bottom of the chat frame. Otherwise it won't "grow" correctly. Also, I've found for them to look right, you sometimes have to add a bit of a buffer to the panel size to avoid the panel settling inside the "chat threshold" of the ChatFrame.
  Reply With Quote
09-13-08, 12:18 PM   #4
STonEDSTonE
A Defias Bandit
 
STonEDSTonE's Avatar
Join Date: Sep 2008
Posts: 3
Originally Posted by Taffu View Post
It doesn't have to be that complex, he's using multiple panels for one ChatFrame. You should be able to simply add the following to the "OnUpdate" script of the panel you want to use backing the ChatFrame:

Code:
local width, height = ChatFrame1:GetWidth(), ChatFrame1:GetHeight()
this:SetWidth(width)
this:SetHeight(height)
I don't remember off the top of my head if kgPanels can use both "this" or "self", try "self" first to see if that works. Parent it to the ChatFrame you're backing (make sure if it's not ChatFrame1, you use the proper #...ie. ChatFrame3, etc).

The only other thing you need to do is make sure you anchor it according to the growth of the ChatFrame animation. By default, MiniChat minimizes "down", so you would want the panel anchored to the bottom of the chat frame. Otherwise it won't "grow" correctly. Also, I've found for them to look right, you sometimes have to add a bit of a buffer to the panel size to avoid the panel settling inside the "chat threshold" of the ChatFrame.
Thanks 4 ur help .. It works .. but the panel minimizes in the middle .. u said sth. about the anchor .. but I don't know how to do that .. it would be wonderful if u could help me with that.
Thanks 4 evrything STonED STonE


Edit: ok I figured that out .. it works .. but the chatframe is always bigger than the layer .. how can I adjust that?
__________________
!!! Gotta new Shisha !!!

Last edited by STonEDSTonE : 09-13-08 at 07:22 PM.
  Reply With Quote
09-18-08, 07:26 AM   #5
STonEDSTonE
A Defias Bandit
 
STonEDSTonE's Avatar
Join Date: Sep 2008
Posts: 3
Ok now it works .. thanks Taffu ... but I can't hide it completly can I? because minichat can't be smaller than 1 line ... or is there a possibility to do that?
greetz STonED STonE
__________________
!!! Gotta new Shisha !!!
  Reply With Quote
09-18-08, 08:25 AM   #6
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
PM'd you, check your mail
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Hide kg Panels with Minichat


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