diff --git a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua index 4a2c430..780e31c 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -40,15 +40,17 @@ CALL TO ARMS STATS ]]-- local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; -local PlayerEvents = {SWING_DAMAGE = true, RANGE_DAMAGE = true, SPELL_DAMAGE = true, SPELL_PERIODIC_DAMAGE = true, DAMAGE_SHIELD = true, DAMAGE_SPLIT = true, SPELL_EXTRA_ATTACKS = true} -local playerID, petID +local PlayerEvents = {["SWING_DAMAGE"] = true, ["RANGE_DAMAGE"] = true, ["SPELL_DAMAGE"] = true, ["SPELL_PERIODIC_DAMAGE"] = true, ["DAMAGE_SHIELD"] = true, ["DAMAGE_SPLIT"] = true, ["SPELL_EXTRA_ATTACKS"] = true} +local playerID = UnitGUID('player') +local petID local DMGTotal, lastDMGAmount = 0, 0 local combatTime = 0 local timeStamp = 0 local lastSegment = 0 local lastPanel local hexColor = "FFFFFF" -local displayString = "%s: |cff%s%.1f|r"; +local displayString = "|cff%s%.1f|r"; +local dpsString = "%s |cff00CCFF%s|r"; local function Reset() timeStamp = 0 @@ -58,13 +60,16 @@ local function Reset() end local function GetDPS(self) - local DPS if DMGTotal == 0 or combatTime == 0 then - DPS = "0.0" + self.text:SetText(dpsString:format(L["DPS"], "..PAUSED")) + self.TText = "No Damage Done" + self.TText2 = "Go smack something so \nthat I can do the maths!" else - DPS = (DMGTotal) / (combatTime) + local DPS = (DMGTotal) / (combatTime) + self.text:SetFormattedText(displayString, hexColor, DPS) + self.TText = "DPS:" + self.TText2 = DPS end - self.text:SetFormattedText(displayString, L["DPS"], hexColor, DPS) end local function DPS_OnClick(self) @@ -75,12 +80,15 @@ end local function DPS_OnEnter(self) MOD:Tip(self) MOD.tooltip:AddDoubleLine("Damage Total:", DMGTotal, 1, 1, 1) - MOD:ShowTip() + MOD.tooltip:AddLine(" ", 1, 1, 1) + MOD.tooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) + MOD.tooltip:AddLine(" ", 1, 1, 1) + MOD.tooltip:AddDoubleLine("[Click]", "Clear DPS", 0,1,0, 0.5,1,0.5) + MOD:ShowTip(true) end local function DPS_OnEvent(self, event, ...) lastPanel = self - if event == "PLAYER_ENTERING_WORLD" then playerID = UnitGUID('player') elseif event == 'PLAYER_REGEN_DISABLED' or event == "PLAYER_LEAVE_COMBAT" then @@ -90,15 +98,13 @@ local function DPS_OnEvent(self, event, ...) end lastSegment = now elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then - if not PlayerEvents[select(2, ...)] then return end - local id = select(4, ...) - if id == playerID or id == petID then - if timeStamp == 0 then timeStamp = select(1, ...) end + local newTime, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, lastDMGAmount, spellName = ... + if not PlayerEvents[event] then return end + if(srcGUID == playerID or srcGUID == petID) then + if timeStamp == 0 then timeStamp = newTime end lastSegment = timeStamp - combatTime = select(1, ...) - timeStamp - if select(2, ...) == "SWING_DAMAGE" then - lastDMGAmount = select(12, ...) - else + combatTime = newTime - timeStamp + if event ~= "SWING_DAMAGE" then lastDMGAmount = select(15, ...) end DMGTotal = DMGTotal + lastDMGAmount diff --git a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua index b119cc5..46ba6d0 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -23,27 +23,10 @@ LOCALIZED LUA FUNCTIONS local _G = _G; local unpack = _G.unpack; local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; local string = _G.string; -local math = _G.math; -local table = _G.table; --[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; +local max = math.max; --[[ ########################################################## GET ADDON DATA @@ -58,15 +41,17 @@ CALL TO ARMS STATS ]]-- local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; -local PlayerEvents = {SPELL_HEAL = true, SPELL_PERIODIC_HEAL = true} -local playerID, petID -local healTotal, lastHealAmount = 0, 0 +local PlayerEvents = {["SPELL_HEAL"] = true, ["SPELL_PERIODIC_HEAL"] = true} +local playerID = UnitGUID('player') +local petID +local healTotal, totalHeal, totalOverHeal, lastHealAmount = 0, 0, 0, 0 local combatTime = 0 local timeStamp = 0 local lastSegment = 0 local lastPanel local hexColor = "FFFFFF"; -local displayString = "%s: |cff%s%.1f|r"; +local displayString = "|cff%s%.1f|r"; +local dpsString = "%s |cff00CCFF%s|r"; local join = string.join local max = math.max @@ -75,17 +60,22 @@ local function Reset() timeStamp = 0 combatTime = 0 healTotal = 0 + totalHeal = 0 + totalOverHeal = 0 lastHealAmount = 0 -end +end local function GetHPS(self) - local HPS if healTotal == 0 or combatTime == 0 then - HPS = "0.0" + self.text:SetText(dpsString:format(L["HPS"], "..PAUSED")) + self.TText = "No Healing Done" + self.TText2 = "Surely there is someone \nwith an ouchie somewhere!" else - HPS = (healTotal) / (combatTime) + local HPS = (healTotal) / (combatTime) + self.text:SetFormattedText(displayString, hexColor, HPS) + self.TText = "HPS:" + self.TText2 = HPS end - self.text:SetFormattedText(displayString, L["HPS"], hexColor, HPS) end local function HPS_OnClick(self) @@ -95,8 +85,13 @@ end local function HPS_OnEnter(self) MOD:Tip(self) - MOD.tooltip:AddDoubleLine("Damage Total:", healTotal, 1, 1, 1) - MOD:ShowTip() + MOD.tooltip:AddDoubleLine("Healing Total:", totalHeal, 1, 1, 1) + MOD.tooltip:AddDoubleLine("OverHealing Total:", totalOverHeal, 1, 1, 1) + MOD.tooltip:AddLine(" ", 1, 1, 1) + MOD.tooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) + MOD.tooltip:AddLine(" ", 1, 1, 1) + MOD.tooltip:AddDoubleLine("[Click]", "Clear HPS", 0,1,0, 0.5,1,0.5) + MOD:ShowTip(true) end local function HPS_OnEvent(self, event, ...) @@ -111,15 +106,15 @@ local function HPS_OnEvent(self, event, ...) end lastSegment = now elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then - if not PlayerEvents[select(2, ...)] then return end - local id = select(4, ...) - if id == playerID or id == petID then - if timeStamp == 0 then timeStamp = select(1, ...) end - local overHeal = select(16, ...) + local newTime, event, _, srcGUID, _, _, _, _, _, _, _, _, _, test, lastHealAmount, overHeal = ... + if not PlayerEvents[event] then return end + if(srcGUID == playerID or srcGUID == petID) then + if timeStamp == 0 then timeStamp = newTime end lastSegment = timeStamp - combatTime = select(1, ...) - timeStamp - lastHealAmount = select(15, ...) - healTotal = healTotal + max(0, lastHealAmount - overHeal) + combatTime = newTime - timeStamp + healTotal = healTotal + (lastHealAmount - overHeal) + totalHeal = totalHeal + lastHealAmount + totalOverHeal = totalOverHeal + overHeal end elseif event == UNIT_PET then petID = UnitGUID("pet") diff --git a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua index b0a2241..74f3209 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua @@ -51,7 +51,7 @@ local standingName = { [6] = "Honored", [7] = "Revered", [8] = "Exalted" -}; +} local function TruncateString(value) if value >= 1e9 then @@ -93,9 +93,8 @@ local function Reputation_OnEvent(self, ...) local isFriend, friendText local name, reaction, min, max, value = GetWatchedFactionInfo() local numFactions = GetNumFactions(); - local txt = "" if not name then - name = "No watched factions" + self.text:SetText("No watched factions") else for i=1, numFactions do local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(i); @@ -109,9 +108,8 @@ local function Reputation_OnEvent(self, ...) end end end - txt = format("%s: %s - %d%% [%s]", name, TruncateString(value - min), ((value - min) / (max - min) * 100), isFriend and friendText or _G["FACTION_STANDING_LABEL"..ID]) + self.text:SetFormattedText("|cff22EF5F%s|r|cff888888 - [|r%d%%|cff888888]|r", isFriend and friendText or _G["FACTION_STANDING_LABEL"..ID], ((value - min) / (max - min) * 100)) end; - self.text:SetText(txt) end; local function ReputationBar_OnEvent(self, ...) @@ -162,7 +160,9 @@ local function Reputation_OnEnter(self) MOD.tooltip:AddDoubleLine(STANDING..':', friendID and friendTextLevel or _G['FACTION_STANDING_LABEL'..reaction], 1, 1, 1) MOD.tooltip:AddDoubleLine(REPUTATION..':', format('%d / %d (%d%%)', value - min, max - min, (value - min) / (max - min) * 100), 1, 1, 1) end; - MOD:ShowTip() + MOD.tooltip:AddLine(" ", 1, 1, 1) + MOD.tooltip:AddDoubleLine("[Click]", "Change Watched Faction", 0,1,0, 0.5,1,0.5) + MOD:ShowTip(true) end; local function Reputation_OnClick(self, button) diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 39cbbc1..705da63 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -949,7 +949,7 @@ local ArenaPrepHandler = CreateFrame("Frame") local ArenaPrepHandler_OnEvent = function(self, event) local prepframe local _, instanceType = IsInInstance() - if(not MOD.db.arena.enable or instanceType ~= "arena") then return end + if(not SuperVillain.db.SVUnit.arena.enable or instanceType ~= "arena") then return end if event == "PLAYER_LOGIN" then for i = 1, 5 do prepframe = _G["SVUI_Arena"..i.."PrepFrame"] diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua index de34b44..d1a75cf 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua @@ -83,6 +83,8 @@ local function Widget_PaginationStyle(...) STYLE:ApplyPaginationStyle(...) end +local NOOP = SuperVillain.fubar + local function StyleAceGUI(event, addon) assert((LibStub("AceGUI-3.0") and (addon == "SVUI_ConfigOMatic")), "Addon Not Loaded") local AceGUI = LibStub("AceGUI-3.0") @@ -117,7 +119,7 @@ local function StyleAceGUI(event, addon) end Widget_ButtonStyle(widget.button) Widget_ScrollStyle(widget.scrollBar) - widget.scrollBar:SetPoint("RIGHT", e, "RIGHT", 0-4) + widget.scrollBar:SetPoint("RIGHT", e, "RIGHT", -4) widget.scrollBG:SetPoint("TOPRIGHT", widget.scrollBar, "TOPLEFT", -2, 19) widget.scrollBG:SetPoint("BOTTOMLEFT", widget.button, "TOPLEFT") widget.scrollFrame:SetPoint("BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8) @@ -291,29 +293,13 @@ local function StyleAceGUI(event, addon) o.toggle:Formula409() o.toggle.SetNormalTexture = NOOP; o.toggle.SetPushedTexture = NOOP; + o.toggle:SetButtonTemplate() o.toggleText = o.toggle:CreateFontString(nil, "OVERLAY") - o.toggleText:SetFontTemplate(nil, 19) + o.toggleText:SetFont([[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]], 19) o.toggleText:SetPoint("CENTER") - o.toggleText:SetText("+") + o.toggleText:SetText("*") return o end - local C = widget.RefreshTree; - widget.RefreshTree = function(self, D) - C(self, D) - if not self.tree then return end - local E = self.status or self.localstatus; - local F = E.groups; - local G = self.lines; - local H = self.buttons; - for z, I in pairs(G)do - local o = H[z] - if F[I.uniquevalue]and o then - o.toggleText:SetText("-") - elseif o then - o.toggleText:SetText("+") - end - end - end end if n == "TabGroup" then local createTab = widget.CreateTab;