Hiding ALL chat windows
Is there a way to hide all chat windows, including the General Chat Window? I have only been able to find ChatFrame1 ,2 ,3 etc. but I cant seem to find the name of the General Chat Window object/frame, nor whether it can be hidden or at least collapsed to minimum size.
Thanks :) |
You have 3 frames to hide for each of the (up to 10) chat frames:
ChatFrameX ChatFrameXTab ChatFrameXTabDockRegion (where X has to be replaced with whatever integer is the ID of the frame you want to hide, from 1 to 10) The chat frames will keep showing up from time to time on some events if you do that, so you have to do prevent them from showing up while you want them hidden (and cancel that afterward). An option is to set their "OnShow" script to call the "Hide()" method, so that a frame will hide every time it's shown. |
Thank you Layrajha... you helped me a lot with your reply. :)
|
Ok... here is what I came up with for my table
Code:
13 for i = 1,7 do As I understand it, if I set a global frame as a prototype, any attempt at calling a function that doesn't exist in my table will look up and execute the function in the prototype. What am I missing here? What is the proper way to set this up? |
Quote:
Code:
local g = getfenv(0) |
Thanks for the pointers, Slakah!
I've been looking at the global environment as an option, but hadn't tried implementing it yet (still learning the ins and outs of Lua) In any case, I only want to hide the frames while in combat. I need to be able to switch out their OnShow, and run their IsShown, Show, and Hide functions so my questions are: 1. How can I store global frames in a table in such a way as to run its methods? -- that is what I was trying to do in my code sample 2. Is there a way to copy a method to a local using the global environment? or can I simply use Code:
function ORIG_OnShow = g["ChatFrame"..i].OnShow Code:
g["ChatFrame"..i]:OnShow() |
Quote:
Code:
local frames = {} Code:
local frames = {} Then to say hide the frame do. Code:
frames.1:Hide() Code:
for i,v in ipairs(frames) do http://www.wowwiki.com/index.php?tit...pt&action=edit :GetScript("handle") |
I actually couldn't get that to work, so I hooked the Chat_Frame_OnUpdate event handler, which is much simpler, and seems to work fine. hidden is just a boolean that indicates whether I'm hiding the frames or not. Thanks again for the input.
Code:
|
For anyone interested, the addon is called ChatToggle, which is now available here
|
Quote:
Quote:
Code:
frames[1]:Hide() Code:
local _G = _G |
Quote:
Also why are you hooking OnUpdate, why not just set OnShow to hide the frame. |
Quote:
|
Quote:
As to why I hooked OnUpdate, it's because otherwise I would have to set/reset 21 API scripts every time combat started/ended, meaning copying them to yet another table. Besides, it's more efficient to add a couple of instructions to a global handler (ie. the only added memory writes are to the cpu registers) than to be rewriting (in RAM) a frame event handler many times during play. |
Quote:
Also, I'm surprised that hooking only 1 function is enough for preventing the frames to show. From what I remembered, zoning would show the frames even if the OnUpdate function was hooked, etc. I remember that I hooked at least 3 functions before I was given a hint about the "OnShow = Hide" thing. |
Quote:
Quote:
(I'm really hoping you'll install the addon and try some things out, Layrajha ;)) |
All times are GMT -6. The time now is 07:49 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI