Thread Tools Display Modes
03-13-11, 01:56 AM   #1
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
Setting up Chat defaults/moving chat tab text

Hey,

im working on creating a addon that basicly adjust chat windows to a fixed position.

So far i have figured out most settings for it from this forum. But i haven't found a way to change chat tab's.

Basicly what i want todo:
1. Set font and font color (different color for active window)
2. Offset/move names up with about 20px from chat frame.

Any tip/example?

Maybe wrong to call it a addon tho. I just whant it to setup chat defaults to mach my UI.

Thx in advance.

Last edited by frohanss : 03-13-11 at 01:59 AM.
  Reply With Quote
03-13-11, 02:12 AM   #2
Akkorian
A Flamescale Wyrmkin
 
Akkorian's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 111
Hi Frohanss,

If you just want to set up your chat frame to look the same on all your characters, the simplest way is just to copy the file where the game stores those settings:

World of Warcraft » WTF » Account » ACCOUNTNAME » Realm Name » Charactername » chat-cache.txt

and paste it into the folders for each of your other characters.

If you want to write an addon you can share with other people that will make their chat frames look just like your chat frames, then you’ll have to look up all of the functions that the game calls when you create a chat tab, rename a chat tab, turn a channel on or off for a tab, etc. and call those same functions from your addon. Looking at Blizzard’s code is probably the easiest way to find out which functions you need to call, and what arguments they expect.
__________________
“Be humble, for you are made of earth. Be noble, for you are made of stars.”
  Reply With Quote
03-13-11, 10:32 AM   #3
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
Thx for the reply.

Yes i know about the chat-cache.txt file.

But this doesn't hold info regarding what i am asking for. Atleast not as i have seen it.

Code:
ChatFrame1Tab:SetPoint("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 20)
ChatFrame1Tab.SetPoint = function() end
Just need to figure out the font part now.
  Reply With Quote
03-13-11, 02:19 PM   #4
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
So i have figured out partly how to handle the font:

Code:
ChatFrame1TabText:SetFont("Fonts\\FRIZQT__.TTF", 16, "THINOUTLINE")
ChatFrame1TabText:SetTextColor(1, 1, 1)
But im totaly stuck on handling the "hover" colors.
Im trying to get chat tab text to be different based on status.
Like:
Selected: Dark Blue
Normal: Blue
Mouse Over: Light Blue

Any pointers to a stuck soul?
  Reply With Quote
03-14-11, 01:56 AM   #5
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
You can either use ChatAlerts or look at the code and see how I'm handling it.
__________________
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
03-16-11, 11:52 AM   #6
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
Can't get seem to do anything to ChatFrame1.

It handles the rest of the chat frames correctly, but i can't change position on frame 1.

Code:
local x = CreateFrame("Frame")
x:SetScript("OnEvent", function()
	FCF_ToggleLock()
	ChatFrame1:SetParent(nil)
	ChatFrame1TabFrame:SetParent(nil)
	ChatFrame1:ClearAllPoints()
	ChatFrame1TabFrame:ClearAllPoints()
	ChatFrame1:SetParent(LChat)
	ChatFrame1TabFrame:SetParent(LChat)
	ChatFrame1:SetFrameLevel(LChat:GetFrameLevel()+1)
	ChatFrame1:SetWidth(LChat:GetWidth())
	ChatFrame1:SetHeight(LChat:GetHeight())
	ChatFrame1:SetPoint("BOTTOMLEFT",LChat,"BOTTOMLEFT",5,5)
	ChatFrame1:SetPoint("TOPRIGHT",LChat,"TOPRIGHT",-5,-5)
	ChatFrame1ButtonFrame:SetPoint("BOTTOMRIGHT",LChatTab,"BOTTOMRIGHT",-5,5)
	ChatFrame1TabFrame:SetPoint("BOTTOMLEFT",LChat,"TOPLEFT",0,0)
	ChatFrame1TabText:SetFont("Interface\\Addons\Centurions\\media\\HandelGothicBT.ttf", 14, "THINOUTLINE")
	ChatFrame1TabText:SetTextColor(.5,.5,.5)
end)
x:RegisterEvent("PLAYER_ENTERING_WORLD")
Is it the register event that is wrong? Cause this works perfectly ingame.
Code:
/script ChatFrame1:SetPoint("BOTTOMLEFT",LChat,"BOTTOMLEFT",5,5)
  Reply With Quote
03-16-11, 02:37 PM   #7
Akkorian
A Flamescale Wyrmkin
 
Akkorian's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 111
Hi Frohanss,

You might want to take a look at Fane to see how it handles changing the chat tabs.
__________________
“Be humble, for you are made of earth. Be noble, for you are made of stars.”
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Setting up Chat defaults/moving chat tab text


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