Reply
Thread Tools Display Modes
Unread 12-13-12, 03:31 PM   #1
TGifallen
A Murloc Raider
Join Date: Dec 2012
Posts: 7
Chat Frames not retaining filter settings

So I am messing with kgpanels to try to set up some sort of hacky chat tabs so i can have my Log, guild and loot windows on the right side and my general and whisper windows on the left. My code shows and hides the windows properly but the windows never save their filter settings.

Code:
-- on load
HackTabs = HackTabs or {}
local tab = GetClickFrame(\"ChatFrame3Tab\")
tab:Hide()

local Frame = GetClickFrame(\"ChatFrame3\")
HackTabs.ChatFrame3 = {
    Frame = Frame,
    Parent=Frame:GetParent(),
    Tab = tab,
}

-- on click
local Frame =HackTabs.ChatFrame3
Frame.Frame:SetParent(Frame.Parent)
Frame.Frame:Show()
for k,v in pairs(HackTabs) do
    if not (v == Frame) then
        v.Frame:SetParent(nil)
        v.Frame:Hide()
    end
end
TGifallen is offline   Reply With Quote
Unread 12-13-12, 04:22 PM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 764
I can't believe that compiles, since you use \" (escaping quotes) in a place that isn't even a string.

Should just be this, no?

"ChatFrame3Tab"

Example when to use \"

"You can \"quote\" a word that is in quotes already."
__________________
Profile: Curse | Wowhead
Vlad is offline   Reply With Quote
Unread 12-13-12, 05:58 PM   #3
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,391
It's obviously not his real and/or whole code.

@TGifallen - Please post your entire, actual code. There's nothing in the fake snippet you posted that would affect the game's chat frame settings in any way. Posting fake snippets is just a waste of time, for both you -- because nobody can help you, and you just have to come back and post the real thing anyway -- and everyone else -- because we have to spend time looking at your useless fake code and telling you to post your real code.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 12-13-12, 08:37 PM   #4
TGifallen
A Murloc Raider
Join Date: Dec 2012
Posts: 7
Originally Posted by Phanx View Post
It's obviously not his real and/or whole code.

@TGifallen - Please post your entire, actual code. There's nothing in the fake snippet you posted that would affect the game's chat frame settings in any way. Posting fake snippets is just a waste of time, for both you -- because nobody can help you, and you just have to come back and post the real thing anyway -- and everyone else -- because we have to spend time looking at your useless fake code and telling you to post your real code.
I guess I wasn't clear when I said these events are using kgpanels events to make fake buttons, and this is my real and entire code. that's the reason it has escapes, because i'm reading it from the kgpanels config lua file, the two big blobs of text you see on the right are the code for 2 buttons. The code is exactly the same except for one button uses ChatFrame3 and the other uses ChatFrame4.

I cleaned it up again.

Lua Code:
  1. --[[ LOAD EVENT --]]
  2. HackTabs = HackTabs or {}
  3. local tab = GetClickFrame("ChatFrame3Tab")
  4. tab:Hide()
  5. local Frame = GetClickFrame("ChatFrame3")
  6.  
  7. HackTabs.ChatFrame3 = {
  8.     Frame = Frame,
  9.     Parent=Frame:GetParent(),
  10.     Tab = tab,
  11. }
  12. for k,v in pairs(HackTabs) do
  13.     if not (v.Frame == Frame) then
  14.         --v.Frame:SetParent(nil)
  15.         -- v.Frame:Hide()
  16.     end
  17. end
  18.  
  19. --[[CLICK EVENT--]]
  20.  
  21. local Frame = HackTabs.ChatFrame3
  22.  
  23. Frame.Frame:SetParent(Frame.Parent)
  24. Frame.Frame:Show()
  25.  
  26. for k,v in pairs(HackTabs) do
  27.     if not (v == Frame) then
  28.         v.Frame:SetParent(nil)
  29.         v.Frame:Hide()
  30.     end
  31. end
  32.  
  33. --[[UPDATE EVENT --]]
  34. HackTabs.ChatFrame3.Tab:Show()

Edit:
I deeply apologize for wasting your time, it turns out it was an error with Chatter, and not my code, sorry. But if anyone does want to help more pointing me in the right direction to where I can learn to make a full blown addon would be great.

Edit2:
I would also appreciate it if anyone told me how I can set channel filters through lua, so i can have lua hide and set up filters (like guild chat, officer chat) on chat frames.

Last edited by TGifallen : 12-13-12 at 09:20 PM.
TGifallen is offline   Reply With Quote
Unread 12-13-12, 10:52 PM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,391
For message types:
  • ChatFrame_AddMessageGroup(ChatFrame1, "GUILD")
  • ChatFrame_RemoveMessageGroup(ChatFrame1, "RAID")

For individual numbered channels (eg. trade, general):
  • ChatFrame_AddChannel(ChatFrame1, "Trade")
  • ChatFrame_RemoveChannel(ChatFrame1, "General")

Note that for both, the first argument must be a reference to the chat frame you want to affect, not a string containing its name.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » Chat Frames not retaining filter settings

Thread Tools
Display Modes

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