Thread Tools Display Modes
09-18-09, 02:05 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Chat Frame behavior

Okay so im having issues with chat frame behavior. I get strange errors when loading up about hooking but only when its a fresh load with no chat-cache.txt.

if i /reload the errors go away and the chat sets part way up. then... if i /reload AGAIN it sets up a little more but then has new weird errors. if i /reload again something new happens. anyhow any ideas? this is the code for the chatframe.

Code:
local dummy = function() end 
	local takeover = CreateFrame"Frame" 
	takeover:RegisterEvent("PLAYER_ENTERING_WORLD") 
	takeover:SetScript("OnEvent", function(self, event) 
	    takeover:UnregisterEvent("PLAYER_ENTERING_WORLD") -- don't fire on next loading screens 
		
		-- ChatFrame1 General
	    ChatFrame1:ClearAllPoints() 
	    ChatFrame1:SetPoint("BOTTOMLEFT", GrimUIcoreArtB1, "BOTTOMLEFT", 14, 25) 
	    ChatFrame1:SetWidth(350) 
	    ChatFrame1:SetHeight(190) 
	    ChatFrame1:SetFrameLevel(10)
		RemoveChatWindowChannel(1, "Trade")
		RemoveChatWindowMessages(1, "SKILL")
		RemoveChatWindowMessages(1, "LOOT")
		RemoveChatWindowMessages(1, "MONEY")		
	    RemoveChatWindowMessages(1, "COMBAT_FACTION_CHANGE")
		ChatFrame1.ClearAllPoints = dummy		
	    ChatFrame1.SetPoint = dummy 
	 
		-- ChatFrame2 Combat Log
	    ChatFrame2:ClearAllPoints()
		SetChatWindowShown(2, 1)
	    SetChatWindowDocked(2, 0)
		ChatFrame2:SetPoint("BOTTOMRIGHT", GrimUIcoreArtB4, "BOTTOMRIGHT", -13, 17) 
	    SetChatWindowAlpha(2, 1)
		ChatFrame2:SetWidth(143) 
	    ChatFrame2:SetHeight(126)
		ChatFrame2:SetFrameLevel(8)
	    ChatFrame2.ClearAllPoints = dummy 
	    ChatFrame2.SetPoint = dummy
		ChatFrame2.SetFrameLevel = dummy
		
		--ChatFrame4 Guild
		SetChatWindowShown(4, 1)
		SetChatWindowDocked(4, 1)
		SetChatWindowName(4,"Guild")
		AddChatWindowMessages(4, "GUILD")
		AddChatWindowMessages(4, "GUILD_OFFICER")
		AddChatWindowMessages(4, "GUILD_ACHIEVEMENT")GUILD_ACHIEVEMENT
		
		-- ChatFrame5 Whisper
	    SetChatWindowShown(5, 1)
		SetChatWindowDocked(5, 1)
		SetChatWindowName(5,"Whisper")
		AddChatWindowMessages(5, "WHISPER")
		
		--ChatFrame3 Trade
		SetChatWindowShown(3, 1)
		SetChatWindowDocked(3, 1)
		SetChatWindowName(3,"Trade")
		ChatFrame_AddChannel(ChatFrame3, "Trade");

		
		--ChatFrame6 Info Log
	    SetChatWindowShown(6, 1)
		SetChatWindowName(6,"Info Log")
		ChatFrame6:ClearAllPoints() 
	    ChatFrame6:SetPoint("BOTTOMRIGHT", ChatFrame2, "BOTTOMLEFT", -7, 0) 
	    SetChatWindowAlpha(6, 1)
		ChatFrame6:SetWidth(212) 
	    ChatFrame6:SetHeight(130)
		ChatFrame6:SetFrameLevel(10)		
	    ChatFrame6.ClearAllPoints = dummy 
	    ChatFrame6.SetPoint = dummy 
end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 06:24 PM   #2
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Okay soo.... i think i have the setup good to go except for the fact that i have to reload after loging in to make it set up completely and get rid of the errors it pops on load.

I have changed my code to the beloww, the errors that pop have to do with FCF_Dockupdate and other functions in the UIparent.lua it says im trying to setpoint anchors on chatframe1 to itself. Keep in mind that it works proper if i /reload after loging in.

Code:
local dummy = function() end
	local chatsetup = CreateFrame"Frame" 
	chatsetup:RegisterEvent("PLAYER_ENTERING_WORLD") 
	chatsetup:SetScript("OnEvent", function(self, event)
		chatsetup:UnregisterEvent("PLAYER_ENTERING_WORLD")
		-- ChatFrame1 General
	    ChatFrame1:ClearAllPoints() 
	    ChatFrame1:SetPoint("BOTTOMLEFT", GrimUIcoreArtB1, "BOTTOMLEFT", 14, 25) 
	    ChatFrame1:SetWidth(350) 
	    ChatFrame1:SetHeight(190) 
	    ChatFrame1:SetFrameLevel(10)
		ChatFrame1UpButton:Hide() 
	    ChatFrame1DownButton:Hide()
		RemoveChatWindowChannel(1, "Trade")
		RemoveChatWindowMessages(1, "SKILL")
		RemoveChatWindowMessages(1, "LOOT")
		RemoveChatWindowMessages(1, "MONEY")		
	    RemoveChatWindowMessages(1, "COMBAT_FACTION_CHANGE")
		DEFAULT_CHAT_FRAME.ClearAllPoints = dummy		
	    DEFAULT_CHAT_FRAME.SetPoint = dummy
		ChatFrame1.ClearAllPoints = dummy
		ChatFrame1.SetPoint = dummy
		ChatFrame1UpButton.Show = dummy
	    ChatFrame1DownButton.Show = dummy
		
		-- ChatFrame2 Combat Log
	    ChatFrame2:ClearAllPoints()
		SetChatWindowShown(2, 1)
	    SetChatWindowDocked(2, 0)
		ChatFrame2:SetPoint("BOTTOMRIGHT", GrimUIcoreArtB4, "BOTTOMRIGHT", -13, 17) 
	    SetChatWindowAlpha(2, 1)
		ChatFrame2UpButton:Hide() 
	    ChatFrame2DownButton:Hide()
		ChatFrame2:SetWidth(143) 
	    ChatFrame2:SetHeight(126)
		ChatFrame2:SetFrameLevel(8)
	    ChatFrame2.ClearAllPoints = dummy 
	    ChatFrame2.SetPoint = dummy
		ChatFrame2.SetFrameLevel = dummy
		
		-- ChatFrame3 Whisper
	    SetChatWindowDocked(3, 1)
		SetChatWindowName(3,"Whisper")
		AddChatWindowMessages(5, "WHISPER")
		ChatFrame3UpButton:Hide() 
	    ChatFrame3DownButton:Hide()
		
		--ChatFrame4 Guild
		SetChatWindowDocked(4, 1)
		SetChatWindowName(4,"Guild")
		AddChatWindowMessages(4, "GUILD")
		AddChatWindowMessages(4, "GUILD_OFFICER")
		AddChatWindowMessages(4, "GUILD_ACHIEVEMENT")
		ChatFrame4UpButton:Hide() 
	    ChatFrame4DownButton:Hide()
		
		--ChatFrame5 Trade
		SetChatWindowDocked(5, 1)
		SetChatWindowName(5,"Trade")
		ChatFrame_AddChannel(ChatFrame5, "Trade");
		ChatFrame5UpButton:Hide()
	    ChatFrame5DownButton:Hide()
		
		--ChatFrame6 Info Log
	    SetChatWindowShown(6, 1)
		SetChatWindowName(6,"Info Log")
		ChatFrame6:ClearAllPoints() 
	    ChatFrame6:SetPoint("BOTTOMRIGHT", ChatFrame2, "BOTTOMLEFT", -7, 0) 
	    SetChatWindowAlpha(6, 1)
		ChatFrame6:SetWidth(212) 
	    ChatFrame6:SetHeight(130)
		ChatFrame6UpButton:Hide()
	    ChatFrame6DownButton:Hide()
		ChatFrame6:SetFrameLevel(10)		
	    ChatFrame6.ClearAllPoints = dummy 
	    ChatFrame6.SetPoint = dummy
		
	end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 07:05 PM   #3
Cralor
Mmm... cookies!!!
 
Cralor's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 772
Shouldn't

local chatsetup = CreateFrame"Frame"

be

local chatsetup = CreateFrame("Frame")
__________________
Never be satisfied with satisfactory.
  Reply With Quote
09-18-09, 07:17 PM   #4
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
i think your right although that does not appear to be the error going to test right now.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 07:38 PM   #5
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Originally Posted by Cralor View Post
Shouldn't

local chatsetup = CreateFrame"Frame"

be

local chatsetup = CreateFrame("Frame")
No you actually can do that, even though it looks weird.
  Reply With Quote
09-18-09, 08:17 PM   #6
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
yea, that did not make the difference.

Why i have to /reload 2 times on fresh install is beyond me.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 08:42 PM   #7
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
just found something else that requires a second reload heh my setcvar script requires it be run twice....

Fixed the chat errors by removing the frame all together. Although for some reason the doc'd tabs weird out when it first sets up and it requires i /reload to fix them still.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 09:26 PM   #8
Cralor
Mmm... cookies!!!
 
Cralor's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 772
Ah, that's weird that the frame call would work. Guess I learned something new. Anyway, hope you can get it fixed.
__________________
Never be satisfied with satisfactory.
  Reply With Quote
09-18-09, 09:37 PM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
well the dbl loading problem has to do with the fact those settings dont actually save until you log out so even though my stuff is setting it up properly, for the most part, those settings dont actually take full effect until you log/reload still working on it lol. this is at lest the issue im sure with the cvar part....

the chat im not positive as the majority of it sets up just fine the only issue is the chat tabs fire up funny and the channel settings and filter settings also appear to require a reload no mater what.

keep in mind these are all errors that happen when you have no WTF at all. if you log in, log out, log back in again.... its all just fine.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-18-09, 09:48 PM   #10
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
for that mater its only the trade chat frame that does not dock right
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-19-09, 12:45 AM   #11
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
You're running into the same problem as I stated in the other thread - you're doing this at the wrong stage of the UI loading process.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
09-19-09, 12:58 AM   #12
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
ive tried all different stages.

ive tried making a frame and registering events and firing it then... no go...

putting it into a frame seems to cause other weird errors or rather malfunctions, does not actually pop an error
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-19-09, 11:12 AM   #13
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Okay i think i have figured things out to some degree. Here is what i think is happening. The server stores your chat layout. It must, i have seen numerous things to prove this. SO what happens is.... my addon sets up everything but does not unset whats saved to the server. now the question is how do i make my addon stop the servers saved stuff or reset it before setting my settings up....
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-19-09, 11:19 AM   #14
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The server does not save anything regarding chat. It's all in your WTF folder.

/edit: and what events did you try using?
__________________
"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-19-09, 12:31 PM   #15
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
well player entering world, player login, and then i tried doing a on chat msg thingy so it would fire when the chat box got its first msg of any kind but none of them work to bypass this.

Hmmm okay so then im really confuzzeled at this point. Heres why....

every time i close the game i delete the wtf folder so when i reload i can see what new users of my UI see.... well.... sometimes the chat layout is picking up things from the prior setup, and even more strange is sometimes it picks up bits and pieces from a setup several trys earlier. this is especially so for the chat filter settings. Also noticed this when Hitmode is in or out... IE if i take hitmode out the hitmode chatframe7 settings linger around for ever. in other words it takes several deleting of the WTF folder before eventually on load it disappears.

I just uploaded the current interface with no wtf's to the release page. unfortunately the chat settings require a /reload and i just ended up leaving the setcvar stuff out all together and added to the directions of setting that you have to set those yourself then /reload to fix the chat. If you feel really adventurous you could download it and take a look the .lua in question as far as the chat goes is GrimUIChat.lua it has no eventload right now since those all caused errors more then normal. so its just a flat out change the chat code but you can see exactly what i have done and what im talking about as far as how it wireds out.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-21-09, 10:41 AM   #16
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Here is the current chat code it still does not work. Also it would appear that it really does save to the server. However it will only load off the server if A: it can not find a valid chat-cache.txt file and B: their is no other chat setup code used, or if your chat code has errors.

Code:
local dummy = function() end
-----------------------------------
-- Start Setup Variable CHeck --
-----------------------------------
local GrimUIFirstLoad = CreateFrame("Frame");
GrimUIFirstLoad:RegisterEvent("ADDON_LOADED");
GrimUIFirstLoad:RegisterEvent("PLAYER_LOGOUT");
function GrimUIFirstLoad:OnEvent(event, arg1)
 
 if event == "ADDON_LOADED" and arg1 == "FirstLoad" then
   if FirstLoad == nil then
   FirstLoad = False; 
  end
  if FirstLoadTrue then
	ChatFrame1:ClearAllPoints()
	ChatFrame1:SetPoint("BOTTOMLEFT", GrimUIcoreArtB1, "BOTTOMLEFT", 14, 25) 
	ChatFrame1:SetWidth(350)
	ChatFrame1:SetHeight(190)
	ChatFrame1:SetFrameLevel(8)
	ChatFrame1UpButton:Hide()
	ChatFrame1DownButton:Hide()
	DEFAULT_CHAT_FRAME.ClearAllPoints = dummy
	DEFAULT_CHAT_FRAME.SetPoint = dummy
	ChatFrame1UpButton.Show = dummy
	ChatFrame1DownButton.Show = dummy
	ChatFrame1.ClearAllPoints = dummy
	ChatFrame1.SetPoint = dummy
	ChatFrame1UpButton.Show = dummy
	ChatFrame1DownButton.Show = dummy

-- ChatFrame2 Combat Log
	ChatFrame2:ClearAllPoints()
	SetChatWindowShown(2, 1)
	ChatFrame2:SetPoint("BOTTOMRIGHT", GrimUIcoreArtB4, "BOTTOMRIGHT", -13, 17)
	SetChatWindowAlpha(2, 1)
	ChatFrame2UpButton:Hide()
	ChatFrame2DownButton:Hide()
	ChatFrame2:SetWidth(143)
	ChatFrame2:SetHeight(126)
	ChatFrame2:SetFrameLevel(8)
	ChatFrame2.ClearAllPoints = dummy
	ChatFrame2.SetPoint = dummy
	ChatFrame2.SetFrameLevel = dummy
	ChatFrame2UpButton.Show = dummy
	ChatFrame2DownButton.Show = dummy
--ChatFrame3 Trade
	SetChatWindowDocked(3, 1)
	SetChatWindowName(3, "Trade")
	ChatFrame3UpButton:Hide()
	ChatFrame3DownButton:Hide()
	ChatFrame3.ClearAllPoints = dummy
	ChatFrame3UpButton.Show = dummy
	ChatFrame3DownButton.Show = dummy
	
	-- ChatFrame4 Whisper
	SetChatWindowDocked(4, 1)
	SetChatWindowName(4, "Whisper")
	AddChatWindowMessages(4, "WHISPER")
	ChatFrame4UpButton:Hide()
	ChatFrame4DownButton:Hide()
	ChatFrame4.ClearAllPoints = dummy
	ChatFrame4UpButton.Show = dummy
	ChatFrame4DownButton.Show = dummy
	
	--ChatFrame5 Guild
	SetChatWindowDocked(5, 1)
	SetChatWindowName(5, "Guild")
	AddChatWindowMessages(5, "GUILD")
	AddChatWindowMessages(5, "GUILD_OFFICER")
	AddChatWindowMessages(5, "GUILD_ACHIEVEMENT")
	ChatFrame5UpButton:Hide() 
	ChatFrame5DownButton:Hide()
	ChatFrame5.ClearAllPoints = dummy
	ChatFrame5UpButton.Show = dummy
	ChatFrame5DownButton.Show = dummy
	--ChatFrame6 Info Log
	ChatFrame6:ClearAllPoints()
	ChatFrame6:SetPoint("BOTTOMRIGHT", ChatFrame2, "BOTTOMLEFT", -7, 0)
	SetChatWindowDocked(6, 0)
	SetChatWindowShown(6, 1)
	SetChatWindowName(6, "Info Log")
	SetChatWindowAlpha(6, 1)
	ChatFrame6:SetWidth(212)
	ChatFrame6:SetHeight(130)
	ChatFrame6UpButton:Hide()
	ChatFrame6DownButton:Hide()
	ChatFrame6:SetFrameLevel(10)
	ChatFrame6.ClearAllPoints = dummy
	ChatFrame6.SetPoint = dummy
	ChatFrame6UpButton.Show = dummy
	ChatFrame6DownButton.Show = dummy
      
	RemoveChatWindowChannel(1, "Trade")
	RemoveChatWindowMessages(1, "SKILL")
	RemoveChatWindowMessages(1, "LOOT")
	RemoveChatWindowMessages(1, "MONEY")	
	RemoveChatWindowMessages(1, "COMBAT_FACTION_CHANGE")
	AddChatWindowMessages(6, "SKILL")
	AddChatWindowMessages(6, "LOOT")
	AddChatWindowMessages(6, "MONEY")
	AddChatWindowMessages(6, "TRADESKILLS")
	AddChatWindowMessages(6, "PET_INFO")
	AddChatWindowMessages(6, "COMBAT_XP_GAIN")
	AddChatWindowMessages(6, "OPENING")
	AddChatWindowMessages(6, "COMBAT_MISC_INFO")
	AddChatWindowMessages(6, "COMBAT_FACTION_CHANGE")
	AddChatWindowMessages(6, "COMBAT_HONOR_GAIN")
	ChatFrame_AddChannel(ChatFrame3,"Trade");
   
   
   
   print("GrimUI first time use.  Please Log out and/or /reload to save and finish settings.");
   elseif 
   FirstLoadFalse then 
   print("GrimUI Loaded");
  end
 elseif event == "PLAYER_LOGOUT" then
   FirstLoad = false; 
 end
end
GrimUIFirstLoad:SetScript("OnEvent", GrimUIFirstLoad.OnEvent);
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-21-09, 11:36 AM   #17
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The args that fire with the OnEvent handler are self and event, then anything provided by that event. You're checking the first arg for your event name. Instead of the second. This would probably be why it's not working. You wouldn't be getting anything printed to the chat frame either, if this were the case.

/edit: also, false is not capitalized. AlsoAlso... if FirstLoad == false then ..and.. if FirstLoad == true then (or if not FirstLoad then ..and.. if FirstLoad then). FirstLoadFalse and FirstLoadTrue are completely different variables which don't exist in your code.
__________________
"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


Last edited by Seerah : 09-21-09 at 11:39 AM.
  Reply With Quote
09-21-09, 12:13 PM   #18
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
hmm well oddly enough the variables seem to be doing what there supposed to. The real issue is with the chat setup code. I can put it in a file all by itself no event handlers and it has same errors. i can put it in a frame with just event handlers and it errors exacctly the same. it errors exactly the same with the saved variable.

Basicly whats supposed to happen is.... its supposed to check to see if the addon is loading for the first time. If it is then its supposed to set all the chat settings. The variable is so it does not set them every time you log in because i was thinking maybe this was causing errors not to mention the end user should be able to adjust them if they want.

Like i said though no mater what it errors on chat setup. Tells me there is an error in framexml/floatingchatframe.lua the initial error says its attempting to setpoint anchor to itself over and over. I have broke everything down to where i have no addns but the grimUI core no WTF files of any kind so its clearly blizzard and my setup code fighting. but why?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Chat Frame behavior


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