Quantcast

-Apparently the event frame wasn't working for everyone.

Xruptor [01-04-11 - 19:34]
-Apparently the event frame wasn't working for everyone.
-This should have been fixed.
Filename
ChatInputTop.lua
ChatInputTop.toc
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