View Single Post
09-02-15, 07:45 PM   #19
Kkthnx
A Cobalt Mageweaver
 
Kkthnx's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2011
Posts: 247
Originally Posted by Lesteryoung View Post
It clears the combat for about a second, and then the data just repopulates instantly.

And if you have the combat log targeted and /clear, it clears all other windows as well.

So far MunkDev's code has worked the best, in that it only clears selected windows, but among them can't be the combat log for some reason.
Here you go

Code:
SLASH_CLEARCHAT1 = "/clear"
SLASH_CLEARCHAT2 = "/clearchat"

SlashCmdList.CLEARCHAT = function(cmd)
	cmd = cmd and strtrim(strlower(cmd))
	for i = 1, NUM_CHAT_WINDOWS do
		local f = _G["ChatFrame"..i]
		if f:IsVisible() or cmd == "all" then
			f:Clear()
		end
	end
end
I tested this window by window and this is what you are looking for 100%

Credits to Phanx / PhanxChat
https://github.com/Phanx/PhanxChat/b.../Core.lua#L273
__________________
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.

Last edited by Kkthnx : 09-02-15 at 07:48 PM.
  Reply With Quote