From 8845073b80ddfb5acdb36dc1ae37ff246fe492f0 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Tue, 4 Jan 2011 14:34:49 -0500 Subject: [PATCH] -Apparently the event frame wasn't working for everyone. -This should have been fixed. --- ChatInputTop.lua | 14 ++++++-------- ChatInputTop.toc | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ChatInputTop.lua b/ChatInputTop.lua index 4df11b2..c86ff10 100644 --- a/ChatInputTop.lua +++ b/ChatInputTop.lua @@ -1,12 +1,10 @@ --I just wanted a simple mod that would display the InputBox on the top of the ChatFrame rather then the bottom -local f = CreateFrame("frame","ChatInputTop",UIParent) -f:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, event, ...) end end) +local eventFrame = CreateFrame("Frame", "ChatInputTop_EventFrame", UIParent) +eventFrame:RegisterEvent("ADDON_LOADED") -f:RegisterEvent("ADDON_LOADED") - -function f:ADDON_LOADED(self, event, ...) - if arg1 == "ChatInputTop" then +eventFrame:SetScript("OnEvent", function(self, event, ...) + if event == "ADDON_LOADED" and select(1, ...) == "ChatInputTop" then if( DEFAULT_CHAT_FRAME ) then DEFAULT_CHAT_FRAME:AddMessage("ChatInputTop Loaded."); end @@ -19,6 +17,6 @@ function f:ADDON_LOADED(self, event, ...) eb:SetPoint("BOTTOMRIGHT", ("ChatFrame%d"):format(i), "TOPRIGHT", 5, 0) end - f:UnregisterEvent("ADDON_LOADED"); + eventFrame:UnregisterEvent("ADDON_LOADED") end -end +end) diff --git a/ChatInputTop.toc b/ChatInputTop.toc index 2cadf63..8e3f421 100644 --- a/ChatInputTop.toc +++ b/ChatInputTop.toc @@ -1,6 +1,6 @@ ## Interface: 40000 ## Title: ChatInputTop ## Author: Xruptor -## Version: 1.3 +## Version: 1.4 ## Notes: All this does is move the input box to the top when typing in the chat frame. ChatInputTop.lua -- 1.7.9.5