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 @@ <Script file="oUF_AuraBars\oUF_AuraBars.lua"/> <Script file="oUF_RaidDebuffs\oUF_RaidDebuffs.lua"/> <Script file="oUF_Smooth\oUF_Smooth.lua"/> - <Script file="oUF_Trinkets\oUF_Trinkets.lua"/> + <Script file="oUF_Combatant\oUF_Combatant.lua"/> <Script file="oUF_DruidMana\oUF_DruidMana.lua"/> <Script file="oUF_CombatFader\oUF_CombatFader.lua"/> <Script file='oUF_Experience\oUF_Experience.lua'/> <Script file='oUF_Reputation\oUF_Reputation.lua'/> <Script file='oUF_Friendship\oUF_Friendship.lua'/> <Script file="oUF_ArcaneCharge\oUF_ArcaneCharge.lua"/> - <Script file='oUF_PVPSpecIcons\oUF_PVPSpecIcons.lua'/> <Script file='oUF_GPS\oUF_GPS.lua'/> <Script file='oUF_ActionPanel\oUF_ActionPanel.lua'/> <Script file='oUF_Afflicted\oUF_Afflicted.lua'/> - <Script file='oUF_MainTank\oUF_MainTank.lua'/> + <!-- <Script file='oUF_MainTank\oUF_MainTank.lua'/> --> <Script file='oUF_PallyPower\oUF_PallyPower.lua'/> <Script file='oUF_WarlockShards\oUF_WarlockShards.lua'/> <Script file='oUF_PriestOrbs\oUF_PriestOrbs.lua'/> diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.lua deleted file mode 100644 index 36dd8ca..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.lua +++ /dev/null @@ -1,80 +0,0 @@ -local _, ns = ... -local oUF = ns.oUF or oUF -assert(oUF, 'oUF not loaded') - -local trinketSpells = { - [59752] = 120, - [42292] = 120, - [7744] = 45, -} - -local GetTrinketIcon = function(unit) - if UnitFactionGroup(unit) == "Horde" then - return "Interface\\Icons\\INV_Jewelry_TrinketPVP_02" - else - return "Interface\\Icons\\INV_Jewelry_TrinketPVP_01" - end -end - -local Update = function(self, event, ...) - local _, instanceType = IsInInstance(); - if instanceType ~= 'arena' then - self.Trinket:Hide(); - return; - else - self.Trinket:Show(); - end - - if(self.Trinket.PreUpdate) then self.Trinket:PreUpdate(event) end - - 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(self.Trinket.cooldownFrame, GetTime(), trinketSpells[spellID], 1) - end - elseif event == "ARENA_OPPONENT_UPDATE" then - local unit, type = ... - if type == "seen" then - if UnitExists(unit) and UnitIsPlayer(unit) then - self.Trinket.Icon:SetTexture(GetTrinketIcon(unit)) - end - end - elseif event == 'PLAYER_ENTERING_WORLD' then - CooldownFrame_SetTimer(self.Trinket.cooldownFrame, 1, 1, 1) - end - - if(self.Trinket.PostUpdate) then self.Trinket:PostUpdate(event) end -end - -local Enable = function(self) - if self.Trinket then - self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update, true) - self:RegisterEvent("ARENA_OPPONENT_UPDATE", Update, true) - self:RegisterEvent("PLAYER_ENTERING_WORLD", Update, true) - - if not self.Trinket.cooldownFrame then - self.Trinket.cooldownFrame = CreateFrame("Cooldown", nil, self.Trinket) - self.Trinket.cooldownFrame:SetAllPoints(self.Trinket) - end - - if not self.Trinket.Icon then - self.Trinket.Icon = self.Trinket:CreateTexture(nil, "BORDER") - self.Trinket.Icon:SetAllPoints(self.Trinket) - self.Trinket.Icon:SetTexCoord(0.07, 0.93, 0.07, 0.93) - self.Trinket.Icon:SetTexture(GetTrinketIcon('player')) - end - - return true - end -end - -local Disable = function(self) - if self.Trinket then - self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update) - self:UnregisterEvent("ARENA_OPPONENT_UPDATE", Update) - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) - self.Trinket:Hide() - end -end - -oUF:AddElement('Trinket', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.toc deleted file mode 100644 index f7b925c..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Trinkets/oUF_Trinkets.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 50001 -## Title: oUF Trinkets -## Notes: Adds PvP trinket status to oUF frames. -## Author: SV -## Version: 1.00 -## X-Category: oUF -## Dependencies: oUF - -oUF_Trinkets.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 395c48b..ccda7cd 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -78,7 +78,7 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function StyleBagToolButton(button) - if button.styled then return end; + if button.styled then return end local outer = button:CreateTexture(nil, "OVERLAY") outer:WrapOuter(button, 6, 6) @@ -88,7 +88,7 @@ local function StyleBagToolButton(button) if button.SetNormalTexture then iconTex = button:GetNormalTexture() iconTex:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - end; + end local icon = button:CreateTexture(nil, "OVERLAY") icon:WrapOuter(button, 6, 6) @@ -106,7 +106,7 @@ local function StyleBagToolButton(button) pushed:SetTexture(borderTex) pushed:SetGradient(unpack(SuperVillain.Media.gradient.highlight)) button:SetPushedTexture(pushed) - end; + end if button.SetCheckedTexture then local checked = button:CreateTexture(nil, "BORDER") @@ -114,7 +114,7 @@ local function StyleBagToolButton(button) checked:SetTexture(borderTex) checked:SetGradient(unpack(SuperVillain.Media.gradient.green)) button:SetCheckedTexture(checked) - end; + end if button.SetDisabledTexture then local disabled = button:CreateTexture(nil, "BORDER") @@ -122,15 +122,15 @@ local function StyleBagToolButton(button) disabled:SetTexture(borderTex) disabled:SetGradient(unpack(SuperVillain.Media.gradient.default)) button:SetDisabledTexture(disabled) - end; + end local cd = button:GetName() and _G[button:GetName().."Cooldown"] if cd then cd:ClearAllPoints() cd:FillInner() - end; + end button.styled = true -end; +end local function encodeSub(i, j, k) local l = j; @@ -144,11 +144,11 @@ local function encodeSub(i, j, k) l = l + 2; else l = l + 1; - end; + end k = k-1; - end; + end return i:sub(j, (l-1)) -end; +end local function formatAndSave(level, font, saveTo) if level == 1 then @@ -160,12 +160,12 @@ local function formatAndSave(level, font, saveTo) else font:SetText() end -end; +end local function BuildEquipmentMap() for t, u in pairs(gearList)do twipe(u); - end; + end local set, player, bank, bags, index, bag, loc, _; for i = 1, GetNumEquipmentSets() do set = GetEquipmentSetInfo(i); @@ -181,7 +181,7 @@ local function BuildEquipmentMap() end end end -end; +end --[[ ########################################################## CORE FUNCTIONS @@ -198,16 +198,16 @@ function MOD:GetContainerFrame(e) end end end - end; + end return MOD.BagFrame -end; +end function MOD:DisableBlizzard() BankFrame:UnregisterAllEvents() for h = 1, NUM_CONTAINER_FRAMES do _G["ContainerFrame"..h]:MUNG() end -end; +end function MOD:INVENTORY_SEARCH_UPDATE() for _, bag in pairs(self.BagFrames)do @@ -227,10 +227,10 @@ function MOD:INVENTORY_SEARCH_UPDATE() end end end -end; +end function MOD:RefreshSlot(bag, slotID) - if self.Bags[bag] and self.Bags[bag].numSlots ~= GetContainerNumSlots(bag) or not self.Bags[bag] or not self.Bags[bag][slotID] then return end; + if self.Bags[bag] and self.Bags[bag].numSlots ~= GetContainerNumSlots(bag) or not self.Bags[bag] or not self.Bags[bag][slotID] then return end local slot, _ = self.Bags[bag][slotID], nil; local bagType = self.Bags[bag].bagFamily; local texture, count, locked = GetContainerItemInfo(bag, slotID) @@ -245,7 +245,7 @@ function MOD:RefreshSlot(bag, slotID) SetItemButtonTextureVertexColor(slot, 0.4, 0.4, 0.4) else SetItemButtonTextureVertexColor(slot, 1, 1, 1) - end; + end if bagType then local r, g, b = bagType[1], bagType[2], bagType[3]; slot:SetBackdropColor(r, g, b, 0.5) @@ -268,19 +268,19 @@ function MOD:RefreshSlot(bag, slotID) end else slot:SetBackdropBorderColor(0, 0, 0) - end; + end if C_NewItems.IsNewItem(bag, slotID)then ActionButton_ShowOverlayGlow(slot) else ActionButton_HideOverlayGlow(slot) - end; + end SetItemButtonTexture(slot, texture) SetItemButtonCount(slot, count) SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) -end; +end function MOD:RefreshBagSlots(bag) - if(not bag) then return end; + if(not bag) then return end for i = 1, GetContainerNumSlots(bag)do if self.RefreshSlot then self:RefreshSlot(bag, i) @@ -288,7 +288,7 @@ function MOD:RefreshBagSlots(bag) self:GetParent():RefreshSlot(bag, i) end end -end; +end function MOD:RefreshCD() for _, bag in ipairs(self.BagIDs)do @@ -304,7 +304,7 @@ function MOD:RefreshCD() end end end -end; +end function MOD:RefreshBagsSlots() for _, bag in ipairs(self.BagIDs)do @@ -312,7 +312,7 @@ function MOD:RefreshBagsSlots() self.Bags[bag]:RefreshBagSlots(bag) end end -end; +end function MOD:UseSlotFading(this) for _, id in ipairs(this.BagIDs)do @@ -329,7 +329,7 @@ function MOD:UseSlotFading(this) end end end -end; +end function MOD:FlushSlotFading(this) for _, id in ipairs(this.BagIDs)do @@ -342,12 +342,12 @@ function MOD:FlushSlotFading(this) end end end -end; +end function MOD:Layout(isBank) - if SuperVillain.db.SVBag.enable ~= true then return; end; + if SuperVillain.db.SVBag.enable ~= true then return; end local f = MOD:GetContainerFrame(isBank); - if not f then return; end; + if not f then return; end local buttonSize = isBank and MOD.db.bankSize or MOD.db.bagSize; local buttonSpacing = 8; local containerWidth = (MOD.db.alignToChat == true and (isBank and (SuperVillain.db.SVDock.dockLeftWidth - 14) or (SuperVillain.db.SVDock.dockRightWidth - 14))) or (isBank and MOD.db.bankWidth) or MOD.db.bagWidth @@ -404,7 +404,7 @@ function MOD:Layout(isBank) f.ContainerHolder[i]:SetPoint("LEFT", lastContainerButton, "RIGHT", buttonSpacing, 0) end lastContainerButton = f.ContainerHolder[i]; - end; + end local numSlots = GetContainerNumSlots(bagID); if numSlots > 0 then if not f.Bags[bagID] then @@ -492,26 +492,26 @@ function MOD:Layout(isBank) end end f:Size(containerWidth, (((buttonSize + buttonSpacing) * numContainerRows) - buttonSpacing) + f.topOffset + f.bottomOffset); -end; +end function MOD:RefreshBags() if MOD.BagFrame then MOD:Layout(false) - end; + end if MOD.BankFrame then MOD:Layout(true) end -end; +end function MOD:UpdateGoldText() MOD.BagFrame.goldText:SetText(GetCoinTextureString(GetMoney(), 12)) -end; +end function MOD:VendorGrays(arg1, arg2, arg3) if(not MerchantFrame or not MerchantFrame:IsShown()) and not arg1 and not arg3 then SuperVillain:AddonMessage(L["You must be at a vendor."]) return - end; + end local copper = 0; local deleted = 0; for i = 0, 4 do @@ -524,7 +524,7 @@ function MOD:VendorGrays(arg1, arg2, arg3) if not arg3 then PickupContainerItem(i, silver) DeleteCursorItem() - end; + end copper = copper + a3; deleted = deleted + 1 end @@ -533,14 +533,14 @@ function MOD:VendorGrays(arg1, arg2, arg3) if not arg3 then UseContainerItem(i, silver) PickupMerchantItem() - end; + end copper = copper + a3 end end end end - end; - if arg3 then return copper end; + end + if arg3 then return copper end if copper > 0 and not arg1 then local gold, silver, copper = floor(copper / 10000) or 0, floor(copper%10000 / 100) or 0, copper%100; SuperVillain:AddonMessage(L["Vendored gray items for:"].." |cffffffff"..gold..L.goldabbrev.." |cffffffff"..silver ..L.silverabbrev.." |cffffffff"..copper ..L.copperabbrev..".") @@ -552,27 +552,27 @@ function MOD:VendorGrays(arg1, arg2, arg3) elseif not arg2 then SuperVillain:AddonMessage(L["No gray items to delete."]) end -end; +end function MOD:ModifyBags() if self.BagFrame then self.BagFrame:ClearAllPoints() self.BagFrame:Point("BOTTOMRIGHT", RightSuperDock, "BOTTOMRIGHT", 0-MOD.db.xOffset, 0 + MOD.db.yOffset) - end; + end if self.BankFrame then self.BankFrame:ClearAllPoints() self.BankFrame:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 0 + MOD.db.xOffset, 0 + MOD.db.yOffset) end -end; +end do local function Bags_OnEnter() - if MOD.db.bagBar.mouseover ~= true then return end; + if MOD.db.bagBar.mouseover ~= true then return end UIFrameFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() - if MOD.db.bagBar.mouseover ~= true then return end; + if MOD.db.bagBar.mouseover ~= true then return end UIFrameFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) end @@ -588,7 +588,7 @@ do end local function LoadBagBar() - if MOD.BagBarLoaded then return end; + if MOD.BagBarLoaded then return end local bar = NewFrame("Frame", "SVUI_BagBar", SuperVillain.UIParent) bar:SetPoint("TOPRIGHT", RightSuperDock, "TOPLEFT", -4, 0) bar.buttons = {} @@ -617,26 +617,26 @@ do AlterBagBar(bagSlot) count = count + 1 bar.buttons[count] = bagSlot - end; + end SuperVillain:SetSVMovable(bar, "Bags_MOVE", L["Bags"]) MOD.BagBarLoaded = true end function MOD:ModifyBagBar() - if not SuperVillain.db.SVBag.bagBar.enable then return end; + if not SuperVillain.db.SVBag.bagBar.enable then return end if not MOD.BagBarLoaded then LoadBagBar() - end; + end if MOD.db.bagBar.mouseover then SVUI_BagBar:SetAlpha(0) else SVUI_BagBar:SetAlpha(1) - end; + end if MOD.db.bagBar.showBackdrop then SVUI_BagBar.Panel:Show() else SVUI_BagBar.Panel:Hide() - end; + end for i = 1, #SVUI_BagBar.buttons do local button = SVUI_BagBar.buttons[i] local lastButton = SVUI_BagBar.buttons[i - 1] @@ -667,7 +667,7 @@ do button:SetPoint("BOTTOM", lastButton, "TOP", 0, MOD.db.bagBar.spacing) end end - end; + end if MOD.db.bagBar.showBy == "HORIZONTAL" then SVUI_BagBar:Width(MOD.db.bagBar.size * numBagFrame + MOD.db.bagBar.spacing * numBagFrame + MOD.db.bagBar.spacing) SVUI_BagBar:Height(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) @@ -676,7 +676,7 @@ do SVUI_BagBar:Width(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) end end -end; +end function MOD:RepositionBags() local a9, xOffset, yOffset, aa, ab, ac, ad; @@ -685,7 +685,7 @@ function MOD:RepositionBags() local ag = 0; if BankFrame:IsShown()then ag = BankFrame:GetRight()-25 - end; + end while af>CONTAINER_SCALE do aa = GetScreenHeight() / af; xOffset = CONTAINER_OFFSET_X / af; @@ -700,18 +700,18 @@ function MOD:RepositionBags() ad = ad + 1; ac = ae-ad * CONTAINER_WIDTH * af-xOffset; ab = aa-yOffset - end; + end ab = ab-ah-VISIBLE_CONTAINER_SPACING - end; + end if ac<ag then af = af-0.01 else break end - end; + end if af<CONTAINER_SCALE then af = CONTAINER_SCALE - end; + end aa = GetScreenHeight() / af; xOffset = CONTAINER_OFFSET_X / af; yOffset = CONTAINER_OFFSET_Y / af; @@ -731,15 +731,15 @@ function MOD:RepositionBags() a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-ak-1], "BOTTOMLEFT", -CONTAINER_SPACING, 0) else a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-ak], "BOTTOMLEFT", -CONTAINER_SPACING, 0) - end; + end ak = 0 else a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-1], "TOPRIGHT", 0, CONTAINER_SPACING) ak = ak + 1 - end; + end ab = ab-a9:GetHeight()-VISIBLE_CONTAINER_SPACING end -end; +end --[[ ########################################################## BAG CONTAINER CREATION @@ -754,7 +754,7 @@ do slot.equipmentinfo:SetWordWrap(true) slot.equipmentinfo:SetJustifyH('LEFT') slot.equipmentinfo:SetJustifyV('BOTTOM') - end; + end if slot.equipmentinfo then slot.equipmentinfo:SetAllPoints(slot) local loc = format("%d_%d", bag, index) @@ -766,13 +766,13 @@ do formatAndSave(level, slot.equipmentinfo, nil) end end - end; + end local Search_OnKeyPressed = function(self) self:GetParent().detail:Show() self:ClearFocus() SetItemSearch('') - end; + end local Search_OnInput = function(self) local i = 3; @@ -784,14 +784,14 @@ do k=false; break end - end; + end if k then Search_OnKeyPressed(self) return end - end; + end SetItemSearch(j) - end; + end local Search_OnClick = function(self, button) local container = self:GetParent() @@ -813,7 +813,7 @@ do container.editBox:HighlightText() end end - end; + end local Container_OnEvent = function(self, event, ...) if(event == "ITEM_LOCK_CHANGED" or event == "ITEM_UNLOCKED") then @@ -833,14 +833,14 @@ do end end end - end; + end self:RefreshBagSlots(...) elseif(event == "BAG_UPDATE_COOLDOWN") then self:RefreshCD() elseif(event == "PLAYERBANKSLOTS_CHANGED") then self:RefreshBagsSlots() end - end; + end local Vendor_OnClick = function(self) if IsShiftKeyDown()then @@ -849,22 +849,22 @@ do else MOD:VendorGrays() end - end; + end local Token_OnEnter = function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT") GameTooltip:SetBackpackToken(self:GetID()) - end; + end local Token_OnLeave = function(self) GameTooltip:Hide() - end; + end local Token_OnClick = function(self) if IsModifiedClick("CHATLINK") then HandleModifiedItemClick(GetCurrencyLink(self.currencyID)) end - end; + end local Tooltip_Show = function(self) GameTooltip:SetOwner(self:GetParent(),"ANCHOR_TOP",0,4) @@ -873,32 +873,32 @@ do if self.ttText2 then GameTooltip:AddLine(' ') GameTooltip:AddDoubleLine(self.ttText2,self.ttText2desc,1,1,1) - end; + end self:GetNormalTexture():SetGradient(unpack(SuperVillain.Media.gradient.highlight)) GameTooltip:Show() - end; + end local Tooltip_Hide = function(self) self:GetNormalTexture():SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) GameTooltip:Hide() - end; + end local Container_OnDragStart = function(self) if IsShiftKeyDown()then self:StartMoving()end - end; + end local Container_OnDragStop = function(self) self:StopMovingOrSizing() - end; + end local Container_OnClick = function(self) if IsControlKeyDown()then MOD:ModifyBags()end - end; + end local Container_OnEnter = function(self) GameTooltip:SetOwner(self,"ANCHOR_TOPLEFT",0,4) GameTooltip:ClearLines() GameTooltip:AddDoubleLine(L['Hold Shift + Drag:'],L['Temporary Move'],1,1,1) GameTooltip:AddDoubleLine(L['Hold Control + Right Click:'],L['Reset Position'],1,1,1) GameTooltip:Show() - end; + end function MOD:ToggleEquipmentOverlay() local numSlots, container; @@ -1172,63 +1172,63 @@ do frame.currencyButton[h]:SetScript('OnLeave', Token_OnLeave) frame.currencyButton[h]:SetScript('OnClick', Token_OnClick) frame.currencyButton[h]:Hide() - end; + end frame:SetScript('OnHide',CloseAllBags) UISpecialFrames[uisCount] = "SVUI_ContainerFrame"; - end; + end self.BagFrames[bagsCount] = frame return frame - end; -end; - -do - local function RefreshTKN() - local frame = MOD.BagFrame; - local index = 0; - for i=1,MAX_WATCHED_TOKENS do - local name,count,icon,currencyID = GetBackpackCurrencyInfo(i) - local set = frame.currencyButton[i] - set:ClearAllPoints() - if name then - set.icon:SetTexture(icon) - if MOD.db.currencyFormat == 'ICON_TEXT' then - set.text:SetText(name..': '..count) - elseif MOD.db.currencyFormat == 'ICON' then - set.text:SetText(count) - end; - set.currencyID = currencyID; - set:Show() - index = index + 1; - else - set:Hide() + end +end + +function MOD:RefreshTokens() + local frame = MOD.BagFrame; + local index = 0; + for i=1,MAX_WATCHED_TOKENS do + local name,count,icon,currencyID = GetBackpackCurrencyInfo(i) + local set = frame.currencyButton[i] + set:ClearAllPoints() + if name then + set.icon:SetTexture(icon) + if MOD.db.currencyFormat == 'ICON_TEXT' then + set.text:SetText(name..': '..count) + elseif MOD.db.currencyFormat == 'ICON' then + set.text:SetText(count) end - end; - if index == 0 then - frame.bottomOffset = 8; - if frame.currencyButton:IsShown() then - frame.currencyButton:Hide() - MOD:Layout(false) - end; - return - elseif not frame.currencyButton:IsShown() then - frame.bottomOffset = 28; - frame.currencyButton:Show() - MOD:Layout(false) - end; - frame.bottomOffset = 28; - local set = frame.currencyButton; - if index == 1 then - set[1]:Point("BOTTOM", set, "BOTTOM", -(set[1].text:GetWidth() / 2), 3) - elseif index == 2 then - set[1]:Point("BOTTOM", set, "BOTTOM", -set[1].text:GetWidth()-set[1]:GetWidth() / 2, 3) - frame.currencyButton[2]:Point("BOTTOMLEFT", set, "BOTTOM", set[2]:GetWidth() / 2, 3) + set.currencyID = currencyID; + set:Show() + index = index + 1; else - set[1]:Point("BOTTOMLEFT", set, "BOTTOMLEFT", 3, 3) - set[2]:Point("BOTTOM", set, "BOTTOM", -(set[2].text:GetWidth() / 3), 3) - set[3]:Point("BOTTOMRIGHT", set, "BOTTOMRIGHT", -set[3].text:GetWidth()-set[3]:GetWidth() / 2, 3) + set:Hide() end - end; + end + if index == 0 then + frame.bottomOffset = 8; + if frame.currencyButton:IsShown() then + frame.currencyButton:Hide() + MOD:Layout(false) + end + return + elseif not frame.currencyButton:IsShown() then + frame.bottomOffset = 28; + frame.currencyButton:Show() + MOD:Layout(false) + end + frame.bottomOffset = 28; + local set = frame.currencyButton; + if index == 1 then + set[1]:Point("BOTTOM", set, "BOTTOM", -(set[1].text:GetWidth() / 2), 3) + elseif index == 2 then + set[1]:Point("BOTTOM", set, "BOTTOM", -set[1].text:GetWidth()-set[1]:GetWidth() / 2, 3) + frame.currencyButton[2]:Point("BOTTOMLEFT", set, "BOTTOM", set[2]:GetWidth() / 2, 3) + else + set[1]:Point("BOTTOMLEFT", set, "BOTTOMLEFT", 3, 3) + set[2]:Point("BOTTOM", set, "BOTTOM", -(set[2].text:GetWidth() / 3), 3) + set[3]:Point("BOTTOMRIGHT", set, "BOTTOMRIGHT", -set[3].text:GetWidth()-set[3]:GetWidth() / 2, 3) + end +end +do local function OpenBags() GameTooltip:Hide() MOD.BagFrame:Show() @@ -1241,7 +1241,7 @@ do MOD.BagFrame:Hide() if(MOD.BankFrame) then MOD.BankFrame:Hide() - end; + end if(BreakStuffHandler and BreakStuffButton and BreakStuffButton.icon) then BreakStuffHandler:MODIFIER_STATE_CHANGED() BreakStuffHandler.ReadyToSmash = false @@ -1252,7 +1252,7 @@ do end local function ToggleBags(id) - if id and GetContainerNumSlots(id)==0 then return end; + if id and GetContainerNumSlots(id)==0 then return end if MOD.BagFrame:IsShown()then CloseBags() else @@ -1261,7 +1261,7 @@ do end local function ToggleBackpack() - if IsOptionFrameOpen()then return end; + if IsOptionFrameOpen()then return end if IsBagOpen(0) then OpenBags() else @@ -1273,17 +1273,17 @@ do if not MOD.BankFrame then MOD.BankFrame = MOD:MakeBags('SVUI_BankContainerFrame',true) MOD:ModifyBags() - end; + end MOD:Layout(true) MOD.BankFrame:Show() MOD.BankFrame:RefreshBagsSlots() MOD.BagFrame:Show() MOD.BagFrame:RefreshBagsSlots() - RefreshTKN() + MOD.RefreshTokens() end local function CloseBank() - if not MOD.BankFrame then return end; + if not MOD.BankFrame then return end MOD.BankFrame:Hide() end @@ -1293,20 +1293,20 @@ do NewHook("ToggleBag", ToggleBags) NewHook("ToggleAllBags", ToggleBackpack) NewHook("ToggleBackpack", ToggleBackpack) - NewHook("BackpackTokenFrame_Update", RefreshTKN) + NewHook("BackpackTokenFrame_Update", MOD.RefreshTokens) MOD:RegisterEvent("BANKFRAME_OPENED", OpenBank) MOD:RegisterEvent("BANKFRAME_CLOSED", CloseBank) end -end; +end function MOD:PLAYERBANKBAGSLOTS_CHANGED() MOD:Layout(true) -end; +end function MOD:PLAYER_ENTERING_WORLD() self:UpdateGoldText() self.BagFrame:RefreshBagsSlots() -end; +end --[[ ########################################################## BUILD FUNCTION / UPDATE @@ -1317,10 +1317,10 @@ function MOD:ReLoad() self:Layout(true); self:ModifyBags(); self:ModifyBagBar(); -end; +end function MOD:Load() - if not SuperVillain.db.SVBag.enable then return end; + if not SuperVillain.db.SVBag.enable then return end self:ModifyBagBar() SuperVillain.bags = self; self.BagFrames = {} @@ -1339,6 +1339,6 @@ function MOD:Load() self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() -end; +end SuperVillain.Registry:NewPackage(MOD, "SVBag"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 2e6b37a..42b00c7 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -44,7 +44,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; -local DOCK = SuperVillain.Registry:Expose('SVDock'); --[[ ########################################################## LOCAL VARS @@ -395,7 +394,7 @@ do LeftSuperDock.editboxforced = true; LeftSuperDockToggleButton:GetScript("OnEnter")(LeftSuperDockToggleButton) end - DOCK:DockAlertLeftOpen(self) + SuperDockAlertLeft:Activate(self) end local EditBox_OnEditFocusLost = function(self) @@ -406,7 +405,7 @@ do end end; self:Hide() - DOCK:DockAlertLeftClose() + SuperDockAlertLeft:Dectivate() end local EditBox_OnTextChanged = function(self) diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index f718f9b..9171877 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -27,42 +27,18 @@ local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatc PRE VARS/FUNCTIONS ########################################################## ]]-- -local function SetSuperDockStyle(dock) - if dock.backdrop then return end - local backdrop = CreateFrame("Frame", nil, dock) - backdrop:SetAllPoints(dock) - backdrop:SetFrameStrata("BACKGROUND") - backdrop.bg = backdrop:CreateTexture(nil, "BORDER") - backdrop.bg:FillInner(backdrop) - backdrop.bg:SetTexture(1, 1, 1, 1) - backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) - backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.left:SetTexture(1, 1, 1, 1) - backdrop.left:Point("TOPLEFT", 1, -1) - backdrop.left:Point("BOTTOMLEFT", -1, 1) - backdrop.left:Width(4) - backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.right:SetTexture(1, 1, 1, 1) - backdrop.right:Point("TOPRIGHT", -1, -1) - backdrop.right:Point("BOTTOMRIGHT", -1, 1) - backdrop.right:Width(4) - backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.bottom:SetTexture(0, 0, 0, 1) - backdrop.bottom:Point("BOTTOMLEFT", 1, 1) - backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) - backdrop.bottom:Height(4) - backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:SetTexture(0, 0, 0, 0) - backdrop.top:Point("TOPLEFT", 1, -1) - backdrop.top:Point("TOPRIGHT", -1, 1) - backdrop.top:SetAlpha(0) - backdrop.top:Height(1) - return backdrop +local AlertActivate = function(self, child) + local size = MOD.db.buttonSize or 22; + self:Height(size) + child:ClearAllPoints() + child:SetAllPoints(self) +end + +local AlertDeactivate = function(self) + self:Height(1) end -local function Dock_OnEnter(self, ...) +local Dock_OnEnter = function(self, ...) if InCombatLockdown() then return end self:SetPanelColor("highlight") if MOD.SuperDockFaded then @@ -77,7 +53,7 @@ local function Dock_OnEnter(self, ...) GameTooltip:Show() end -local function Dock_OnLeave(self, ...) +local Dock_OnLeave = function(self, ...) if InCombatLockdown() then return end self:SetPanelColor("special") if MOD.SuperDockFaded then @@ -87,7 +63,7 @@ local function Dock_OnLeave(self, ...) GameTooltip:Hide() end -local function Dock_OnClick(self) +local Dock_OnClick = function(self) GameTooltip:Hide() if MOD.SuperDockFaded then MOD.SuperDockFaded = nil; @@ -101,7 +77,7 @@ local function Dock_OnClick(self) SVUI_Cache["Dock"].SuperDockFaded = MOD.SuperDockFaded end -local function Button_OnEnter(self, ...) +local Button_OnEnter = function(self, ...) self:SetPanelColor("highlight") self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) @@ -110,11 +86,46 @@ local function Button_OnEnter(self, ...) GameTooltip:Show() end -local function Button_OnLeave(self, ...) +local Button_OnLeave = function(self, ...) self:SetPanelColor("special") self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) GameTooltip:Hide() end + +local function SetSuperDockStyle(dock) + if dock.backdrop then return end + local backdrop = CreateFrame("Frame", nil, dock) + backdrop:SetAllPoints(dock) + backdrop:SetFrameStrata("BACKGROUND") + backdrop.bg = backdrop:CreateTexture(nil, "BORDER") + backdrop.bg:FillInner(backdrop) + backdrop.bg:SetTexture(1, 1, 1, 1) + backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) + backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.left:SetTexture(1, 1, 1, 1) + backdrop.left:Point("TOPLEFT", 1, -1) + backdrop.left:Point("BOTTOMLEFT", -1, 1) + backdrop.left:Width(4) + backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.right:SetTexture(1, 1, 1, 1) + backdrop.right:Point("TOPRIGHT", -1, -1) + backdrop.right:Point("BOTTOMRIGHT", -1, 1) + backdrop.right:Width(4) + backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.bottom:SetTexture(0, 0, 0, 1) + backdrop.bottom:Point("BOTTOMLEFT", 1, 1) + backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) + backdrop.bottom:Height(4) + backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.top:SetTexture(0, 0, 0, 0) + backdrop.top:Point("TOPLEFT", 1, -1) + backdrop.top:Point("TOPRIGHT", -1, 1) + backdrop.top:SetAlpha(0) + backdrop.top:Height(1) + return backdrop +end --[[ ########################################################## CORE FUNCTIONS @@ -131,29 +142,7 @@ function MOD:UpdateSuperDock() MOD:TopPanelVisibility(); MOD:UpdateDockBackdrops(); MOD:ReloadDocklets() -end - -function MOD:DockAlertLeftOpen(child) - local size = MOD.db.buttonSize or 22; - SuperDockAlertLeft:Height(size) - child:ClearAllPoints() - child:SetAllPoints(SuperDockAlertLeft) -end - -function MOD:DockAlertLeftClose() - SuperDockAlertLeft:Height(1) -end - -function MOD:DockAlertRightOpen(child) - local size = MOD.db.buttonSize or 22; - SuperDockAlertRight:Height(size) - child:ClearAllPoints() - child:SetAllPoints(SuperDockAlertRight) -end - -function MOD:DockAlertRightClose() - SuperDockAlertRight:Height(1) -end +end function MOD:UpdateDockBackdrops() if MOD.db.rightDockBackdrop then @@ -226,7 +215,7 @@ function MOD:CreateSuperBorders() self:SetFrameStrata('BACKGROUND') end) MOD:BottomPanelVisibility() -end +end function MOD:CreateDockPanels() MOD.SuperDockFaded = SVUI_Cache["Dock"].SuperDockFaded @@ -278,6 +267,8 @@ function MOD:CreateDockPanels() leftalert:Size(leftWidth, 1) leftalert:Point("BOTTOMRIGHT", leftdock, "BOTTOMRIGHT",0, 0) leftalert:SetFrameLevel(leftalert:GetFrameLevel() + 2) + leftalert.Activate = AlertActivate + leftalert.Deactivate = AlertDeactivate local leftwindow = CreateFrame("Frame", "SuperDockWindowLeft", leftdock) leftwindow:SetFrameStrata("BACKGROUND") @@ -324,6 +315,8 @@ function MOD:CreateDockPanels() rightalert:Size(rightWidth, 1) rightalert:Point("BOTTOMLEFT", rightdock, "BOTTOMLEFT", 0, 0) rightalert:SetFrameLevel(rightalert:GetFrameLevel() + 2) + rightalert.Activate = AlertActivate + rightalert.Deactivate = AlertDeactivate local rightwindow = CreateFrame("Frame", "SuperDockWindowRight", rightdock) rightwindow:SetFrameStrata("BACKGROUND") diff --git a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua index 6fc0695..7c3e851 100644 --- a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua +++ b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua @@ -34,7 +34,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; -local DOCK = SuperVillain.Registry:Expose('SVDock'); SuperVillain.Modes = MOD; --[[ ########################################################## @@ -349,7 +348,7 @@ local ModeAlert_OnLeave = function(self) end local ModeAlert_OnHide = function() - DOCK:DockAlertRightClose() + SuperDockAlertRight:Dectivate() end local ModeAlert_OnShow = function(self) @@ -359,7 +358,7 @@ local ModeAlert_OnShow = function(self) return; end UIFrameFadeIn(self, 0.3, 0, 1) - DOCK:DockAlertRightOpen(self) + SuperDockAlertRight:Activate(self) end local _hide_me = function() ModeAlert:Hide() end diff --git a/Interface/AddOns/SVUI/packages/plates/common/tracker.lua b/Interface/AddOns/SVUI/packages/plates/common/tracker.lua index 979a141..d074924 100644 --- a/Interface/AddOns/SVUI/packages/plates/common/tracker.lua +++ b/Interface/AddOns/SVUI/packages/plates/common/tracker.lua @@ -4,11 +4,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# ############################################################################## S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## @@ -54,134 +54,122 @@ local MOD = SuperVillain.Registry:Expose('SVPlate'); LOCALS AND TRACKER FRAME ########################################################## ]]-- -local NextUpdate = 0; +local NextUpdate = 0 + local SpellIDTest = { - [47540]=true,[88625]=true,[88684]=true,[88685]=true, - [89485]=true,[10060]=true,[33206]=true,[62618]=true, - [724]=true,[14751]=true,[34861]=true,[47788]=true, - [18562]=true,[17116]=true,[48438]=true,[33891]=true, - [974]=true,[17116]=true,[16190]=true,[61295]=true, - [20473]=true,[31842]=true,[53563]=true,[31821]=true, - [85222]=true,[115175]=true,[115294]=true,[115310]=true, - [116670]=true,[116680]=true,[116849]=true,[116995]=true, - [119611]=true,[132120]=true -}; -local SpellEventTest = { - ["SPELL_HEAL"] = true, - ["SPELL_AURA_APPLIED"] = true, - ["SPELL_CAST_START"] = true, - ["SPELL_CAST_SUCCESS"] = true, - ["SPELL_PERIODIC_HEAL"] = true, -}; + [47540] = true, [88625] = true, [88684] = true, [88685] = true, + [89485] = true, [10060] = true, [33206] = true, [62618] = true, + [724] = true, [14751] = true, [34861] = true, [47788] = true, + [18562] = true, [17116] = true, [48438] = true, [33891] = true, + [974] = true, [17116] = true, [16190] = true, [61295] = true, + [20473] = true, [31842] = true, [53563] = true, [31821] = true, + [85222] = true, [115175] = true, [115294] = true, [115310] = true, + [116670] = true, [116680] = true, [116849] = true, [116995] = true, + [119611] = true, [132120] = true +} -local HealSpecs = { - [L['Restoration']] = true, - [L['Holy']] = true, - [L['Discipline']] = true, - [L['Mistweaver']] = true -}; +local HealerDetection = { + ["SPELL_HEAL"] = true, + ["SPELL_AURA_APPLIED"] = true, + ["SPELL_CAST_START"] = true, + ["SPELL_CAST_SUCCESS"] = true, + ["SPELL_PERIODIC_HEAL"] = true, + ["Restoration"] = true, + ["Holy"] = true, + ["Discipline"] = true, + ["Mistweaver"] = true +} -local TrackingManager = CreateFrame("Frame"); -local CPoints = {}; -local TrackedPlatesCP = {}; -local LastKnownTarget = false; -local LastKnownPoints = 0; -local Healers = {}; -local Events = {}; +local TrackingManager = CreateFrame("Frame") +local CPoints = {} +local TrackedPlatesCP = {} +local LastKnownTarget = false +local LastKnownPoints = 0 +local Healers = {} +local Events = {} --[[ ########################################################## PARSE FUNCTIONS ########################################################## ]]-- local function TrackViaScores() - local curTime = GetTime() - if curTime > NextUpdate then NextUpdate = curTime + 3; else return; end - local ready = false - local scores = GetNumBattlefieldScores() - if(scores > 0) then - for i = 1, scores do - local name, _, _, _, _, faction, _, class, _, _, _, _, _, _, _, talentSpec = GetBattlefieldScore(i) - - if name and talentSpec then - if(HealSpecs[talentSpec]) then - Healers[name] = true - ready = true - elseif(Healers[name]) then - Healers[name] = nil - end - end - end - if(ready) then - MOD:RequestScanUpdate(false, false, name, "UpdateHealerIcon") - end - end + local curTime = GetTime() + if curTime > NextUpdate then + NextUpdate = curTime + 3 + else + return + end + local scores = GetNumBattlefieldScores() + if(scores > 0) then + local filter + for i = 1, scores do + local name, _, _, _, _, faction, _, class, _, _, _, _, _, _, _, talentSpec = GetBattlefieldScore(i) + if name and talentSpec then + filter = HealerDetection[talentSpec] + Healers[name] = filter + end + end + if(filter) then + MOD:RequestScanUpdate(false, false, name, "UpdateHealerIcon") + end + end end local function PlateIsHealer(name) - if name then - if Healers[name] then - return true - else - RequestBattlefieldScoreData() - end - end + if name then + if Healers[name] then + return true + else + RequestBattlefieldScoreData() + end + end end local function PlateIsEnemy(flags) - if (band(flags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == 0) and (band(flags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0) then - return true - end + if (band(flags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == 0) and (band(flags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0) then + return true + end end -local function ParseArenaHealers() - local numOps = GetNumArenaOpponentSpecs() - if not (numOps > 1) then return end - for i=1, 5 do - local name = UnitName(format('arena%d', i)) - if name and name ~= UNKNOWN then - local s = GetArenaOpponentSpec(i) - local _, talentSpec = nil, UNKNOWN - if s and s > 0 then - _, talentSpec = GetSpecializationInfoByID(s) - end - if talentSpec and HealSpecs[talentSpec] then - Healers[name] = true - end - end - end +local function DetectHealer(event, id) + if (HealerDetection[event] and SpellIDTest[id]) then + return true + else + return false + end end local function ClearTracking() - CPoints = twipe(CPoints) - Healers = twipe(Healers) + twipe(CPoints) + twipe(Healers) end local function ClearExpiredPoints() - local saved - for plate,_ in pairs(TrackedPlatesCP) do - if(plate.guid ~= LastKnownTarget) then - for i=1, MAX_COMBO_POINTS do - plate.frame.combo[i]:Hide() - end - else - saved = plate - end - end - CPoints = {} - TrackedPlatesCP = {} + local saved + for plate,_ in pairs(TrackedPlatesCP) do + if(plate.guid ~= LastKnownTarget) then + for i=1, MAX_COMBO_POINTS do + plate.frame.combo[i]:Hide() + end + else + saved = plate + end + end + CPoints = {} + TrackedPlatesCP = {} - if(saved) then - TrackedPlatesCP[saved] = true - end + if(saved) then + TrackedPlatesCP[saved] = true + end - if(LastKnownTarget) then - CPoints[LastKnownTarget] = LastKnownPoints; - end + if(LastKnownTarget) then + CPoints[LastKnownTarget] = LastKnownPoints; + end end local function TrackingEventHandler(self, event, ...) - local handler = Events[event] - if handler then handler(...) end + local handler = Events[event] + if handler then handler(...) end end --[[ ########################################################## @@ -189,57 +177,35 @@ EVENTS ########################################################## ]]-- function Events.UNIT_COMBO_POINTS(unit) - MOD:UpdateComboPointsByUnitID(unit) + MOD:UpdateComboPointsByUnitID(unit) end - function Events.PLAYER_ENTERING_WORLD() - ClearTracking() - local inInstance, instanceType = IsInInstance() - if inInstance and instanceType == 'arena' then - TrackingManager:RegisterEvent("UNIT_NAME_UPDATE") - TrackingManager:RegisterEvent("ARENA_OPPONENT_UPDATE"); - ParseArenaHealers() - else - TrackingManager:UnregisterEvent("UNIT_NAME_UPDATE") - TrackingManager:UnregisterEvent("ARENA_OPPONENT_UPDATE") - end - return -end - -function Events.UNIT_NAME_UPDATE() - ParseArenaHealers() - return + ClearTracking() + return end function Events.PLAYER_TARGET_CHANGED() - ClearExpiredPoints() - return -end - -function Events.ARENA_OPPONENT_UPDATE() - ParseArenaHealers() - return + ClearExpiredPoints() + return end function Events.UPDATE_BATTLEFIELD_SCORE() - TrackViaScores() - return + TrackViaScores() + return end function Events.COMBAT_LOG_EVENT_UNFILTERED(...) - local timestamp, combatevent, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlag, spellid = ... - if PlateIsEnemy(sourceFlags) and sourceGUID and sourceName then - if SpellEventTest[combatevent] then - if SpellIDTest[spellid] then - local rawName = split("-", sourceName) - if not Healers[rawName] then - Healers[rawName] = true - MOD:RequestScanUpdate(destGUID, false, false, "UpdateHealerIcon") - end - end - end - end + local timestamp, combatevent, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlag, spellid = ... + if PlateIsEnemy(sourceFlags) and sourceGUID and sourceName then + if DetectHealer(combatevent, spellid) then + local rawName = split("-", sourceName) + if not Healers[rawName] then + Healers[rawName] = true + MOD:RequestScanUpdate(destGUID, false, false, "UpdateHealerIcon") + end + end + end end --[[ ########################################################## @@ -247,65 +213,65 @@ MODULE FUNCTIONS ########################################################## ]]-- function MOD:EnableTracking() - TrackingManager:SetScript("OnEvent", TrackingEventHandler) - TrackingManager:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - TrackingManager:RegisterEvent("PLAYER_ENTERING_WORLD") - TrackingManager:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - if (MOD.UseCombo) then - TrackingManager:RegisterEvent("UNIT_COMBO_POINTS") - TrackingManager:RegisterEvent("PLAYER_TARGET_CHANGED") - end - ClearTracking() + TrackingManager:SetScript("OnEvent", TrackingEventHandler) + TrackingManager:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + TrackingManager:RegisterEvent("PLAYER_ENTERING_WORLD") + TrackingManager:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + if (MOD.UseCombo) then + TrackingManager:RegisterEvent("UNIT_COMBO_POINTS") + TrackingManager:RegisterEvent("PLAYER_TARGET_CHANGED") + end + ClearTracking() end function MOD:DisableTracking() - TrackingManager:SetScript("OnEvent", nil) - TrackingManager:UnregisterAllEvents() - ClearTracking() + TrackingManager:UnregisterAllEvents() + TrackingManager:SetScript("OnEvent", nil) + ClearTracking() end function MOD:UpdateHealerIcon(plate) - local rawName = plate.ref.nametext - if rawName then - local healerIcon = plate.frame.health.icon - if PlateIsHealer(rawName) then - healerIcon:Show() - else - healerIcon:Hide() - end - end + local rawName = plate.ref.nametext + if rawName then + local healerIcon = plate.frame.health.icon + if PlateIsHealer(rawName) then + healerIcon:Show() + else + healerIcon:Hide() + end + end end function MOD:UpdateComboPoints(plate) - local frame = plate.frame - local numPoints = CPoints[plate.guid] or 0 - if(numPoints == 0) then - TrackedPlatesCP[plate] = nil - else - TrackedPlatesCP[plate] = true - end - for i=1, MAX_COMBO_POINTS do - if(i <= numPoints) then - frame.combo[i]:Show() - else - frame.combo[i]:Hide() - end - end + local frame = plate.frame + local numPoints = CPoints[plate.guid] or 0 + if(numPoints == 0) then + TrackedPlatesCP[plate] = nil + else + TrackedPlatesCP[plate] = true + end + for i=1, MAX_COMBO_POINTS do + if(i <= numPoints) then + frame.combo[i]:Show() + else + frame.combo[i]:Hide() + end + end end function MOD:UpdateComboPointsByUnitID(unit) - if(unit == "player" or unit == "vehicle") then - local guid = UnitGUID("target") - if (not guid) then return end - local numPoints = GetComboPoints(UnitHasVehicleUI('player') and 'vehicle' or 'player', 'target') - if(numPoints > 0) then - if(LastKnownTarget ~= guid) then - CPoints[LastKnownTarget] = nil - end - end - LastKnownTarget = guid - LastKnownPoints = numPoints - CPoints[guid] = numPoints - MOD:RequestScanUpdate(guid, false, false, "UpdateComboPoints") - end + if(unit == "player" or unit == "vehicle") then + local guid = UnitGUID("target") + if (not guid) then return end + local numPoints = GetComboPoints(UnitHasVehicleUI('player') and 'vehicle' or 'player', 'target') + if(numPoints > 0) then + if(LastKnownTarget ~= guid) then + CPoints[LastKnownTarget] = nil + end + end + LastKnownTarget = guid + LastKnownPoints = numPoints + CPoints[guid] = numPoints + MOD:RequestScanUpdate(guid, false, false, "UpdateComboPoints") + end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index c018339..dcdfde5 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -111,13 +111,13 @@ end local function FindAnchorFrame(frame, anchor, badPoint) if badPoint or anchor == 'FRAME' then - return frame - elseif(anchor == 'TRINKET') then - if select(2,IsInInstance())=="arena" then - return frame.Trinket - else - return frame.PVPSpecIcon - end + if(frame.Combatant and frame.Combatant:IsShown()) then + return frame.Combatant + else + return frame + end + elseif(anchor == 'TRINKET' and frame.Combatant and frame.Combatant:IsShown()) then + return frame.Combatant elseif(anchor == 'BUFFS' and frame.Buffs and frame.Buffs:IsShown()) then return frame.Buffs elseif(anchor == 'DEBUFFS' and frame.Debuffs and frame.Debuffs:IsShown()) then @@ -445,9 +445,6 @@ function MOD:RefreshUnitLayout(frame, template) overlayAnimation = self.db.overlayAnimation end end - if(frame.PVPSpecIcon and db.pvpSpecIcon) then - portraitWidth = portraitWidth - UNIT_HEIGHT - end if frame.Portrait then frame.Portrait:Hide() @@ -1100,11 +1097,13 @@ function MOD:ADDON_LOADED(event, addon) end function MOD:PLAYER_ENTERING_WORLD() + print("Refreshing") self:RefreshUnitFrames() if SuperVillain.class == 'WARLOCK' and not self.QualifiedShards then self:QualifyWarlockShards() self.QualifiedShards = true end + collectgarbage("collect") end local UnitFrameThreatIndicator_Hook = function(unit, unitFrame) diff --git a/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua b/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua index 3192a9c..9e8a965 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua @@ -88,7 +88,8 @@ do end CustomBarFilter = function(self, unit, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) - local db = MOD.db[self.db] + local key = self.___key + local db = MOD.db[key] if((not db) or (db and not db.aurabar) or (spellID == 65148)) then return false; end @@ -155,7 +156,6 @@ UTILITY ]]-- function MOD:CreateAuraBarHeader(frame, unitName) local auraBarParent = CreateFrame("Frame", nil, frame) - auraBarParent.db = unitName auraBarParent.parent = frame; auraBarParent.PostCreateBar = PostCreateAuraBars; auraBarParent.gap = 1; diff --git a/Interface/AddOns/SVUI/packages/unit/common/misc.lua b/Interface/AddOns/SVUI/packages/unit/common/misc.lua index a47f453..8ef58b1 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/misc.lua @@ -25,16 +25,33 @@ assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); LOCAL VARIABLES ########################################################## ]]-- -local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]]; -local AURA_FONTSIZE = 10; -local AURA_OUTLINE = "OUTLINE"; +local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]] +local AURA_FONTSIZE = 10 +local AURA_OUTLINE = "OUTLINE" local LML_ICON_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-LML]] local ROLE_ICON_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-ROLES]] local ROLE_ICON_DATA = { ["TANK"] = {0,0.5,0,0.5, 0.5,0.75,0.5,0.75}, ["HEALER"] = {0,0.5,0.5,1, 0.5,0.75,0.75,1}, ["DAMAGER"] = {0.5,1,0,0.5, 0.75,1,0.5,0.75} -}; +} +local function BasicBG(frame) + frame:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 2, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0 + } + }) + frame:SetBackdropColor(0, 0, 0, 0) + frame:SetBackdropBorderColor(0, 0, 0) +end --[[ ########################################################## RAID DEBUFFS / DEBUFF HIGHLIGHT @@ -67,8 +84,8 @@ function MOD:CreateAfflicted(frame) afflicted:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\UNIT-AFFLICTED") afflicted:SetVertexColor(0, 0, 0, 0) afflicted:SetBlendMode("ADD") - frame.AfflictedFilter = true; - frame.AfflictedAlpha = 0.75; + frame.AfflictedFilter = true + frame.AfflictedAlpha = 0.75 return afflicted end @@ -92,25 +109,38 @@ function MOD:CreateReadyCheckIcon(frame) return rdy end -function MOD:CreateTrinket(frame) - local trinket = CreateFrame("Frame", nil, frame) - trinket:SetFrameLevel(trinket:GetFrameLevel() + 1) - trinket.bg = CreateFrame("Frame", nil, trinket) - trinket.bg:SetFixedPanelTemplate("Default") - trinket.bg:SetFrameLevel(trinket:GetFrameLevel() - 1) - trinket:FillInner(trinket.bg) - return trinket -end - -function MOD:CreatePVPSpecIcon(frame) +function MOD:CreateCombatant(frame) local pvp = CreateFrame("Frame", nil, frame) pvp:SetFrameLevel(pvp:GetFrameLevel() + 1) - pvp.bg = CreateFrame("Frame", nil, pvp) - pvp.bg:SetFixedPanelTemplate("Default") - pvp.bg:SetFrameLevel(pvp:GetFrameLevel() - 1) - pvp:FillInner(pvp.bg) + + local trinket = CreateFrame("Frame", nil, pvp) + BasicBG(trinket) + trinket.Icon = trinket:CreateTexture(nil, "OVERLAY") + trinket.Icon:FillInner(trinket, 2, 2) + + pvp.Trinket = trinket + + local badge = CreateFrame("Frame", nil, pvp) + BasicBG(badge) + badge.Icon = badge:CreateTexture(nil, "OVERLAY") + badge.Icon:FillInner(badge, 2, 2) + + pvp.Badge = badge + return pvp -end +end + +function MOD:CreateFriendshipBar(frame) + local buddy = CreateFrame("StatusBar", nil, frame) + buddy:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 2, 2) + buddy:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", -2, 2) + buddy:SetHeight(8) + buddy:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) + buddy:SetStatusBarColor(1,0,0) + buddy:SetPanelTemplate("Bar", true, 2, 2, 2) + + return buddy +end --[[ ########################################################## CONFIGURABLE ICONS diff --git a/Interface/AddOns/SVUI/packages/unit/frames/units.lua b/Interface/AddOns/SVUI/packages/unit/frames/units.lua index 4472850..84bd769 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames/units.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames/units.lua @@ -290,7 +290,10 @@ local UpdateTargetFrame = function(self) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) if not self:IsElementEnabled("ActionPanel")then self:EnableElement("ActionPanel") - end + end + if not self:IsElementEnabled("Friendship")then + self:EnableElement("Friendship") + end MOD:RefreshUnitLayout(self, "target") if(MOD.db.xrayFocus) then @@ -379,6 +382,7 @@ CONSTRUCTORS["target"] = function(self, unit) end self.GPS = MOD:CreateGPS(self) + self.Friendship = MOD:CreateFriendshipBar(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self.XRay = MOD:CreateXRay(self) self.XRay:SetPoint("TOPRIGHT", 12, 12) @@ -717,6 +721,49 @@ end ARENA ########################################################## ]]-- +local function CreatePrepFrame(frameName, parentFrame, parentID) + local prep = CreateFrame("Frame", prepName, UIParent) + prep:SetFrameStrata("MEDIUM") + prep:SetAllPoints(parentFrame) + prep:SetID(parentID) + prep:SetPanelTemplate("Bar", true, 3, 3, 3) + + local health = CreateFrame("StatusBar", nil, prep) + health:SetAllPoints(prep) + health:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) + prep.Health = health + + local icon = CreateFrame("Frame", nil, prep) + icon:SetSize(45,45) + icon:SetPoint("LEFT", prep, "RIGHT", 2, 0) + icon:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 2, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0 + } + }) + icon:SetBackdropColor(0, 0, 0, 0) + icon:SetBackdropBorderColor(0, 0, 0) + icon.Icon = icon:CreateTexture(nil, "OVERLAY") + icon.Icon:FillInner(icon, 2, 2) + prep.SpecIcon = icon + + local text = prep.Health:CreateFontString(nil, "OVERLAY") + text:SetFont(SuperVillain.Media.font.names, 12, "OUTLINE") + text:SetTextColor(1, 1, 1) + text:SetPoint("CENTER") + prep.SpecClass = text + + prep:Hide() +end + local UpdateArenaFrame = function(self) local db = MOD.db["arena"] local INDEX = self:GetID() or 1; @@ -729,37 +776,9 @@ local UpdateArenaFrame = function(self) self.colors = oUF_SuperVillain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - do - local trinket = self.Trinket; - trinket.bg:Size(db.pvpTrinket.size) - trinket.bg:ClearAllPoints() - if(db.pvpTrinket.position == "RIGHT") then - trinket.bg:Point("LEFT", self, "RIGHT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) - else - trinket.bg:Point("RIGHT", self, "LEFT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) - end - if db.pvpTrinket.enable and not self:IsElementEnabled("Trinket")then - self:EnableElement("Trinket") - elseif not db.pvpTrinket.enable and self:IsElementEnabled("Trinket")then - self:DisableElement("Trinket") - end - end - do - local pvp = self.PVPSpecIcon; - pvp.bg:Point("RIGHT", self, "RIGHT") - pvp.bg:Size(UNIT_HEIGHT, UNIT_HEIGHT) - if db.pvpSpecIcon then - self.InfoPanel:Point("TOPLEFT", self, "TOPLEFT", 0, 0) - self.InfoPanel:Point("BOTTOMRIGHT", self.PVPSpecIcon, "BOTTOMLEFT", 0, 0) - if self:IsElementEnabled("PVPSpecIcon")then - self:EnableElement("PVPSpecIcon") - end - elseif self:IsElementEnabled("PVPSpecIcon")then - self:DisableElement("PVPSpecIcon") - end - end - MOD:RefreshUnitLayout(self, "arena") + self:ClearAllPoints() + if(tonumber(INDEX) == 1) then holder:Width(UNIT_WIDTH) holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) @@ -776,6 +795,50 @@ local UpdateArenaFrame = function(self) self:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) end end + + MOD:RefreshUnitLayout(self, "arena") + + if(self.Combatant) then + local pvp = self.Combatant + local trinket = pvp.Trinket + local badge = pvp.Badge + + local leftAnchor = self + local rightAnchor = self + + trinket:Size(db.pvp.trinketSize) + trinket:ClearAllPoints() + if(db.pvp.trinketPosition == "RIGHT") then + trinket:Point("LEFT", rightAnchor, "RIGHT", db.pvp.trinketX, db.pvp.trinketY) + rightAnchor = trinket + else + trinket:Point("RIGHT", leftAnchor, "LEFT", db.pvp.trinketX, db.pvp.trinketY) + leftAnchor = trinket + end + + badge:Size(db.pvp.specSize) + badge:ClearAllPoints() + if(db.pvp.specPosition == "RIGHT") then + badge:Point("LEFT", rightAnchor, "RIGHT", db.pvp.specX, db.pvp.specY) + rightAnchor = badge + else + badge:Point("RIGHT", leftAnchor, "LEFT", db.pvp.specX, db.pvp.specY) + leftAnchor = badge + end + + pvp:ClearAllPoints() + pvp:SetPoint("TOPLEFT", leftAnchor, "TOPLEFT", 0, 0) + pvp:SetPoint("BOTTOMRIGHT", rightAnchor, "BOTTOMRIGHT", 0, 0) + + if(db.pvp.enable and (not self:IsElementEnabled("Combatant"))) then + self:EnableElement("Combatant") + pvp:Show() + elseif((not db.pvp.enable) and self:IsElementEnabled("Combatant")) then + self:DisableElement("Combatant") + pvp:Hide() + end + end + self:UpdateAllElements() end UPDATERS["arena"] = UpdateArenaFrame @@ -802,35 +865,11 @@ CONSTRUCTORS["arena"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.Castbar = MOD:CreateCastbar(self, true, nil, true, nil, true) - self.Trinket = MOD:CreateTrinket(self) - self.PVPSpecIcon = MOD:CreatePVPSpecIcon(self) + self.Combatant = MOD:CreateCombatant(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:SetAttribute("type2", "focus") - if not _G[prepName] then - local prep = CreateFrame("Frame", prepName, UIParent) - prep:SetFrameStrata("MEDIUM") - prep:SetAllPoints(self) - prep:SetID(selfID) - prep:SetPanelTemplate("Bar", true, 3, 3, 3) - prep.Health = CreateFrame("StatusBar", nil, prep) - prep.Health:SetAllPoints(prep) - prep.Health:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - prep.Health:SetPanelTemplate("Bar", true, 3, 3, 3) - prep.Icon = prep:CreateTexture(nil, "OVERLAY") - prep.Icon.bg = CreateFrame("Frame", nil, prep) - prep.Icon.bg:Point("TOPLEFT", prep, "TOPRIGHT", 1, 0) - prep.Icon.bg:Point("BOTTOMRIGHT", prep, "BOTTOMRIGHT", 1, 0) - prep.Icon.bg:SetFixedPanelTemplate("Default", true) - prep.Icon:SetParent(prep.Icon.bg) - prep.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - prep.Icon:FillInner(prep.Icon.bg) - prep.SpecClass = prep.Health:CreateFontString(nil, "OVERLAY") - prep.SpecClass:SetFont(SuperVillain.Media.font.names, 12, "OUTLINE") - prep.SpecClass:SetTextColor(1, 1, 1) - prep.SpecClass:SetPoint("CENTER") - prep:Hide() - end + if not _G[prepName] then CreatePrepFrame(prepName, self, selfID) end if(not _G["SVUI_Arena_MOVE"]) then self:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) @@ -880,13 +919,13 @@ local ArenaPrepHandler_OnEvent = function(self, event) end if class and spec then prepframe.SpecClass:SetText(spec .. " - " .. LOCALIZED_CLASS_NAMES_MALE[class]) - prepframe.Icon:SetTexture(icon or [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) + prepframe.SpecIcon.Icon:SetTexture(icon or [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) local color = RAID_CLASS_COLORS[class] local textcolor = SVUI_CLASS_COLORS[class] or color if color then prepframe.Health:SetStatusBarColor(color.r, color.g, color.b) - prepframe.SpecClass:SetTextColor(color.r, color.g, color.b) + prepframe.SpecClass:SetTextColor(textcolor.r, textcolor.g, textcolor.b) else prepframe.Health:SetStatusBarColor(0.25, 0.25, 0.25) prepframe.SpecClass:SetTextColor(1, 1, 1) diff --git a/Interface/AddOns/SVUI/scripts/pvp.lua b/Interface/AddOns/SVUI/scripts/pvp.lua index 0fd5b06..7309c58 100644 --- a/Interface/AddOns/SVUI/scripts/pvp.lua +++ b/Interface/AddOns/SVUI/scripts/pvp.lua @@ -4,11 +4,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# ############################################################################## S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## @@ -20,40 +20,127 @@ LOCALIZED LUA FUNCTIONS local _G = _G; local unpack = _G.unpack; local select = _G.select; -local pairs = _G.pairs; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local table = _G.table; -local bit = _G.bit; - -local twipe,band = table.wipe, bit.band; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- local SuperVillain, L = unpack(select(2, ...)); --- SVUI_Cache.Mounts.types --- SVUI_Cache.Mounts.names --[[ ########################################################## -LOCAL VARIABLES +LOCALS ########################################################## ]]-- +local function EnteringBattleGround() + local numButtons = 1 + local points = GetNumMapLandmarks() + for i = 1, points do + if(numButtons <= 6) then + local name, description, icon, _, _, _, active = GetMapLandmarkInfo(i) + if(active) then + local buttonName = ("SVUI_PVPCommButton"):format(numButtons) + local button = _G[buttonName] + button.name = name + button.description = description + button.Text:SetText(name) + button:SetFontString(button.Text) + button:Show() + numButtons = numButtons + 1 + end + end + end +end +local function ExitingBattleGround() + for i = 1, 6 do + local buttonName = ("SVUI_PVPCommButton"):format(numButtons) + local button = _G[buttonName] + button.name = "" + button.description = "" + button.Text:SetText("") + button:SetFontString(button.Text) + button:Hide() + end +end --[[ ########################################################## -LOCAL FUNCTIONS +HANDLERS ########################################################## ]]-- +local Incoming_OnEnter = function(self) + if InCombatLockdown() then return end + if(self.description and self.description ~= "") then + self:SetBackdropBorderColor(1,0.45,0) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.description, 1, 1, 1) + GameTooltip:Show() + end +end + +local Incoming_OnLeave = function(self) + if InCombatLockdown() then return end + self:SetBackdropBorderColor(0,0,0) + if(GameTooltip:IsShown()) then GameTooltip:Hide() end +end + +local Incoming_OnClick = function(self) + if(self.name and self.name ~= "") then + local msg = ("{rt8} Incoming %s {rt8}"):format(self.name) + SendChatMessage(msg, "INSTANCE_CHAT") + end +end +local PVPCommunicator = CreateFrame("Frame", nil) +local PVPCommunicator_OnEvent = function(self, event, ...) + local instance, groupType = IsInInstance() + if(instance and groupType == "pvp") then + if(not self.InPVP) then + EnteringBattleGround() + self.InPVP = true + end + else + if(self.InPVP) then + ExitingBattleGround() + self.InPVP = nil + end + end +end --[[ ########################################################## -SLASH FUNCTIONS +LOADER ########################################################## ]]-- -function SVUISayIncoming() - local subzoneText = GetSubZoneText() - SendChatMessage(format("{rt8} Incoming %s {rt8}", subzoneText), "INSTANCE_CHAT") - return -end \ No newline at end of file +local function LoadPVPComm() + local width = 119 + local height = 156 + local holder = CreateFrame("Frame", "SVUI_PVPComm", UIParent) + holder:SetSize(width, height) + holder:SetPoint("RIGHT", UIParent, "CENTER", -200, 0) + holder:SetPanelTemplate("Transparent") + for i = 1, 6 do + local yOffset = (24 * (i - 1)) + 2 + local buttonName = ("SVUI_PVPCommButton"):format(i) + if(not _G[buttonName]) then + local button = CreateFrame("Button", buttonName, holder) + button:SetSize(115, 22) + button:SetPoint("TOP", holder, "TOP", 0, -yOffset) + button:SetButtonTemplate() + button.Text = searchButton:CreateFontString(nil,"OVERLAY") + button.Text:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + button.Text:SetAllPoints(button) + button.Text:SetJustifyH("CENTER") + button.Text:SetText("") + button:SetFontString(button.Text) + button:SetScript("OnEnter", Incoming_OnEnter) + button:SetScript("OnLeave", Incoming_OnLeave) + button:SetScript("OnClick", Incoming_OnClick) + end + end + SuperVillain:SetSVMovable(holder, "SVUI_PVPComm_MOVE", L["PvP Communicator"]) + + PVPCommunicator:RegisterEvent("PLAYER_ENTERING_WORLD") + PVPCommunicator:SetScript("OnEvent", PVPCommunicator_OnEvent) +end + +SuperVillain.Registry:NewScript(LoadPVPComm) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/reactions.lua b/Interface/AddOns/SVUI/scripts/reactions.lua index bf9e35f..8761627 100644 --- a/Interface/AddOns/SVUI/scripts/reactions.lua +++ b/Interface/AddOns/SVUI/scripts/reactions.lua @@ -117,22 +117,21 @@ local StupidHatHandler_OnEvent = function(self, event) end --[[ ########################################################## -ARENA OPPONENT IS DRINKING +VARIOUS COMBAT REACTIONS ########################################################## ]]-- -local ArenaDrinkHandler = CreateFrame("Frame") -local ArenaDrinkHandler_OnEvent = function(self, event, ...) - if not (event == "UNIT_SPELLCAST_SUCCEEDED" and GetZonePVPInfo() == "arena") then return end - local unit, _, _, _, spellID = ... - if UnitIsEnemy("player", unit) and (spellID == 118358 or spellID == 104270) then - SendChatMessage(UnitName(unit)..L[" is drinking."], "PARTY") - end +local random = math.random +local function rng() + return random(1,6) end ---[[ -########################################################## -I HAS LAID DOWN A FEAST -########################################################## -]]-- +local SAPPED_MESSAGE = { + "Oh Hell No... {rt8}SAPPED{rt8}", + "{rt8}SAPPED{rt8}", + "Mother Fu... {rt8}SAPPED{rt8}", + "{rt8}SAPPED{rt8}", + "{rt8}SAPPED{rt8} ...Ain't Nobody Got Time For That!", + "{rt8}SAPPED{rt8}" +} local ChatLogHandler = CreateFrame("Frame") local ChatLogHandler_OnEvent = function(self, event, ...) local _, subEvent, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, spellID, _, _, otherSpellID = ... @@ -141,7 +140,9 @@ local ChatLogHandler_OnEvent = function(self, event, ...) if(SuperVillain.db.system.pvpinterrupt) then if ((spellID == 6770) and (destName == toon) and (subEvent == "SPELL_AURA_APPLIED" or subEvent == "SPELL_AURA_REFRESH")) then - SendChatMessage("Uh-oh", "SAY") + local msg = SAPPED_MESSAGE[rng()] + local cahnnel = IsInGroup() and "PARTY" or "SAY" + SendChatMessage(msg, cahnnel) DEFAULT_CHAT_FRAME:AddMessage("Sapped by: "..(sourceName or "(unknown)")) elseif(subEvent == "SPELL_INTERRUPT" and sourceGUID == UnitGUID("player") and IsInGroup()) then SendChatMessage(INTERRUPTED.." "..destName..": "..GetSpellLink(otherSpellID), MsgTest()) @@ -255,14 +256,6 @@ function SuperVillain:ToggleReactions() StupidHatHandler:SetScript("OnEvent", nil) end - if(settings.arenadrink) then - ArenaDrinkHandler:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") - ArenaDrinkHandler:SetScript("OnEvent", ArenaDrinkHandler_OnEvent) - else - ArenaDrinkHandler:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED") - ArenaDrinkHandler:SetScript("OnEvent", nil) - end - if(not settings.sharingiscaring) and (not settings.pvpinterrupt) and (not settings.woot) and (not settings.lookwhaticando) then ChatLogHandler:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") ChatLogHandler:SetScript("OnEvent", nil) diff --git a/Interface/AddOns/SVUI/system/classes/Database.lua b/Interface/AddOns/SVUI/system/classes/Database.lua index eb577ea..29ac74c 100644 --- a/Interface/AddOns/SVUI/system/classes/Database.lua +++ b/Interface/AddOns/SVUI/system/classes/Database.lua @@ -2175,8 +2175,7 @@ local DatabaseDefaults = { ["rangeCheck"] = true, ["showBy"] = "UP", ["width"] = 215, - ["height"] = 45, - ["pvpSpecIcon"] = true, + ["height"] = 45, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", ["formatting"] = { @@ -2333,13 +2332,17 @@ local DatabaseDefaults = { ["castingColor"] = {0.8, 0.8, 0}, ["sparkColor"] = {1, 0.72, 0}, }, - ["pvpTrinket"] = + ["pvp"] = { - ["enable"] = true, - ["position"] = "LEFT", - ["size"] = 45, - ["xOffset"] = 0, - ["yOffset"] = 0, + ["enable"] = true, + ["trinketPosition"] = "LEFT", + ["trinketSize"] = 45, + ["trinketX"] = -2, + ["trinketY"] = 0, + ["specPosition"] = "RIGHT", + ["specSize"] = 45, + ["specX"] = 2, + ["specY"] = 0, }, }, ["party"] = { diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index ff2b18c..004b989 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -41,6 +41,12 @@ function SVUICookingMode() if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Cooking" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Cooking") end end +function SVUISayIncoming() + local subzoneText = GetSubZoneText() + local msg = ("{rt8} Incoming %s {rt8}"):format(subzoneText) + SendChatMessage(msg, "INSTANCE_CHAT") + return +end --[[ ########################################################## LOCAL SLASH FUNCTIONS diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 4b330a4..e17cc88 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Elv -## Version: @project-version@ +## Version: 4.053 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua index 4320449..20b7735 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua @@ -145,7 +145,7 @@ SuperVillain.Options.args.SVBag={ ["ICON"] = L["Icons Only"], ["ICON_TEXT"] = L["Icons and Text"] }, - set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:RefreshTKN()end + set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:RefreshTokens()end }, bagTools = { order = 10, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua index ebdcb9c..65f2f75 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua @@ -141,10 +141,9 @@ SuperVillain.Options.args.SVUnit.args.arena = { name = "", }, predict = {order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle"}, - pvpSpecIcon = {order = 4, name = L["Spec Icon"], desc = L["Display icon on arena frame indicating the units talent specialization or the units faction if inside a battleground."], type = "toggle"}, - rangeCheck = {order = 5, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 6, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SuperVillain.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrames("arena")end}, - threatEnabled = {type = "toggle", order = 7, name = L["Show Threat"]} + rangeCheck = {order = 4, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, + hideonnpc = {type = "toggle", order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SuperVillain.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrames("arena")end}, + threatEnabled = {type = "toggle", order = 6, name = L["Show Threat"]} } }, sizeGroup = { @@ -157,51 +156,106 @@ SuperVillain.Options.args.SVUnit.args.arena = { height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, } }, - pvpTrinket = { + pvp = { order = 3, guiInline = true, type = "group", - name = L["PVP Trinket"], - get = function(l)return SuperVillain.db.SVUnit["arena"]["pvpTrinket"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvpTrinket");MOD:SetEnemyFrames("arena", 5)end, + name = L["PVP Indicators"], args = { enable = { type = "toggle", order = 1, - name = L["Enable"] + name = L["Enable"], + get = function(l)return SuperVillain.db.SVUnit.arena.pvp.enable end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, }, - position = { - type = "select", - order = 2, - name = L["Position"], - values = { - ["LEFT"] = L["Left"], - ["RIGHT"] = L["Right"] + trinketGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Trinkets"], + get = function(l)return SuperVillain.db.SVUnit.arena.pvp[l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, + disabled = function() return not SuperVillain.db.SVUnit.arena.pvp.enable end, + args = { + trinketPosition = { + type = "select", + order = 1, + name = L["Position"], + values = { + ["LEFT"] = L["Left"], + ["RIGHT"] = L["Right"] + } + }, + trinketSize = { + order = 2, + type = "range", + name = L["Size"], + min = 10, + max = 60, + step = 1 + }, + trinketX = { + order = 3, + type = "range", + name = L["xOffset"], + min = -60, + max = 60, + step = 1 + }, + trinketY = { + order = 4, + type = "range", + name = L["yOffset"], + min = -60, + max = 60, + step = 1 + } } }, - size = { - order = 3, - type = "range", - name = L["Size"], - min = 10, - max = 60, - step = 1 - }, - xOffset = { - order = 4, - type = "range", - name = L["xOffset"], - min = -60, - max = 60, - step = 1 - }, - yOffset = { - order = 4, - type = "range", - name = L["yOffset"], - min = -60, - max = 60, - step = 1 + specGroup = { + order = 3, + guiInline = true, + type = "group", + name = L["Enemy Specs"], + get = function(l)return SuperVillain.db.SVUnit.arena.pvp[l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, + disabled = function() return not SuperVillain.db.SVUnit.arena.pvp.enable end, + args = { + specPosition = { + type = "select", + order = 1, + name = L["Position"], + values = { + ["LEFT"] = L["Left"], + ["RIGHT"] = L["Right"] + } + }, + specSize = { + order = 2, + type = "range", + name = L["Size"], + min = 10, + max = 60, + step = 1 + }, + specX = { + order = 3, + type = "range", + name = L["xOffset"], + min = -60, + max = 60, + step = 1 + }, + specY = { + order = 4, + type = "range", + name = L["yOffset"], + min = -60, + max = 60, + step = 1 + } + } } } }, diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index 0ee8d3c..55d97e4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Azilroka, Sortokk -## Version: @project-version@ +## Version: 4.053 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI