Thread Tools Display Modes
06-01-17, 09:43 AM   #1
Gwythian
A Kobold Labourer
Join Date: Jun 2012
Posts: 1
Chat Addon Help

Hi everyone,

I'm currently working on trying to develop an addon that I can resize based off of lines.

For example /addonslash1 [1-10] would resize the addon to an amount of lines that the user designated.

I've tried to look through the API and code exported from WoW, but I have some questions that I haven't been able to find through extensive searching on Wow Programming, here, Google, etc.

How does one interact with ChatFrame1 exactly?

I found in the ChatFrame.lua file it declares a global variable of DEFAULT_CHAT_FRAME = ChatFrame1.

Where is ChatFrame1 created in the code? Where should I be looking to find the commands that interact with it? If I make changes to ChatFrame1, does it affect all other ChatFrames? Only ChatFrames docked to it?

I apologize for all the questions, but I've honestly done my due diligence and after a couple days of looking and being unable to find an answer, I was hoping someone could help me get a plain answer.

I'm also trying to learn and be a better programmer, so while I'm open to looking at addons that currently exist to learn how to do this, I'd love to learn how to fish rather than just being fed one.

Thanks for your time! (I probably have follow up questions, but I'm really just trying to get my feet planted here.)
  Reply With Quote
06-01-17, 11:03 AM   #2
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
I've never modified the chat frame myself, but this is what I have come up with in research.

For the size of the window, I believe you have to use SetChatFrameSavedDimensions(frameid, width, height) to set the size of the window.

Since it asks for a frameid it should only modify the size of the frame you tell it to.

If you are looking to set the size of the frame based on number of lines to be shown, you would most likely have to do the height setting by multiplying the number of lines by the height of the current font setting in px since different font sizes have different height values.

you can get the current font size for a window by selecting the 2nd output of GetChatWindowInfo(frameid)


Resources used:

http://wow.gamepedia.com/Global_functions
http://wowprogramming.com/docs/api
https://www.townlong-yak.com/
__________________
My Addons: Convert Ratings Honor Track
  Reply With Quote
06-24-17, 09:38 PM   #3
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
I guess this is late, but ChatFrame1 is in FloatingChatFrame.xml, several chatframes are created there, the standard 10.

Just a tip, frames tend to be created in the XML, so do look there too, not just the Lua files.

To size the chat window it depends on if it is docked or not, if docked, you resize the dock, if free chatframe, you can resize the frame SetHeight() SetWidth() I think.

If the chatframe is anchored, you may have to ClearAllPoints(), SetPoint() first.

Last edited by sylvanaar : 06-25-17 at 02:43 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Chat Addon Help

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