From 2f7e2d9a03e2de6b568dfd314ce37d39f76aa52a Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Tue, 15 Jul 2014 15:52:12 -0500 Subject: [PATCH] making headway to a clean 4.1 --- Interface/AddOns/SVUI/SVUI.toc | 2 +- .../oUF_ArcaneCharge/oUF_ArcaneCharge.toc | 2 +- .../oUF_Plugins/oUF_Combatant/oUF_Combatant.lua | 130 ++++++++ .../oUF_Plugins/oUF_Combatant/oUF_Combatant.toc | 9 + .../oUF_DebuffHighlight/oUF_DebuffHighlight.lua | 182 ---------- .../oUF_DebuffHighlight/oUF_DebuffHighlight.toc | 14 - .../oUF_PVPSpecIcons/oUF_PVPSpecIcons.lua | 65 ---- .../oUF_PVPSpecIcons/oUF_PVPSpecIcons.toc | 9 - .../AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml | 5 +- .../libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.lua | 80 ----- .../libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.toc | 9 - Interface/AddOns/SVUI/packages/bag/SVBag.lua | 286 ++++++++-------- Interface/AddOns/SVUI/packages/chat/SVChat.lua | 5 +- Interface/AddOns/SVUI/packages/dock/SVDock.lua | 117 +++---- .../AddOns/SVUI/packages/laborer/SVLaborer.lua | 5 +- .../AddOns/SVUI/packages/plates/common/tracker.lua | 352 +++++++++----------- Interface/AddOns/SVUI/packages/unit/SVUnit.lua | 19 +- .../AddOns/SVUI/packages/unit/common/aurabars.lua | 4 +- .../AddOns/SVUI/packages/unit/common/misc.lua | 74 ++-- .../AddOns/SVUI/packages/unit/frames/units.lua | 157 +++++---- Interface/AddOns/SVUI/scripts/pvp.lua | 131 ++++++-- Interface/AddOns/SVUI/scripts/reactions.lua | 37 +- Interface/AddOns/SVUI/system/classes/Database.lua | 19 +- Interface/AddOns/SVUI/system/slash.lua | 6 + .../AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc | 2 +- Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua | 2 +- .../SVUI_ConfigOMatic/modules/units/other.lua | 132 +++++--- .../AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc | 2 +- 28 files changed, 902 insertions(+), 955 deletions(-) create mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.lua create mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.lua delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.toc delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.lua delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.toc delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.lua delete mode 100644 Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.toc diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index f404ada..982c942 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch -## Version: @project-version@ +## Version: 4.053 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global, SVUI_AuraFilters diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index ec226e2..5c17b0f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -1,7 +1,7 @@ ## Interface: 50001 ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. -## Author: SV +## Author: Munglunch ## Version: 1.0.0 ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.lua new file mode 100644 index 0000000..5ee2d62 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.lua @@ -0,0 +1,130 @@ +local _, ns = ... +local oUF = ns.oUF or oUF +assert(oUF, 'oUF not loaded') + +local trinketSpells = { + [59752] = 120, + [42292] = 120, + [7744] = 45, +} + +local GetPVPIcons = function(unit, frameID) + local _, trinket, badge + local unitFactionGroup = UnitFactionGroup(unit) + if unitFactionGroup == "Horde" then + trinket, badge = [[Interface\Icons\INV_Jewelry_TrinketPVP_02]], [[Interface\Icons\INV_BannerPVP_01]] + elseif unitFactionGroup == "Alliance" then + trinket, badge = [[Interface\Icons\INV_Jewelry_TrinketPVP_01]], [[Interface\Icons\INV_BannerPVP_02]] + else + trinket, badge = [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]], [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]] + end + if(frameID) then + local numOpps = GetNumArenaOpponentSpecs() + local specID = GetArenaOpponentSpec(frameID) + if((numOpps > 0) and specID) then + _, _, _, badge = GetSpecializationInfoByID(specID) + end + end + return trinket, badge +end + +local Update = function(self, event, unit, unitType) + if(not unit or unit ~= self.unit) then return end + local element = self.Combatant + local trinket = element.Trinket + local badge = element.Badge + local arenaMatch = IsActiveBattlefieldArena() + local frameID = arenaMatch and self:GetID() + local tIcon, bIcon = GetPVPIcons(unit, frameID) + if(badge) then badge.Icon:SetTexture(bIcon) end + if(trinket) then + if(not arenaMatch) then trinket:Hide() return end + trinket:Show() + if event == "ARENA_OPPONENT_UPDATE" then + if(unitType and unitType == "seen" and UnitExists(unit) and UnitIsPlayer(unit)) then + trinket.Icon:SetTexture(tIcon) + end + elseif event == 'PLAYER_ENTERING_WORLD' then + CooldownFrame_SetTimer(trinket.cooldownFrame, 1, 1, 1) + end + end +end + +local LogUpdate = function(self, event, ...) + local arenaMatch = IsActiveBattlefieldArena() + local element = self.Combatant + local trinket = element.Trinket + local alert = element.Alert + if not arenaMatch then trinket:Hide() return end + trinket:Show() + if(event == "COMBAT_LOG_EVENT_UNFILTERED") then + local _, eventType, _, sourceGUID, _, _, _, _, _, _, _, spellID = ... + if eventType == "SPELL_CAST_SUCCESS" and sourceGUID == UnitGUID(self.unit) and trinketSpells[spellID] then + CooldownFrame_SetTimer(trinket.cooldownFrame, GetTime(), trinketSpells[spellID], 1) + end + elseif(alert and event == "UNIT_SPELLCAST_SUCCEEDED") then + local unitID, spellName, _, _, spellID = ... + if UnitIsEnemy("player", unitID) and (spellID == 118358 or spellID == 104270 or spellName:find("Drink")) then + SendChatMessage(UnitName(unit)..L[" is drinking."], "RAID_WARNING") + end + end +end + +local Enable = function(self) + local element = self.Combatant + local trinket = element.Trinket + local badge = element.Badge + if(trinket or badge) then + self:RegisterEvent("ARENA_OPPONENT_UPDATE", Update, true) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Update, true) + + if(trinket) then + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", LogUpdate, true) + self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", LogUpdate, true) + if not trinket.cooldownFrame then + trinket.cooldownFrame = CreateFrame("Cooldown", nil, trinket) + trinket.cooldownFrame:SetAllPoints(trinket) + end + + if not trinket.Icon then + trinket.Icon = trinket:CreateTexture(nil, "BORDER") + trinket.Icon:SetAllPoints(trinket) + trinket.Icon:SetTexCoord(0.07, 0.93, 0.07, 0.93) + trinket.Icon:SetTexture(GetTrinketIcon('player')) + end + end + + if(badge) then + self:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update, true) + if not badge.Icon then + badge.Icon = badge:CreateTexture(nil, "OVERLAY") + badge.Icon:SetAllPoints(badge) + badge.Icon:SetTexCoord(0.07, 0.93, 0.07, 0.93) + end + badge:Show() + end + + return true + end +end + +local Disable = function(self) + local element = self.Combatant + local trinket = element.Trinket + local badge = element.Badge + if(trinket or badge) then + self:UnregisterEvent("ARENA_OPPONENT_UPDATE", Update) + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) + if trinket then + self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED", LogUpdate) + self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED", LogUpdate) + trinket:Hide() + end + if badge then + self:UnregisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update) + badge:Hide() + end + end +end + +oUF:AddElement('Combatant', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc new file mode 100644 index 0000000..a14926f --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc @@ -0,0 +1,9 @@ +## Interface: 50001 +## Title: oUF Combatant +## Notes: Adds PvP trinket status and spec icons to oUF frames. +## Author: Munglunch +## Version: 1.00 +## X-Category: oUF +## Dependencies: oUF + +oUF_Combatant.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.lua deleted file mode 100644 index 82b966e..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.lua +++ /dev/null @@ -1,182 +0,0 @@ -local _, ns = ... -local oUF = oUF or ns.oUF -if not oUF then return end - -local playerClass = select(2,UnitClass("player")) -local CanDispel = { - PRIEST = { Magic = true, Disease = true }, - SHAMAN = { Magic = false, Curse = true }, - PALADIN = { Magic = false, Poison = true, Disease = true }, - MAGE = { Curse = true }, - DRUID = { Magic = false, Curse = true, Poison = true, Disease = false }, - MONK = { Magic = false, Poison = true, Disease = true } -} - -local blackList = { - [GetSpellInfo(140546)] = true, --Fully Mutated - [GetSpellInfo(136184)] = true, --Thick Bones - [GetSpellInfo(136186)] = true, --Clear mind - [GetSpellInfo(136182)] = true, --Improved Synapses - [GetSpellInfo(136180)] = true, --Keen Eyesight -} - -local SymbiosisName = GetSpellInfo(110309) -local CleanseName = GetSpellInfo(4987) -local dispellist = CanDispel[playerClass] or {} -local origColors = {} -local origBorderColors = {} -local origPostUpdateAura = {} - -local function GetDebuffType(unit, filter) - if not unit or not UnitCanAssist("player", unit) then return nil end - local i = 1 - while true do - local name, _, texture, _, debufftype = UnitAura(unit, i, "HARMFUL") - if not texture then break end - if debufftype and (not filter or (filter and dispellist[debufftype])) and not blackList[name] then - return debufftype, texture - end - i = i + 1 - end -end - -local function CheckTalentTree(tree) - local activeGroup = GetActiveSpecGroup() - if activeGroup and GetSpecialization(false, false, activeGroup) then - return tree == GetSpecialization(false, false, activeGroup) - end -end - -local function CheckSpec(self, event, levels) - -- Not interested in gained points from leveling - if event == "CHARACTER_POINTS_CHANGED" and levels > 0 then return end - - --Check for certain talents to see if we can dispel magic or not - if playerClass == "PRIEST" then - if CheckTalentTree(3) then - dispellist.Disease = false - else - dispellist.Disease = true - end - elseif playerClass == "PALADIN" then - if CheckTalentTree(1) then - dispellist.Magic = true - else - dispellist.Magic = false - end - elseif playerClass == "SHAMAN" then - if CheckTalentTree(3) then - dispellist.Magic = true - else - dispellist.Magic = false - end - elseif playerClass == "DRUID" then - if CheckTalentTree(4) then - dispellist.Magic = true - else - dispellist.Magic = false - end - elseif playerClass == "MONK" then - if CheckTalentTree(2) then - dispellist.Magic = true - else - dispellist.Magic = false - end - end -end - -local function CheckSymbiosis() - if GetSpellInfo(SymbiosisName) == CleanseName then - dispellist.Disease = true - else - dispellist.Disease = false - end -end - -local function Update(object, event, unit) - if unit ~= object.unit then return; end - - local debuffType, texture = GetDebuffType(unit, object.DebuffHighlightFilter) - if debuffType then - local color = DebuffTypeColor[debuffType] - if object.DebuffHighlightBackdrop then - object:SetBackdropColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or 1) - elseif object.DebuffHighlightUseTexture then - object.DebuffHighlight:SetTexture(texture) - else - object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or .5) - end - else - if object.DebuffHighlightBackdrop then - local color = origColors[object] - object:SetBackdropColor(color.r, color.g, color.b, color.a) - color = origBorderColors[object] - object:SetBackdropBorderColor(color.r, color.g, color.b, color.a) - elseif object.DebuffHighlightUseTexture then - object.DebuffHighlight:SetTexture(nil) - else - local color = origColors[object] - object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a) - end - end -end - -local function Enable(object) - -- if we're not highlighting this unit return - if not object.DebuffHighlightBackdrop and not object.DebuffHighlight then - return - end - -- if we're filtering highlights and we're not of the dispelling type, return - if object.DebuffHighlightFilter and not CanDispel[playerClass] then - return - end - - -- make sure aura scanning is active for this object - object:RegisterEvent("UNIT_AURA", Update) - object:RegisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) - object:RegisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) - CheckSpec(object) - - object:RegisterUnitEvent("UNIT_AURA", object.unit) - if playerClass == "DRUID" then - object:RegisterEvent("SPELLS_CHANGED", CheckSymbiosis) - end - - if object.DebuffHighlightBackdrop then - local r, g, b, a = object:GetBackdropColor() - origColors[object] = { r = r, g = g, b = b, a = a} - r, g, b, a = object:GetBackdropBorderColor() - origBorderColors[object] = { r = r, g = g, b = b, a = a} - elseif not object.DebuffHighlightUseTexture then - local r, g, b, a = object.DebuffHighlight:GetVertexColor() - origColors[object] = { r = r, g = g, b = b, a = a} - end - - return true -end - -local function Disable(object) - object:UnregisterEvent("UNIT_AURA", Update) - object:UnregisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) - object:UnregisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) - - if playerClass == "DRUID" then - object:UnregisterEvent("SPELLS_CHANGED", CheckSymbiosis) - end - - if object.DebuffHighlightBackdrop then - local color = origColors[object] - if color then - object:SetBackdropColor(color.r, color.g, color.b, color.a) - color = origBorderColors[object] - object:SetBackdropBorderColor(color.r, color.g, color.b, color.a) - end - elseif not object.DebuffHighlightUseTexture then -- color debuffs - local color = origColors[object] - if color then - object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a) - end - end -end - -oUF:AddElement('DebuffHighlight', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.toc deleted file mode 100644 index 58222fc..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_DebuffHighlight/oUF_DebuffHighlight.toc +++ /dev/null @@ -1,14 +0,0 @@ -## Interface: 30100 -## Title: oUF Debuff Highlight -## Notes: Adds Debuff Highlighting to oUF. -## Author: Ammo -## Version: 1.0 -## X-Category: UnitFrame -## Dependencies: oUF -## X-Curse-Packaged-Version: r44-release -## X-Curse-Project-Name: oUF_DebuffHighlight -## X-Curse-Project-ID: o-uf_debuff-highlight -## X-Curse-Repository-ID: wow/o-uf_debuff-highlight/mainline - -oUF_DebuffHighlight.lua - diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.lua deleted file mode 100644 index 8fe7c43..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.lua +++ /dev/null @@ -1,65 +0,0 @@ -local _, ns = ... -local oUF = ns.oUF or oUF -assert(oUF, 'oUF not loaded') - - -local Update = function(self, event, unit) - if event == 'ARENA_OPPONENT_UPDATE' and unit ~= self.unit then return; end - local specIcon = self.PVPSpecIcon - - local _, instanceType = IsInInstance(); - specIcon.instanceType = instanceType - - if(specIcon.PreUpdate) then specIcon:PreUpdate(event) end - - if instanceType == 'arena' then - local numOpps = GetNumArenaOpponentSpecs() - local ID = self.unit:match('arena(%d)') or self:GetID() or 0 - local specID = GetArenaOpponentSpec(tonumber(ID)) - if specID and specID > 0 then - local _, _, _, icon = GetSpecializationInfoByID(specID); - specIcon.Icon:SetTexture(icon) - else - specIcon.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - end - else - local unitFactionGroup = UnitFactionGroup(self.unit) - if unitFactionGroup == "Horde" then - specIcon.Icon:SetTexture([[Interface\Icons\INV_BannerPVP_01]]) - elseif unitFactionGroup == 'Alliance' then - specIcon.Icon:SetTexture([[Interface\Icons\INV_BannerPVP_02]]) - else - specIcon.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - end - end - - if(specIcon.PostUpdate) then specIcon:PostUpdate(event) end -end - -local Enable = function(self) - local specIcon = self.PVPSpecIcon - if specIcon then - self:RegisterEvent("ARENA_OPPONENT_UPDATE", Update, true) - self:RegisterEvent("PLAYER_ENTERING_WORLD", Update, true) - - if not specIcon.Icon then - specIcon.Icon = specIcon:CreateTexture(nil, "OVERLAY") - specIcon.Icon:SetAllPoints(specIcon) - specIcon.Icon:SetTexCoord(0.07, 0.93, 0.07, 0.93) - end - specIcon:Show() - return true - end -end - -local Disable = function(self) - local specIcon = self.PVPSpecIcon - if specIcon then - self:UnregisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update) - self:UnregisterEvent("ARENA_OPPONENT_UPDATE", Update) - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) - specIcon:Hide() - end -end - -oUF:AddElement('PVPSpecIcon', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.toc deleted file mode 100644 index 2b80339..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_PVPSpecIcons/oUF_PVPSpecIcons.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 50001 -## Title: oUF Arena Spec Icons -## Notes: Adds spec icons to arena frames. -## Author: SV -## Version: 1.00 -## X-Category: oUF -## Dependencies: oUF - -oUF_PVPSpecIcons.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml index 339d617..5be7504 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml @@ -3,18 +3,17 @@