From 34f066c2eec447a3b7437fce6035b231bdb6d385 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Thu, 14 Oct 2010 19:50:40 -0400 Subject: [PATCH] -Updated for 4.0 --- LagBar.lua | 18 ++++++++++++++++-- LagBar.toc | 6 +++--- LagBar.xml | 15 --------------- 3 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 LagBar.xml diff --git a/LagBar.lua b/LagBar.lua index 54dc845..b6b28a7 100644 --- a/LagBar.lua +++ b/LagBar.lua @@ -1,6 +1,20 @@ --LagBar by Xruptor +local LagBar = CreateFrame("frame", "LagBar", UIParent) + +LagBar:SetScript('OnEvent', function(self, event, ...) + if self[event] then + self[event](self, event, ...) + end +end) + +if IsLoggedIn() then LagBar:PLAYER_LOGIN() else LagBar:RegisterEvent('PLAYER_LOGIN') end + +function LagBar:PLAYER_LOGIN() + LagBar:Enable() + self:UnregisterEvent("PLAYER_LOGIN") + self.PLAYER_LOGIN = nil +end -LagBar = {}; LagBar.version = GetAddOnMetadata("LagBar", "Version") LagBar.PL_Lock = false @@ -112,7 +126,7 @@ function LagBar:DrawGUI() end) - lbFrame:SetScript("OnUpdate", function() + lbFrame:SetScript("OnUpdate", function(self, arg1) LagBar:OnUpdate(arg1); diff --git a/LagBar.toc b/LagBar.toc index 1ca876b..3e88474 100644 --- a/LagBar.toc +++ b/LagBar.toc @@ -1,7 +1,7 @@ -## Interface: 30300 +## Interface: 40000 ## Title: LagBar ## Author: Xruptor -## Version: 1.5 +## Version: 2.0 ## Notes: Displays a simple bar with some Latency Information. ## SavedVariables: LagBar_DB -LagBar.xml +LagBar.lua diff --git a/LagBar.xml b/LagBar.xml deleted file mode 100644 index 33903bd..0000000 --- a/LagBar.xml +++ /dev/null @@ -1,15 +0,0 @@ - -