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