Thread Tools Display Modes
08-19-05, 02:14 AM   #1
Random
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 93
Chat Frame EditBox

Ok, Im trying to experiment with lua/xml and this whole addon thing.

So, I opened up SatrinaChatFrame, because it seemed like a simple enuff addon. Basically my goal is to get rid of all the extra stuff and make it so it just moves the ChatEditBox to the top of the ChatFrame. I know this probally seems simple, but I don't understand a lot of how everything works and what functions do what...so Im starting slow.

I was looking thru the code and something was weird, I noticed there was an OldChatEdit something or another.

Im wondering, the mods that move the ChatFrameEditBox, don't really move it, do they? They just hide the real one, create another and make it moveable then takes the text from the hidden one and puts it in the new one, right?

I might have some more questions later, but right now I just would like to know if this is how the process is done.

EDIT
Hmm, so I can finally log on and it works...Im not sure if I deleted all the useless stuff tho

So since I don't have anywhere to upload and it's all quite small...

LUA
Code:
function SatrinaChatFrame_OnLoad()
   ChatFrameEditBox:ClearAllPoints();
   ChatFrameEditBox:SetPoint("BOTTOMLEFT", "ChatFrame1", "TOPLEFT", 0, 2);
   ChatFrameEditBox:SetPoint("BOTTOMRIGHT", "ChatFrame1", "TOPRIGHT", 0, 2);
end

SatrinaChatFrame_OldChatEdit_SendText = ChatEdit_SendText;
function ChatEdit_SendText(editBox, addHistory)
   SatrinaChatFrame_PreprocessText(editBox, addHistory);
   SatrinaChatFrame_OldChatEdit_SendText(editBox, nil)
end

function SatrinaChatFrame_PreprocessText(editBox, addHistory)
   local text = editBox:GetText();
   if ( strlen(text) <= 0 ) then
      return;
   end

   if addHistory then
      editBox:AddHistoryLine(text);
   end

   editBox:SetText(text);
end

XML
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
   <Script file="SatrinaChatFrame.lua"/>
   <Script file="localisation.lua"/>

   <Frame name="SatrinaChatFrame" parent="UIParent" hidden="false">
      <Scripts>
         <OnLoad>
            SatrinaChatFrame_OnLoad();
         </OnLoad>
      </Scripts>
  </Frame>

   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame1" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame2" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame3" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame4" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame5" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame6" />
   <Frame name="$parentScrollFrame" inherits="SatrinaScrollFrameTemplate" parent="ChatFrame7" />

</Ui>
And there is one savedvar that Im not sure if I need...SatrinaChatFrame.xml
  Reply With Quote
08-19-05, 02:56 PM   #2
Random
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 93
Ok, so I figured out my above question, now Im wondering this...


When you move the chat buttons off the screen, they move to the right side instead but when there is room for them to go back to the left, they do...so is there function to move them to the right?

Last edited by Random : 08-19-05 at 07:01 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Chat Frame EditBox


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