From c176d2d13e7818e448e97987c221d409bc5f06ed Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Thu, 28 Aug 2014 18:44:43 -0500 Subject: [PATCH] GPS improvement --- Interface/AddOns/SVUI/SVUI.lua | 31 ++++++++++++++++++++ .../SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua | 25 +++++++++------- Interface/AddOns/SVUI/system/system.lua | 31 -------------------- Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua | 1 + 4 files changed, 46 insertions(+), 42 deletions(-) diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 17249a6..fe2f6df 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -637,6 +637,37 @@ function SVUI:Prototype(n, v) return obj end +local function SendAddonMessage(msg, prefix) + if(type(msg) == "table") then + msg = tostring(msg) + end + + if(not msg) then return end + + if(prefix) then + local outbound = ("%s %s"):format(prefix, msg); + print(outbound) + else + print(msg) + end +end + +function SVUI:Debugger(msg) + if(not self.DebuggingMode) then return end + local outbound = ("|cffFF2F00%s:|r |cff992FFF%s:|r"):format("SVUI", "DEBUG") + SendAddonMessage(msg, outbound) +end + +function SVUI:AddonMessage(msg) + local outbound = ("|cffFF2F00%s:|r"):format("SVUI") + SendAddonMessage(msg, outbound) +end + +function SVUI:ToonMessage(msg) + local outbound = ("|cff00FF00%s:|r"):format(playerName) + SendAddonMessage(msg, outbound) +end + SVUICore[1] = SVUI SVUICore[2] = SVUI.Localization diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua index 32a46e5..b39f859 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua @@ -59,10 +59,16 @@ local Update = function(self, elapsed) if GPS.Arrow then if(distance > 40) then GPS.Arrow:SetVertexColor(1,0.1,0.1) - elseif(distance > 30) then - GPS.Arrow:SetVertexColor(0.4,0.8,0.1) else - GPS.Arrow:SetVertexColor(0.1,1,0.1) + if(distance > 30) then + GPS.Arrow:SetVertexColor(0.4,0.8,0.1) + else + GPS.Arrow:SetVertexColor(0.1,1,0.1) + end + if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then + local value = object.Health.percent + distance + _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} + end end spin(GPS.Arrow, angle) end @@ -71,11 +77,6 @@ local Update = function(self, elapsed) GPS.Text:SetText(floor(distance)) end - if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then - local value = object.Health.percent + distance - _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} - end - if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end numArrows = numArrows + 1 end @@ -86,9 +87,11 @@ local Update = function(self, elapsed) end end - tsort(_PROXIMITY, sortFunc) - if(_PROXIMITY[1] and _PROXIMITY[1][2]) then - _PROXIMITY[1][2]:Show() + if(_PROXIMITY[1]) then + tsort(_PROXIMITY, sortFunc) + if(_PROXIMITY[1][2]) then + _PROXIMITY[1][2]:Show() + end end self.elapsed = 0 diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index e4204e9..038daa5 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -161,37 +161,6 @@ end SYSTEM FUNCTIONS ########################################################## ]]-- -local function SendAddonMessage(msg, prefix) - if(type(msg) == "table") then - msg = tostring(msg) - end - - if(not msg) then return end - - if(prefix) then - local outbound = ("%s %s"):format(prefix, msg); - print(outbound) - else - print(msg) - end -end - -function SuperVillain:Debugger(msg) - if(not self.DebuggingMode) then return end - local outbound = ("|cffFF2F00%s:|r |cff992FFF%s:|r"):format("SVUI", "DEBUG") - SendAddonMessage(msg, outbound) -end - -function SuperVillain:AddonMessage(msg) - local outbound = ("|cffFF2F00%s:|r"):format("SVUI") - SendAddonMessage(msg, outbound) -end - -function SuperVillain:ToonMessage(msg) - local outbound = ("|cff00FF00%s:|r"):format(playerName) - SendAddonMessage(msg, outbound) -end - function SuperVillain:StaticPopup_Show(arg) if arg == "ADDON_ACTION_FORBIDDEN" then StaticPopup_Hide(arg) diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index f519e1f..268059e 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -351,6 +351,7 @@ function PLUGIN:UpdateCommunicator() self.DockButton.icon:SetTexture(ICON_FILE) self.DockButton.Scanner:Hide() self.Scanning = false + self:SwitchToBG() end end elseif(self.InPVP) then -- 1.7.9.5