diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.lua deleted file mode 100644 index 833d224..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.lua +++ /dev/null @@ -1,191 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local error = _G.error; -local print = _G.print; -local pairs = _G.pairs; -local next = _G.next; -local tostring = _G.tostring; -local setmetatable = _G.setmetatable; ---STRING -local string = _G.string; -local format = string.format; ---MATH -local math = _G.math; -local floor = math.floor -local ceil = math.ceil ---BLIZZARD API -local GetTime = _G.GetTime; -local CreateFrame = _G.CreateFrame; -local UnitIsEnemy = _G.UnitIsEnemy; -local UnitGUID = _G.UnitGUID; -local IsActiveBattlefieldArena = _G.IsActiveBattlefieldArena; -local UnitFactionGroup = _G.UnitFactionGroup; -local GetNumArenaOpponentSpecs = _G.GetNumArenaOpponentSpecs; -local GetArenaOpponentSpec = _G.GetArenaOpponentSpec; -local GetSpecializationInfoByID = _G.GetSpecializationInfoByID; -local UnitName = _G.UnitName; -local SendChatMessage = _G.SendChatMessage; -local CooldownFrame_SetTimer = _G.CooldownFrame_SetTimer; - -local _, ns = ... -local oUF = ns.oUF - -local trinketSpells = { - [59752] = 120, - [42292] = 120, - [7744] = 45, -} - -local timeLeft = 0 -local Trinket_OnUpdate = function(self, elapsed) - local expires = (self.duration - (GetTime() - self.start)); - if(expires == 0) then - local parent = self:GetParent() - parent.Icon:SetDesaturated(false) - parent.Unavailable:Hide() - self:SetScript("OnUpdate", nil) - end -end - -local function GetPVPIcons(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 function LogUpdate(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 - local startTime = GetTime() - local duration = trinketSpells[spellID] - trinket.CD.start = startTime - trinket.CD.duration = duration - trinket.CD.nextUpdate = 0 - trinket.CD:SetScript("OnUpdate", Trinket_OnUpdate) - trinket.Icon:SetDesaturated(true) - trinket.Unavailable:Show() - CooldownFrame_SetTimer(trinket.CD, startTime, duration, 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(("%s is drinking."):format(UnitName(self.unit)), "RAID_WARNING") - end - end -end - -local Update = function(self, event, ...) - local unit, unitType = ... - if(event == "COMBAT_LOG_EVENT_UNFILTERED" or event == "UNIT_SPELLCAST_SUCCEEDED") then return LogUpdate(self, event, ...) end - 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.Icon:SetTexture(tIcon) - trinket:Show() - if event == 'PLAYER_ENTERING_WORLD' then - CooldownFrame_SetTimer(trinket.CD, 1, 1, 1) - end - end -end - -local Enable = function(self, unit) - --if(not unit:match("arena%d")) then return end - local element = self.Combatant - - if(element) then - local trinket = element.Trinket - local badge = element.Badge - self:RegisterEvent("ARENA_OPPONENT_UPDATE", Update) - self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) - - if(trinket) then - self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update) - self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", Update) - if not trinket.CD then - trinket.CD = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate") - trinket.CD:SetAllPoints(trinket) - end - - if not trinket.Icon then - trinket.Icon = trinket:CreateTexture(nil, "BORDER") - trinket.Icon:SetAllPoints(trinket) - trinket.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - trinket.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - end - - if not trinket.Unavailable then - trinket.Unavailable = trinket:CreateTexture(nil, "OVERLAY") - trinket.Unavailable:SetAllPoints(trinket) - trinket.Unavailable:SetTexCoord(0.1, 0.9, 0.1, 0.9) - trinket.Unavailable:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Pass-Up]]) - end - trinket:Show() - end - - if(badge) then - self:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update) - if not badge.Icon then - badge.Icon = badge:CreateTexture(nil, "OVERLAY") - badge.Icon:SetAllPoints(badge) - badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - badge.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - 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", Update) - self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED", Update) - 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_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc deleted file mode 100644 index 7b7c819..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 50001 -## Title: oUF Combatant -## Notes: Adds PvP trinket status and spec icons to oUF frames. -## Author: Munglunch -## Version: 5.4.15 -## X-Category: oUF -## Dependencies: oUF - -oUF_Combatant.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua new file mode 100644 index 0000000..1d6cdaa --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Conqueror/oUF_Conqueror.lua @@ -0,0 +1,88 @@ +if(select(2, UnitClass('player')) ~= 'WARRIOR') then return end +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +--BLIZZARD API +local UnitDebuff = _G.UnitDebuff; + +local parent, ns = ... +local oUF = ns.oUF + +local RAGE_AURAS = {} + +local function getRageAmount() + for i = 1, 40 do + local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = + UnitDebuff("player", i) + if RAGE_AURAS[spellID] then + return amount + end + end + return 0 +end + +local OnUpdate = function(self, elapsed) + local duration = self.duration + elapsed + if(duration >= self.max) then + return self:SetScript("OnUpdate", nil) + else + self.duration = duration + return self:SetValue(duration) + end +end + +local Update = function(self, event, unit) + if(unit and unit ~= self.unit) then return end + local bar = self.Conqueror + if(bar.PreUpdate) then bar:PreUpdate(event) end + + local value = getRageAmount() + + if(value) then + bar:SetMinMaxValues(0, 100) + bar:SetValue(value) + bar:Update() + end + + if(bar.PostUpdate) then + return bar:PostUpdate(event) + end +end + +local Path = function(self, ...) + return (self.Conqueror.Override or Update)(self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate') +end + +local Enable = function(self) + local bar = self.Conqueror + + if(bar) then + bar.__owner = self + bar.ForceUpdate = ForceUpdate + + self:RegisterEvent('UNIT_AURA', Path, true) + + if(bar:IsObjectType'Texture' and not bar:GetTexture()) then + bar:SetTexture[[Interface\TargetingFrame\UI-StatusBar]] + end + + return true + end +end + +local Disable = function(self) + local bar = self.Conqueror + + if (bar) then + self:UnregisterEvent('UNIT_AURA', Path) + end +end + +oUF:AddElement('Conqueror', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.lua deleted file mode 100644 index 51e925a..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.lua +++ /dev/null @@ -1,140 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local error = _G.error; -local print = _G.print; -local pairs = _G.pairs; -local next = _G.next; -local tostring = _G.tostring; -local type = _G.type; ---STRING -local string = _G.string; -local format = string.format; ---MATH -local math = _G.math; -local floor = math.floor -local ceil = math.ceil ---TABLE -local table = _G.table; -local wipe = _G.wipe; ---BLIZZARD API -local BEAR_FORM = _G.BEAR_FORM; -local CAT_FORM = _G.CAT_FORM; -local SPELL_POWER_MANA = _G.SPELL_POWER_MANA; -local UnitClass = _G.UnitClass; -local UnitPower = _G.UnitPower; -local UnitReaction = _G.UnitReaction; -local UnitPowerMax = _G.UnitPowerMax; -local UnitIsPlayer = _G.UnitIsPlayer; -local UnitPlayerControlled = _G.UnitPlayerControlled; -local GetShapeshiftFormID = _G.GetShapeshiftFormID; - -if(select(2, UnitClass('player')) ~= 'DRUID') then return end - -local _, ns = ... -local oUF = ns.oUF or oUF - -local UPDATE_VISIBILITY = function(self, event) - local druidmana = self.DruidAltMana - -- check form - local form = GetShapeshiftFormID() - local min, max = druidmana.ManaBar:GetMinMaxValues() - - if druidmana.ManaBar:GetValue() == max then - druidmana:Hide() - elseif (form == BEAR_FORM or form == CAT_FORM) then - druidmana:Show() - else - druidmana:Hide() - end - - if(druidmana.PostUpdateVisibility) then - return druidmana:PostUpdateVisibility(self.unit) - end -end - -local UNIT_POWER = function(self, event, unit, powerType) - if(self.unit ~= unit) then return end - local druidmana = self.DruidAltMana - - if not (druidmana.ManaBar) then return end - - if(druidmana.PreUpdate) then - druidmana:PreUpdate(unit) - end - local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA) - - druidmana.ManaBar:SetMinMaxValues(0, max) - druidmana.ManaBar:SetValue(min) - - local r, g, b, t - if(druidmana.colorPower) then - t = self.colors.power["MANA"] - elseif(druidmana.colorClass and UnitIsPlayer(unit)) or - (druidmana.colorClassNPC and not UnitIsPlayer(unit)) or - (druidmana.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - t = self.colors.class[class] - elseif(druidmana.colorReaction and UnitReaction(unit, 'player')) then - t = self.colors.reaction[UnitReaction(unit, "player")] - elseif(druidmana.colorSmooth) then - r, g, b = self.ColorGradient(min / max, unpack(druidmana.smoothGradient or self.colors.smooth)) - end - - if(t) then - r, g, b = t[1], t[2], t[3] - end - - if(b) then - druidmana.ManaBar:SetStatusBarColor(r, g, b) - - local bg = druidmana.bg - if(bg) then - local mu = bg.multiplier or 1 - bg:SetVertexColor(r * mu, g * mu, b * mu) - end - end - - UPDATE_VISIBILITY(self) - - if(druidmana.PostUpdatePower) then - return druidmana:PostUpdatePower(unit, min, max) - end -end - -local Update = function(self, ...) - UNIT_POWER(self, ...) - return UPDATE_VISIBILITY(self, ...) -end - -local ForceUpdate = function(element) - return Update(element.__owner, 'ForceUpdate') -end - -local Enable = function(self, unit) - local druidmana = self.DruidAltMana - if(druidmana and unit == 'player') then - druidmana.__owner = self - druidmana.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_POWER', UNIT_POWER) - self:RegisterEvent('UNIT_MAXPOWER', UNIT_POWER) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY) - - return true - end -end - -local Disable = function(self) - local druidmana = self.DruidAltMana - if(druidmana) then - self:UnregisterEvent('UNIT_POWER', UNIT_POWER) - self:UnregisterEvent('UNIT_MAXPOWER', UNIT_POWER) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY) - end -end - -oUF:AddElement("DruidAltMana", Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.toc deleted file mode 100644 index 744e176..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DruidMana/oUF_DruidMana.toc +++ /dev/null @@ -1,10 +0,0 @@ -## Interface: 40100 -## Title: oUF Druid Mana -## Notes: Adds Druid Mana Bar to oUF. -## Author: SV -## Version: 1.0 -## X-Category: UnitFrame -## Dependencies: oUF - -oUF_DruidMana.lua - diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.lua new file mode 100644 index 0000000..236bbfe --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.lua @@ -0,0 +1,327 @@ +if(select(2, UnitClass('player')) ~= 'DRUID') then return end +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local error = _G.error; +local print = _G.print; +local pairs = _G.pairs; +local next = _G.next; +local tostring = _G.tostring; +local type = _G.type; +--STRING +local string = _G.string; +local format = string.format; +--MATH +local math = _G.math; +local floor = math.floor +local ceil = math.ceil +--TABLE +local table = _G.table; +local wipe = _G.wipe; +--BLIZZARD API +local BEAR_FORM = _G.BEAR_FORM; +local CAT_FORM = _G.CAT_FORM; +local SPELL_POWER_MANA = _G.SPELL_POWER_MANA; +local UnitClass = _G.UnitClass; +local UnitPower = _G.UnitPower; +local UnitReaction = _G.UnitReaction; +local UnitPowerMax = _G.UnitPowerMax; +local UnitIsPlayer = _G.UnitIsPlayer; +local UnitPlayerControlled = _G.UnitPlayerControlled; +local GetShapeshiftFormID = _G.GetShapeshiftFormID; + +local _, ns = ... +local oUF = ns.oUF or oUF + +local ECLIPSE_BAR_SOLAR_BUFF_ID = _G.ECLIPSE_BAR_SOLAR_BUFF_ID +local ECLIPSE_BAR_LUNAR_BUFF_ID = _G.ECLIPSE_BAR_LUNAR_BUFF_ID +local SPELL_POWER_ECLIPSE = _G.SPELL_POWER_ECLIPSE +local MOONKIN_FORM = _G.MOONKIN_FORM +local ALERTED = false; +local TextColors = { + [1]={1,0.1,0.1}, + [2]={1,0.5,0.1}, + [3]={1,1,0.1}, + [4]={0.5,1,0.1}, + [5]={0.1,1,0.1} +}; + +local function FivePointsAlarm(points) + if not CombatText_AddMessage then return end + if(points == 5 and not ALERTED) then + CombatText_AddMessage("5 Points", CombatText_StandardScroll, 0.1, 0.5, 1, "crit") + ALERTED = true + elseif(ALERTED and points < 5) then + ALERTED = false + end +end + +local UPDATE_VISIBILITY = function(self, event) + local bar = self.Druidness + local chicken = bar.Chicken + local cat = bar.Cat + local mana = bar.Mana + + -- check form/mastery + local form = GetShapeshiftFormID() + + if mana.ManaBar:GetValue() < UnitPowerMax('player', SPELL_POWER_MANA) then + mana:Show() + else + mana:Hide() + end + + if(not form) then + local ptt = GetSpecialization() + if(ptt and ptt == 1) then -- player has balance spec + chicken:Show() + else + chicken:Hide() + end + cat:Hide() + elseif(form == MOONKIN_FORM) then + chicken:Show() + mana:Hide() + cat:Hide() + elseif (form == BEAR_FORM or form == CAT_FORM) then + chicken:Hide() + if(form == CAT_FORM) then + cat:Show() + else + cat:Hide() + end + else + chicken:Hide() + cat:Hide() + end + + if(bar.PostUpdateVisibility) then + return bar:PostUpdateVisibility(self.unit) + end +end + +local UNIT_POWER = function(self, event, unit, powerType) + if(self.unit ~= unit) then return end + local bar = self.Druidness + local chicken = bar.Chicken + local mana = bar.Mana + + if(chicken:IsShown() or powerType == 'ECLIPSE') then + local power = UnitPower('player', SPELL_POWER_ECLIPSE) + local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) + + if(chicken.LunarBar) then + chicken.LunarBar:SetMinMaxValues(-maxPower, maxPower) + chicken.LunarBar:SetValue(power) + end + + if(chicken.SolarBar) then + chicken.SolarBar:SetMinMaxValues(-maxPower, maxPower) + chicken.SolarBar:SetValue(power * -1) + end + + if(chicken.PostUpdatePower) then + return chicken:PostUpdatePower(unit) + end + end + + if not (mana.ManaBar) then return end + + if(mana.PreUpdate) then + mana:PreUpdate(unit) + end + local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA) + + mana.ManaBar:SetMinMaxValues(0, max) + mana.ManaBar:SetValue(min) + + local r, g, b, t + if(mana.colorPower) then + t = self.colors.power["MANA"] + elseif(mana.colorClass and UnitIsPlayer(unit)) or + (mana.colorClassNPC and not UnitIsPlayer(unit)) or + (mana.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then + local _, class = UnitClass(unit) + t = self.colors.class[class] + elseif(mana.colorReaction and UnitReaction(unit, 'player')) then + t = self.colors.reaction[UnitReaction(unit, "player")] + elseif(mana.colorSmooth) then + r, g, b = self.ColorGradient(min / max, unpack(mana.smoothGradient or self.colors.smooth)) + end + + if(t) then + r, g, b = t[1], t[2], t[3] + end + + if(b) then + mana.ManaBar:SetStatusBarColor(r, g, b) + + local bg = mana.bg + if(bg) then + local mu = bg.multiplier or 1 + bg:SetVertexColor(r * mu, g * mu, b * mu) + end + end + + UPDATE_VISIBILITY(self) + + if(mana.PostUpdatePower) then + return mana:PostUpdatePower(unit, min, max) + end +end + +local UNIT_AURA = function(self, event, unit) + if((not unit) or (unit and self.unit ~= unit)) then return end + local bar = self.Druidness + local chicken = bar.Chicken + local mana = bar.Mana + + if(chicken and chicken:IsShown()) then + local i = 1 + local hasSolarEclipse, hasLunarEclipse + repeat + local _, _, _, _, _, _, _, _, _, _, spellID = UnitAura(unit, i, 'HELPFUL') + + if(spellID == ECLIPSE_BAR_SOLAR_BUFF_ID) then + hasSolarEclipse = true + elseif(spellID == ECLIPSE_BAR_LUNAR_BUFF_ID) then + hasLunarEclipse = true + end + + i = i + 1 + until not spellID + chicken.hasSolarEclipse = hasSolarEclipse + chicken.hasLunarEclipse = hasLunarEclipse + end + + if(bar.PostUnitAura) then + return bar:PostUnitAura(unit) + end +end + +local ECLIPSE_DIRECTION_CHANGE = function(self, event, status) + local bar = self.Druidness + local chicken = bar.Chicken + + if(status and chicken:IsVisible() and chicken.PostDirectionChange[status]) then + return chicken.PostDirectionChange[status](chicken) + end +end + +local UPDATE_POINTS = function(self, event, unit) + if(unit == 'pet') then return end + local bar = self.Druidness; + local cpoints = bar.Cat; + + if(bar.PreUpdate) then + bar:PreUpdate() + end + + local current = 0 + if(UnitHasVehicleUI'player') then + current = GetComboPoints('vehicle', 'target') + else + current = GetComboPoints('player', 'target') + end + + if(cpoints) then + for i=1, MAX_COMBO_POINTS do + if(i <= current) then + cpoints[i]:Show() + if(bar.PointShow) then + bar.PointShow(cpoints[i]) + end + else + cpoints[i]:Hide() + if(bar.PointHide) then + bar.PointHide(cpoints[i], i) + end + end + end + end + + if((GetShapeshiftForm() == 3) and (current > 0)) then + FivePointsAlarm(current) + end + + if(bar.PostUpdate) then + return bar:PostUpdate(current) + end +end + +local Update = function(self, ...) + UNIT_POWER(self, ...) + UNIT_AURA(self, ...) + UPDATE_POINTS(self, ...) + return UPDATE_VISIBILITY(self, ...) +end + +local ForceUpdate = function(element) + return Update(element.__owner, 'ForceUpdate', element.__owner.unit, 'ECLIPSE') +end + +local function Enable(self) + local bar = self.Druidness + + if(bar) then + local chicken = bar.Chicken + local mana = bar.Mana + chicken.__owner = self + chicken.ForceUpdate = ForceUpdate + + if(chicken.LunarBar and chicken.LunarBar:IsObjectType'StatusBar' and not chicken.LunarBar:GetStatusBarTexture()) then + chicken.LunarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) + end + if(chicken.SolarBar and chicken.SolarBar:IsObjectType'StatusBar' and not chicken.SolarBar:GetStatusBarTexture()) then + chicken.SolarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) + end + + local power = UnitPower('player', SPELL_POWER_ECLIPSE) + local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) + + if(chicken.LunarBar) then + chicken.LunarBar:SetMinMaxValues(-maxPower, maxPower) + chicken.LunarBar:SetValue(power) + end + + if(chicken.SolarBar) then + chicken.SolarBar:SetMinMaxValues(-maxPower, maxPower) + chicken.SolarBar:SetValue(power * -1) + end + + self:RegisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE, true) + self:RegisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY, true) + self:RegisterEvent('UNIT_AURA', UNIT_AURA) + self:RegisterEvent('UNIT_POWER', UNIT_POWER) + self:RegisterEvent('UNIT_MAXPOWER', UNIT_POWER) + self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY, true) + self:RegisterEvent('UNIT_COMBO_POINTS', UPDATE_POINTS, true) + self:RegisterEvent('PLAYER_TARGET_CHANGED', UPDATE_POINTS, true) + UPDATE_VISIBILITY(self) + return true + end +end + +local function Disable(self) + local bar = self.Druidness + + if(bar) then + local chicken = bar.Chicken + local mana = bar.Mana + chicken:Hide() + mana:Hide() + self:UnregisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE) + self:UnregisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY) + self:UnregisterEvent('UNIT_AURA', UNIT_AURA) + self:UnregisterEvent('UNIT_POWER', UNIT_POWER) + self:UnregisterEvent('UNIT_MAXPOWER', UNIT_POWER) + self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY) + self:UnregisterEvent('UNIT_COMBO_POINTS', UPDATE_POINTS) + self:UnregisterEvent('PLAYER_TARGET_CHANGED', UPDATE_POINTS) + end +end + +oUF:AddElement('BoomChicken', Update, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.toc new file mode 100644 index 0000000..7cf64a9 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Druidness/oUF_Druidness.toc @@ -0,0 +1,10 @@ +## Interface: 40100 +## Title: oUF Druidness +## Notes: Adds All the Druid Things! +## Author: SV +## Version: 1.0 +## X-Category: UnitFrame +## Dependencies: oUF + +oUF_Druidness.lua + diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.lua new file mode 100644 index 0000000..8ff98c0 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.lua @@ -0,0 +1,191 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local error = _G.error; +local print = _G.print; +local pairs = _G.pairs; +local next = _G.next; +local tostring = _G.tostring; +local setmetatable = _G.setmetatable; +--STRING +local string = _G.string; +local format = string.format; +--MATH +local math = _G.math; +local floor = math.floor +local ceil = math.ceil +--BLIZZARD API +local GetTime = _G.GetTime; +local CreateFrame = _G.CreateFrame; +local UnitIsEnemy = _G.UnitIsEnemy; +local UnitGUID = _G.UnitGUID; +local IsActiveBattlefieldArena = _G.IsActiveBattlefieldArena; +local UnitFactionGroup = _G.UnitFactionGroup; +local GetNumArenaOpponentSpecs = _G.GetNumArenaOpponentSpecs; +local GetArenaOpponentSpec = _G.GetArenaOpponentSpec; +local GetSpecializationInfoByID = _G.GetSpecializationInfoByID; +local UnitName = _G.UnitName; +local SendChatMessage = _G.SendChatMessage; +local CooldownFrame_SetTimer = _G.CooldownFrame_SetTimer; + +local _, ns = ... +local oUF = ns.oUF + +local trinketSpells = { + [59752] = 120, + [42292] = 120, + [7744] = 45, +} + +local timeLeft = 0 +local Trinket_OnUpdate = function(self, elapsed) + local expires = (self.duration - (GetTime() - self.start)); + if(expires == 0) then + local parent = self:GetParent() + parent.Icon:SetDesaturated(false) + parent.Unavailable:Hide() + self:SetScript("OnUpdate", nil) + end +end + +local function GetPVPIcons(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 function LogUpdate(self, event, ...) + local arenaMatch = IsActiveBattlefieldArena() + local element = self.Gladiator + 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 + local startTime = GetTime() + local duration = trinketSpells[spellID] + trinket.CD.start = startTime + trinket.CD.duration = duration + trinket.CD.nextUpdate = 0 + trinket.CD:SetScript("OnUpdate", Trinket_OnUpdate) + trinket.Icon:SetDesaturated(true) + trinket.Unavailable:Show() + CooldownFrame_SetTimer(trinket.CD, startTime, duration, 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(("%s is drinking."):format(UnitName(self.unit)), "RAID_WARNING") + end + end +end + +local Update = function(self, event, ...) + local unit, unitType = ... + if(event == "COMBAT_LOG_EVENT_UNFILTERED" or event == "UNIT_SPELLCAST_SUCCEEDED") then return LogUpdate(self, event, ...) end + if(not unit or unit ~= self.unit) then return end + local element = self.Gladiator + 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.Icon:SetTexture(tIcon) + trinket:Show() + if event == 'PLAYER_ENTERING_WORLD' then + CooldownFrame_SetTimer(trinket.CD, 1, 1, 1) + end + end +end + +local Enable = function(self, unit) + --if(not unit:match("arena%d")) then return end + local element = self.Gladiator + + if(element) then + local trinket = element.Trinket + local badge = element.Badge + self:RegisterEvent("ARENA_OPPONENT_UPDATE", Update) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) + + if(trinket) then + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update) + self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", Update) + if not trinket.CD then + trinket.CD = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate") + trinket.CD:SetAllPoints(trinket) + end + + if not trinket.Icon then + trinket.Icon = trinket:CreateTexture(nil, "BORDER") + trinket.Icon:SetAllPoints(trinket) + trinket.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + trinket.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) + end + + if not trinket.Unavailable then + trinket.Unavailable = trinket:CreateTexture(nil, "OVERLAY") + trinket.Unavailable:SetAllPoints(trinket) + trinket.Unavailable:SetTexCoord(0.1, 0.9, 0.1, 0.9) + trinket.Unavailable:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Pass-Up]]) + end + trinket:Show() + end + + if(badge) then + self:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update) + if not badge.Icon then + badge.Icon = badge:CreateTexture(nil, "OVERLAY") + badge.Icon:SetAllPoints(badge) + badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + badge.Icon:SetTexture([[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) + end + badge:Show() + end + + return true + end +end + +local Disable = function(self) + local element = self.Gladiator + 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", Update) + self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED", Update) + trinket:Hide() + end + if badge then + self:UnregisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS", Update) + badge:Hide() + end + end +end + +oUF:AddElement('Gladiator', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.toc new file mode 100644 index 0000000..3679662 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Gladiator/oUF_Gladiator.toc @@ -0,0 +1,9 @@ +## Interface: 50001 +## Title: oUF Gladiator +## Notes: Adds PvP trinket status and spec icons to oUF frames. +## Author: Munglunch +## Version: 5.4.15 +## X-Category: oUF +## Dependencies: oUF + +oUF_Gladiator.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua index 15fafd8..efda33a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua @@ -96,7 +96,7 @@ local Update = function(self, event, ...) if(bar.PreUpdate) then bar:PreUpdate(event) end - local name, start, duration; + local name, start, duration, isReady; local unit, _, _, _, spellID = ... if(unit and (self.unit ~= unit)) then return diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/.subl97d.tmp b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/.subl97d.tmp new file mode 100644 index 0000000..e1ada29 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/.subl97d.tmp @@ -0,0 +1,207 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; + +local class = select(2, UnitClass("player")); +if(class ~= "ROGUE" and class ~= "DRUID") then return end; + +local assert = _G.assert; +local error = _G.error; +local print = _G.print; +local pairs = _G.pairs; +local next = _G.next; +local tostring = _G.tostring; +local type = _G.type; +--STRING +local string = _G.string; +local format = string.format; +--MATH +local math = _G.math; +local floor = math.floor +local ceil = math.ceil +--TABLE +local table = _G.table; +local wipe = _G.wipe; +--BLIZZARD API +local GetShapeshiftForm = _G.GetShapeshiftForm; +local UnitHasVehicleUI = _G.UnitHasVehicleUI; +local UnitBuff = _G.UnitBuff; +local CombatText_AddMessage = _G.CombatText_AddMessage; +local CombatText_StandardScroll = _G.CombatText_StandardScroll; +local MAX_COMBO_POINTS = _G.MAX_COMBO_POINTS; +local GetSpellInfo = _G.GetSpellInfo; +local GetComboPoints = _G.GetComboPoints; + +local parent, ns = ... +local oUF = ns.oUF + +local GUILE1 = GetSpellInfo(84745) +local GUILE2 = GetSpellInfo(84746) +local GUILE3 = GetSpellInfo(84747) +local ANTICIPATION = GetSpellInfo(115189) +local ALERTED = false +local TextColors = { + [1]={1,0.1,0.1}, + [2]={1,0.5,0.1}, + [3]={1,1,0.1}, + [4]={0.5,1,0.1}, + [5]={0.1,1,0.1} +}; + +local function UpdateGuile() + local _, _, _, one = UnitBuff("player", GUILE1, nil, "HELPFUL") + local _, _, _, two = UnitBuff("player", GUILE2, nil, "HELPFUL") + local _, _, _, three = UnitBuff("player", GUILE3, nil, "HELPFUL") + if one or two or three then + if one then return 1; end + if two then return 2; end + if three then return 3; end + else + return 0; + end +end + +local function FivePointsAlarm(points) + if not CombatText_AddMessage then return end + if(points == 5 and not ALERTED) then + CombatText_AddMessage("5 Points", CombatText_StandardScroll, 0.1, 0.5, 1, "crit") + ALERTED = true + elseif(ALERTED and points < 5) then + ALERTED = false + end +end + +local Update = function(self, event, unit) + if(unit == 'pet') then return end + local bar = self.HyperCombo; + local cpoints = bar.Combo; + local tracker = bar.Tracking; + + if(bar.PreUpdate) then + bar:PreUpdate() + end + + local current = 0 + if(UnitHasVehicleUI'player') then + current = GetComboPoints('vehicle', 'target') + else + current = GetComboPoints('player', 'target') + end + + if(class == "ROGUE") then + local anti = select(4, UnitBuff("player", ANTICIPATION)) -- Anticipation stacks + + if(cpoints) then + for i=1, MAX_COMBO_POINTS do + if(i <= current) then + cpoints[i]:Show() + if(bar.PointShow) then + bar.PointShow(cpoints[i]) + end + else + cpoints[i]:Hide() + if(bar.PointHide) then + bar.PointHide(cpoints[i], i) + end + end + if(i <= anti) then + cpoints[i].Anticipation:Show() + else + cpoints[i].Anticipation:Hide() + end + end + end + + local guile = bar.Guile; + if(guile) then + local insight = UpdateGuile() + if(insight and insight > 0) then + guile.Text:SetText(insight) + guile.Text:SetTextColor(unpack(TextColors[insight])) + else + guile.Text:SetText("") + end + end + + if(current > 0) then + FivePointsAlarm(current) + end + else + if(cpoints) then + for i=1, MAX_COMBO_POINTS do + if(i <= current) then + cpoints[i]:Show() + if(bar.PointShow) then + bar.PointShow(cpoints[i]) + end + else + cpoints[i]:Hide() + if(bar.PointHide) then + bar.PointHide(cpoints[i], i) + end + end + end + end + + if((GetShapeshiftForm() == 3) and (current > 0)) then + FivePointsAlarm(current) + end + end + + if(bar.PostUpdate) then + return bar:PostUpdate(current) + end +end + +local Path = function(self, ...) + return (self.HyperCombo.Override or Update) (self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate', element.__owner.unit) +end + +local Enable = function(self) + local bar = self.HyperCombo + if(bar) then + bar.__owner = self + bar.ForceUpdate = ForceUpdate + bar.EXISTING_COMBO_POINTS = 0 + bar.LAST_COMBO_POINTS = 0 + + self:RegisterEvent('UNIT_COMBO_POINTS', Path, true) + self:RegisterEvent('PLAYER_TARGET_CHANGED', Path, true) + self:RegisterEvent('UNIT_AURA', Path, true) + + local cpoints = bar.Combo; + if(cpoints) then + for index = 1, MAX_COMBO_POINTS do + local cpoint = cpoints[index] + if(cpoint:IsObjectType'Texture' and not cpoint:GetTexture()) then + cpoint:SetTexture[[Interface\ComboFrame\ComboPoint]] + cpoint:SetTexCoord(0, 0.375, 0, 1) + end + end + end + return true + end +end + +local Disable = function(self) + local bar = self.HyperCombo + if(bar) then + local cpoints = bar.Combo; + if(cpoints) then + for index = 1, MAX_COMBO_POINTS do + cpoints[index]:Hide() + end + end + self:UnregisterEvent('UNIT_COMBO_POINTS', Path) + self:UnregisterEvent('PLAYER_TARGET_CHANGED', Path) + self:UnregisterEvent('UNIT_AURA', Path) + end +end + +oUF:AddElement('HyperCombo', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua index 99c60be..bc55667 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua @@ -3,6 +3,10 @@ local _G = _G; --LUA local unpack = _G.unpack; local select = _G.select; + +local class = select(2, UnitClass("player")); +if(class ~= "ROGUE") then return end; + local assert = _G.assert; local error = _G.error; local print = _G.print; @@ -30,9 +34,6 @@ local MAX_COMBO_POINTS = _G.MAX_COMBO_POINTS; local GetSpellInfo = _G.GetSpellInfo; local GetComboPoints = _G.GetComboPoints; -local class = select(2, UnitClass("player")); -if(class ~= "ROGUE" and class ~= "DRUID") then return end - local parent, ns = ... local oUF = ns.oUF @@ -62,21 +63,20 @@ local function UpdateGuile() end end -local function FivePointsAlarm(frame, points) +local function FivePointsAlarm(points) if not CombatText_AddMessage then return end - if(points == 5 and not frame.ALERTED) then + if(points == 5 and not ALERTED) then CombatText_AddMessage("5 Points", CombatText_StandardScroll, 0.1, 0.5, 1, "crit") - frame.ALERTED = true - elseif(frame.ALERTED and points < 5) then - frame.ALERTED = false + ALERTED = true + elseif(ALERTED and points < 5) then + ALERTED = false end end local Update = function(self, event, unit) if(unit == 'pet') then return end local bar = self.HyperCombo; - local cpoints = bar.CPoints; - local tracker = bar.Tracking; + local cpoints = bar.Combo; if(bar.PreUpdate) then bar:PreUpdate() @@ -89,6 +89,8 @@ local Update = function(self, event, unit) current = GetComboPoints('player', 'target') end + local anti = select(4, UnitBuff("player", ANTICIPATION)) -- Anticipation stacks + if(cpoints) then for i=1, MAX_COMBO_POINTS do if(i <= current) then @@ -102,56 +104,29 @@ local Update = function(self, event, unit) bar.PointHide(cpoints[i], i) end end + if(anti) then + if(i <= anti) then + cpoints[i].Anticipation:Show() + else + cpoints[i].Anticipation:Hide() + end + end end end - if(class == "ROGUE") then - if(tracker) then - if(current > 0) then - tracker.Text:SetText(current) - tracker.Text:SetTextColor(unpack(TextColors[current])) - FivePointsAlarm(tracker, current) - else - tracker.Text:SetText("0") - tracker.Text:SetTextColor(0.3,0.3,0.3) - end + local guile = bar.Guile; + if(guile) then + local insight = UpdateGuile() + if(insight and insight > 0) then + guile.Text:SetText(insight) + guile.Text:SetTextColor(unpack(TextColors[insight])) + else + guile.Text:SetText("") end + end - local anticipation = bar.Anticipation; - if(anticipation) then - local anti = select(4, UnitBuff("player", ANTICIPATION)) -- Anticipation stacks - if(anti and anti > 0) then - anticipation.Text:SetText(anti) - anticipation.Text:SetTextColor(unpack(TextColors[anti])) - else - anticipation.Text:SetText("") - end - end - local guile = bar.Guile; - if(guile) then - local insight = UpdateGuile() - if(insight and insight > 0) then - guile.Text:SetText(insight) - guile.Text:SetTextColor(unpack(TextColors[insight])) - else - guile.Text:SetText("") - end - end - else - if(tracker) then - if(GetShapeshiftForm() == 3) then - if(current > 0) then - tracker.Text:SetText(current) - tracker.Text:SetTextColor(unpack(TextColors[current])) - FivePointsAlarm(tracker, current) - else - tracker.Text:SetText("0") - tracker.Text:SetTextColor(0.3,0.3,0.3) - end - else - tracker.Text:SetText("") - end - end + if(current > 0) then + FivePointsAlarm(current) end if(bar.PostUpdate) then @@ -163,16 +138,6 @@ local Path = function(self, ...) return (self.HyperCombo.Override or Update) (self, ...) end --- local Tracker = function(self, ...) --- local bar = self.HyperCombo --- if(UnitHasVehicleUI'player') then --- bar.LAST_COMBO_POINTS = GetComboPoints('vehicle', 'target') --- else --- bar.LAST_COMBO_POINTS = GetComboPoints('player', 'target') --- end --- return Path(self, ...) --- end - local ForceUpdate = function(element) return Path(element.__owner, 'ForceUpdate', element.__owner.unit) end @@ -182,14 +147,12 @@ local Enable = function(self) if(bar) then bar.__owner = self bar.ForceUpdate = ForceUpdate - bar.EXISTING_COMBO_POINTS = 0 - bar.LAST_COMBO_POINTS = 0 self:RegisterEvent('UNIT_COMBO_POINTS', Path, true) self:RegisterEvent('PLAYER_TARGET_CHANGED', Path, true) self:RegisterEvent('UNIT_AURA', Path, true) - local cpoints = bar.CPoints; + local cpoints = bar.Combo; if(cpoints) then for index = 1, MAX_COMBO_POINTS do local cpoint = cpoints[index] @@ -206,7 +169,7 @@ end local Disable = function(self) local bar = self.HyperCombo if(bar) then - local cpoints = bar.CPoints; + local cpoints = bar.Combo; if(cpoints) then for index = 1, MAX_COMBO_POINTS do cpoints[index]:Hide() diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MainTank/oUF_MainTank.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MainTank/oUF_MainTank.lua deleted file mode 100644 index 9e2c149..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MainTank/oUF_MainTank.lua +++ /dev/null @@ -1,69 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; ---BLIZZARD API -local UnitInRaid = _G.UnitInRaid; -local GetRaidRosterInfo = _G.GetRaidRosterInfo; -local UnitHasVehicleUI = _G.UnitHasVehicleUI; - -local parent, ns = ... -local oUF = ns.oUF - -local Update = function(self, event) - local raidID = UnitInRaid(self.unit) - if(not raidID) then return end - - local maintank = self.MainTank - if(maintank.PreUpdate) then - maintank:PreUpdate() - end - - local _, _, _, _, _, _, _, _, _, rinfo = GetRaidRosterInfo(raidID) - if(rinfo == 'MAINTANK' and not UnitHasVehicleUI(self.unit)) then - self.MainTank:Show() - else - self.MainTank:Hide() - end - - if(maintank.PostUpdate) then - return maintank:PostUpdate(rinfo) - end -end - -local Path = function(self, ...) - return (self.MainTank.Override or Update)(self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, 'ForceUpdate') -end - -local Enable = function(self) - local mt = self.MainTank - - if(mt) then - mt.__owner = self - mt.ForceUpdate = ForceUpdate - - self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true) - - if(mt:IsObjectType'Texture' and not mt:GetTexture()) then - mt:SetTexture[[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]] - end - - return true - end -end - -local Disable = function(self) - local mt = self.MainTank - - if (mt) then - self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path) - end -end - -oUF:AddElement('MainTank', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Necromancy/oUF_Necromancy.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Necromancy/oUF_Necromancy.lua new file mode 100644 index 0000000..1cc3b91 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Necromancy/oUF_Necromancy.lua @@ -0,0 +1,115 @@ +if select(2, UnitClass("player")) ~= "DEATHKNIGHT" then return end + + +local parent, ns = ... +local oUF = ns.oUF +local floor = math.floor + +local runeColors = { + {0.75, 0, 0}, -- blood + {0.1, 0.75, 0}, -- unholy + {0, 0.5, 0.75}, -- frost + {0.5, 0, 1}, -- death +} + +local runemap = { 1, 2, 5, 6, 3, 4 } +local BLOOD_OF_THE_NORTH = 54637 +local OnUpdate = function(self, elapsed) + local duration = self.duration + elapsed + if(duration >= self.max) then + return self:SetScript("OnUpdate", nil) + else + self.duration = duration + return self:SetValue(duration) + end +end + +local spellName = GetSpellInfo(54637) +local UpdateType = function(self, event, rid, alt) + local isUsable = IsUsableSpell(spellName) + local rune = self.Necromancy[runemap[rid]] + local runeType = GetRuneType(rid) or alt + if isUsable and runeType == 1 then runeType = 4; end + if(rune.bar.Change) then + rune.bar:Change(runeType) + end + if not runeType then return; end + local colors = runeColors[runeType] + local r, g, b = colors[1], colors[2], colors[3] + rune.bar:SetStatusBarColor(r, g, b) +end + +local UpdateRune = function(self, event, rid) + local rune = self.Necromancy[runemap[rid]] + if(rune) then + local start, duration, runeReady = GetRuneCooldown(rid) + if(runeReady) then + rune.bar:SetMinMaxValues(0, 1) + rune.bar:SetValue(1) + rune.bar:SetScript("OnUpdate", nil) + else + rune.bar.duration = GetTime() - start + rune.bar.max = duration + rune.bar:SetMinMaxValues(1, duration) + rune.bar:SetScript("OnUpdate", OnUpdate) + end + end +end + +local Update = function(self, event) + for i=1, 6 do + UpdateRune(self, event, i) + end +end + +local function UpdateAllRuneTypes(self) + if(self) then + for i=1, 6 do + UpdateType(self, nil, i) + end + end +end + +local ForceUpdate = function(element) + return Update(element.__owner, 'ForceUpdate') +end + +local Enable = function(self, unit) + local runes = self.Necromancy + if(runes and unit == 'player') then + runes.__owner = self + runes.ForceUpdate = ForceUpdate + + self:RegisterEvent("RUNE_POWER_UPDATE", UpdateRune, true) + self:RegisterEvent("RUNE_TYPE_UPDATE", UpdateType, true) --I have no idea why this won't fire on initial login. + self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateAllRuneTypes) + + if not runes.UpdateAllRuneTypes then runes.UpdateAllRuneTypes = UpdateAllRuneTypes end + + for i=1, 6 do + UpdateType(self, nil, i, floor((runemap[i]+1)/2)) + end + + RuneFrame.Show = RuneFrame.Hide + RuneFrame:Hide() + + return true + end +end + +local Disable = function(self) + RuneFrame.Show = nil + RuneFrame:Show() + + + local runes = self.Necromancy + if(runes) then + runes:SetScript('OnUpdate', nil) + + self:UnregisterEvent("RUNE_POWER_UPDATE", UpdateRune) + self:UnregisterEvent("RUNE_TYPE_UPDATE", UpdateType) + self:UnregisterEvent("PLAYER_ENTERING_WORLD", UpdateAllRuneTypes) + end +end + +oUF:AddElement("Necromancy", Update, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua index a40210b..bd70c67 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua @@ -28,91 +28,104 @@ local SPEC_WARLOCK_DESTRUCTION = SPEC_WARLOCK_DESTRUCTION local SPEC_WARLOCK_AFFLICTION = SPEC_WARLOCK_AFFLICTION local SPEC_WARLOCK_DEMONOLOGY = SPEC_WARLOCK_DEMONOLOGY -oUF.colors.WarlockShards = { - [1] = {100/255, 0/255, 255/255}, - [2] = {180/255, 30/255, 255/255}, - [3] = {255/255, 115/255, 10/255} +local shardColor = { + [1] = {0.57,0.08,1}, + [2] = {1,0,0}, + [3] = {1,0.25,0} } local Update = function(self, event, unit, powerType) - local wsb = self.WarlockShards - if(wsb.PreUpdate) then wsb:PreUpdate(unit) end + local bar = self.WarlockShards; + local fury = bar.DemonicFury; + local maxBars = bar.MaxCount or 4; + + if(bar.PreUpdate) then bar:PreUpdate(unit) end if UnitHasVehicleUI("player") then - wsb:Hide() + bar:Hide() else - wsb:Show() + bar:Show() end local spec = GetSpecialization() + if spec then - if not wsb:IsShown() then - wsb:Show() + if not bar:IsShown() then + bar:Show() end - for i = 1, 4 do - wsb[i]:Show() - wsb[i]:SetStatusBarColor(unpack(oUF.colors.WarlockShards[spec])) + if((not bar.CurrentSpec) or (bar.CurrentSpec ~= spec and bar.UpdateTextures)) then + bar:UpdateTextures(spec) end - if (spec == SPEC_WARLOCK_DESTRUCTION) then + local colors = shardColor[spec] + + if (spec == SPEC_WARLOCK_DESTRUCTION) then + if fury:IsShown() then fury:Hide() end; local maxPower = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) local power = UnitPower("player", SPELL_POWER_BURNING_EMBERS, true) local numEmbers = power / MAX_POWER_PER_EMBER local numBars = floor(maxPower / MAX_POWER_PER_EMBER) - wsb.number = numBars - - -- bar unavailable - if numBars == 3 then - wsb[4]:Hide() - else - wsb[4]:Show() - end - for i = 1, numBars do - wsb[i]:SetMinMaxValues((MAX_POWER_PER_EMBER * i) - MAX_POWER_PER_EMBER, MAX_POWER_PER_EMBER * i) - wsb[i]:SetValue(power) + for i = 1, maxBars do + if((i == maxBars) and (numBars == 3)) then + bar[i]:Hide() + else + bar[i]:Show() + bar[i]:SetStatusBarColor(unpack(colors)) + bar[i]:SetMinMaxValues((MAX_POWER_PER_EMBER * i) - MAX_POWER_PER_EMBER, MAX_POWER_PER_EMBER * i) + bar[i]:SetValue(power) + if(bar[i].Update) then + local filled = (power >= MAX_POWER_PER_EMBER * i) and 1 or 0 + bar[i]:Update(filled) + end + end end elseif ( spec == SPEC_WARLOCK_AFFLICTION ) then + if fury:IsShown() then fury:Hide() end; local numShards = UnitPower("player", SPELL_POWER_SOUL_SHARDS) local maxShards = UnitPowerMax("player", SPELL_POWER_SOUL_SHARDS) - wsb.number = maxShards - - -- bar unavailable - if maxShards == 3 then - wsb[4]:Hide() - else - wsb[4]:Show() - end - - for i = 1, maxShards do - wsb[i]:SetMinMaxValues(0, 1) - if i <= numShards then - wsb[i]:SetValue(1) + + for i = 1, maxBars do + if((i == maxBars) and (maxShards == 3)) then + bar[i]:Hide() else - wsb[i]:SetValue(0) + bar[i]:Show() + bar[i]:SetStatusBarColor(unpack(colors)) + bar[i]:SetMinMaxValues(0, 1) + local filled = (i <= numShards) and 1 or 0 + bar[i]:SetValue(filled) + if(bar[i].Update) then + bar[i]:Update(filled) + end end end elseif spec == SPEC_WARLOCK_DEMONOLOGY then + if not fury:IsShown() then fury:Show() end; local power = UnitPower("player", SPELL_POWER_DEMONIC_FURY) local maxPower = UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) + local percent = (power / maxPower) * 100 + + for i = 1, maxBars do + bar[i]:Hide() + end - wsb.number = 1 - wsb[2]:Hide() - wsb[3]:Hide() - wsb[4]:Hide() + fury.bar:SetStatusBarColor(unpack(colors)) + fury.bar:SetMinMaxValues(0, maxPower) + fury.bar:SetValue(power) - wsb[1]:SetMinMaxValues(0, maxPower) - wsb[1]:SetValue(power) + if(fury.bar.Update) then + local filled = (percent > 80) and 1 or 0 + fury.bar:Update(filled) + end end else - if wsb:IsShown() then - wsb:Hide() - end + if bar:IsShown() then bar:Hide() end; + if fury:IsShown() then fury:Hide() end; end - if(wsb.PostUpdate) then - return wsb:PostUpdate(unit, spec) + if(bar.PostUpdate) then + return bar:PostUpdate(unit, spec) end end @@ -127,35 +140,36 @@ end local function Enable(self, unit) if(unit ~= 'player') then return end - local wsb = self.WarlockShards - if(wsb) then - wsb.__owner = self - wsb.ForceUpdate = ForceUpdate + local bar = self.WarlockShards + if(bar) then + bar.__owner = self + bar.ForceUpdate = ForceUpdate self:RegisterEvent('UNIT_POWER', Path) self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) - for i = 1, 4 do - if not wsb[i]:GetStatusBarTexture() then - wsb[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + local maxBars = bar.MaxCount or 4; + for i = 1, maxBars do + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end - wsb[i]:SetFrameLevel(wsb:GetFrameLevel() + 1) - wsb[i]:GetStatusBarTexture():SetHorizTile(false) + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) end - - wsb.number = 4 return true end end local function Disable(self) - local wsb = self.WarlockShards - if(wsb) then + local bar = self.WarlockShards + if(bar) then self:UnregisterEvent('UNIT_POWER', Path) self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) - wsb:Hide() + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) + bar:Hide() end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/cpoints.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/cpoints.lua deleted file mode 100644 index ee12aec..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/cpoints.lua +++ /dev/null @@ -1,77 +0,0 @@ -local parent, ns = ... -local oUF = ns.oUF - -local GetComboPoints = GetComboPoints -local MAX_COMBO_POINTS = MAX_COMBO_POINTS - -local Update = function(self, event, unit) - if(unit == 'pet') then return end - - local cpoints = self.CPoints - if(cpoints.PreUpdate) then - cpoints:PreUpdate() - end - - local cp - if(UnitHasVehicleUI'player') then - cp = GetComboPoints('vehicle', 'target') - else - cp = GetComboPoints('player', 'target') - end - - for i=1, MAX_COMBO_POINTS do - if(i <= cp) then - cpoints[i]:Show() - else - cpoints[i]:Hide() - end - end - - if(cpoints.PostUpdate) then - return cpoints:PostUpdate(cp) - end -end - -local Path = function(self, ...) - return (self.CPoints.Override or Update) (self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, 'ForceUpdate', element.__owner.unit) -end - -local Enable = function(self) - local cpoints = self.CPoints - if(cpoints) then - cpoints.__owner = self - cpoints.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_COMBO_POINTS', Path, true) - self:RegisterEvent('PLAYER_TARGET_CHANGED', Path, true) - self:RegisterEvent('UNIT_AURA', Path, true) - - for index = 1, MAX_COMBO_POINTS do - local cpoint = cpoints[index] - if(cpoint:IsObjectType'Texture' and not cpoint:GetTexture()) then - cpoint:SetTexture[[Interface\ComboFrame\ComboPoint]] - cpoint:SetTexCoord(0, 0.375, 0, 1) - end - end - - return true - end -end - -local Disable = function(self) - local cpoints = self.CPoints - if(cpoints) then - for index = 1, MAX_COMBO_POINTS do - cpoints[index]:Hide() - end - self:UnregisterEvent('UNIT_COMBO_POINTS', Path) - self:UnregisterEvent('PLAYER_TARGET_CHANGED', Path) - self:UnregisterEvent('UNIT_AURA', Path) - end -end - -oUF:AddElement('CPoints', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/druidmana.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/druidmana.lua deleted file mode 100644 index 2dc1673..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/druidmana.lua +++ /dev/null @@ -1,114 +0,0 @@ --- Druid Mana Bar for Cat and Bear forms --- Authors: Califpornia aka Ennie // some code taken from oUF`s EclipseBar element -if(select(2, UnitClass('player')) ~= 'DRUID') then return end - -local _, ns = ... -local oUF = ns.oUF - -local function Update(self, event, unit, powertype) - --only the player frame will have this unit enable - --i mainly place this check for UNIT_DISPLAYPOWER and entering a vehicle - if(unit ~= 'player' or (powertype and powertype ~= 'MANA')) then return end - - local druidmana = self.DruidMana - if(druidmana.PreUpdate) then druidmana:PreUpdate(unit) end - - --check form - if(UnitPowerType('player') == SPELL_POWER_MANA) then - return druidmana:Hide() - else - druidmana:Show() - end - - local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA) - druidmana:SetMinMaxValues(0, max) - druidmana:SetValue(min) - - local r, g, b, t - if(druidmana.colorClass) then - t = self.colors.class['DRUID'] - elseif(druidmana.colorSmooth) then - r, g, b = self.ColorGradient(min, max, unpack(druidmana.smoothGradient or self.colors.smooth)) - elseif(druidmana.colorPower) then - t = self.colors.power['MANA'] - end - - if(t) then - r, g, b = t[1], t[2], t[3] - end - - if(b) then - druidmana:SetStatusBarColor(r, g, b) - - local bg = druidmana.bg - if(bg) then - local mu = bg.multiplier or 1 - bg:SetVertexColor(r * mu, g * mu, b * mu) - end - end - - if(druidmana.PostUpdate) then - return druidmana:PostUpdate(unit, min, max) - end -end - -local function Path(self, ...) - return (self.DruidMana.Override or Update) (self, ...) -end - -local function ForceUpdate(element) - return Path(element.__owner, 'ForceUpdate', element.__owner.unit) -end - -local OnDruidManaUpdate -do - local UnitPower = UnitPower - OnDruidManaUpdate = function(self) - local unit = self.__owner.unit - local mana = UnitPower(unit, SPELL_POWER_MANA) - - if(mana ~= self.min) then - self.min = mana - return Path(self.__owner, 'OnDruidManaUpdate', unit) - end - end -end - -local Enable = function(self, unit) - local druidmana = self.DruidMana - if(druidmana and unit == 'player') then - druidmana.__owner = self - druidmana.ForceUpdate = ForceUpdate - - if(druidmana.frequentUpdates) then - druidmana:SetScript('OnUpdate', OnDruidManaUpdate) - else - self:RegisterEvent('UNIT_POWER', Path) - end - - self:RegisterEvent('UNIT_DISPLAYPOWER', Path) - self:RegisterEvent('UNIT_MAXPOWER', Path) - - if(druidmana:IsObjectType'StatusBar' and not druidmana:GetStatusBarTexture()) then - druidmana:SetStatusBarTexture[[Interface\TargetingFrame\UI-StatusBar]] - end - - return true - end -end - -local Disable = function(self) - local druidmana = self.DruidMana - if(druidmana) then - if(druidmana:GetScript'OnUpdate') then - druidmana:SetScript("OnUpdate", nil) - else - self:UnregisterEvent('UNIT_POWER', Path) - end - - self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) - self:UnregisterEvent('UNIT_MAXPOWER', Path) - end -end - -oUF:AddElement('DruidMana', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/eclipsebar.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/eclipsebar.lua deleted file mode 100644 index 8653f0f..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/eclipsebar.lua +++ /dev/null @@ -1,144 +0,0 @@ ---[[ Element: Eclipse Bar - - THIS FILE HEAVILY MODIFIED FOR USE WITH SUPERVILLAIN UI - -]] -if(select(2, UnitClass('player')) ~= 'DRUID') then return end - -local parent, ns = ... -local oUF = ns.oUF - -local ECLIPSE_BAR_SOLAR_BUFF_ID = ECLIPSE_BAR_SOLAR_BUFF_ID -local ECLIPSE_BAR_LUNAR_BUFF_ID = ECLIPSE_BAR_LUNAR_BUFF_ID -local SPELL_POWER_ECLIPSE = SPELL_POWER_ECLIPSE -local MOONKIN_FORM = MOONKIN_FORM - -local UNIT_POWER = function(self, event, unit, powerType) - if(self.unit ~= unit or (event == 'UNIT_POWER' and powerType ~= 'ECLIPSE')) then return end - - local eb = self.EclipseBar - - local power = UnitPower('player', SPELL_POWER_ECLIPSE) - local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) - - if(eb.LunarBar) then - eb.LunarBar:SetMinMaxValues(-maxPower, maxPower) - eb.LunarBar:SetValue(power) - end - - if(eb.SolarBar) then - eb.SolarBar:SetMinMaxValues(-maxPower, maxPower) - eb.SolarBar:SetValue(power * -1) - end - - if(eb.PostUpdatePower) then - return eb:PostUpdatePower(unit) - end -end - -local UPDATE_VISIBILITY = function(self, event) - local eb = self.EclipseBar - - -- check form/mastery - local showBar - local form = GetShapeshiftFormID() - if(not form) then - local ptt = GetSpecialization() - if(ptt and ptt == 1) then -- player has balance spec - showBar = true - end - elseif(form == MOONKIN_FORM) then - showBar = true - end - - if(showBar) then - eb:Show() - else - eb:Hide() - end - - if(eb.PostUpdateVisibility) then - return eb:PostUpdateVisibility(self.unit) - end -end - -local UNIT_AURA = function(self, event, unit) - if(self.unit ~= unit) or not unit then return end - - local i = 1 - local hasSolarEclipse, hasLunarEclipse - repeat - local _, _, _, _, _, _, _, _, _, _, spellID = UnitAura(unit, i, 'HELPFUL') - - if(spellID == ECLIPSE_BAR_SOLAR_BUFF_ID) then - hasSolarEclipse = true - elseif(spellID == ECLIPSE_BAR_LUNAR_BUFF_ID) then - hasLunarEclipse = true - end - - i = i + 1 - until not spellID - - local eb = self.EclipseBar - eb.hasSolarEclipse = hasSolarEclipse - eb.hasLunarEclipse = hasLunarEclipse - - if(eb.PostUnitAura) then - return eb:PostUnitAura(unit) - end -end - -local ECLIPSE_DIRECTION_CHANGE = function(self, event, status) - local eb = self.EclipseBar - - if(status and eb:IsVisible() and eb.PostDirectionChange[status]) then - return eb.PostDirectionChange[status](eb) - end -end - -local Update = function(self, ...) - UNIT_POWER(self, ...) - UNIT_AURA(self, ...) - return UPDATE_VISIBILITY(self, ...) -end - -local ForceUpdate = function(element) - return Update(element.__owner, 'ForceUpdate', element.__owner.unit, 'ECLIPSE') -end - -local function Enable(self) - local eb = self.EclipseBar - if(eb) then - eb.__owner = self - eb.ForceUpdate = ForceUpdate - - if(eb.LunarBar and eb.LunarBar:IsObjectType'StatusBar' and not eb.LunarBar:GetStatusBarTexture()) then - eb.LunarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) - end - if(eb.SolarBar and eb.SolarBar:IsObjectType'StatusBar' and not eb.SolarBar:GetStatusBarTexture()) then - eb.SolarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) - end - - self:RegisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE, true) - self:RegisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY, true) - self:RegisterEvent('UNIT_AURA', UNIT_AURA) - self:RegisterEvent('UNIT_POWER', UNIT_POWER) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY, true) - - return true - end -end - -local function Disable(self) - local eb = self.EclipseBar - if(eb) then - eb:Hide() - self:UnregisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE) - self:UnregisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY) - self:UnregisterEvent('UNIT_AURA', UNIT_AURA) - self:UnregisterEvent('UNIT_POWER', UNIT_POWER) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY) - end -end - -oUF:AddElement('EclipseBar', Update, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/maintank.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/maintank.lua new file mode 100644 index 0000000..9e2c149 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/maintank.lua @@ -0,0 +1,69 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +--BLIZZARD API +local UnitInRaid = _G.UnitInRaid; +local GetRaidRosterInfo = _G.GetRaidRosterInfo; +local UnitHasVehicleUI = _G.UnitHasVehicleUI; + +local parent, ns = ... +local oUF = ns.oUF + +local Update = function(self, event) + local raidID = UnitInRaid(self.unit) + if(not raidID) then return end + + local maintank = self.MainTank + if(maintank.PreUpdate) then + maintank:PreUpdate() + end + + local _, _, _, _, _, _, _, _, _, rinfo = GetRaidRosterInfo(raidID) + if(rinfo == 'MAINTANK' and not UnitHasVehicleUI(self.unit)) then + self.MainTank:Show() + else + self.MainTank:Hide() + end + + if(maintank.PostUpdate) then + return maintank:PostUpdate(rinfo) + end +end + +local Path = function(self, ...) + return (self.MainTank.Override or Update)(self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate') +end + +local Enable = function(self) + local mt = self.MainTank + + if(mt) then + mt.__owner = self + mt.ForceUpdate = ForceUpdate + + self:RegisterEvent('GROUP_ROSTER_UPDATE', Path, true) + + if(mt:IsObjectType'Texture' and not mt:GetTexture()) then + mt:SetTexture[[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]] + end + + return true + end +end + +local Disable = function(self) + local mt = self.MainTank + + if (mt) then + self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path) + end +end + +oUF:AddElement('MainTank', Path, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/runebar.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/runebar.lua deleted file mode 100644 index a1077c5..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/runebar.lua +++ /dev/null @@ -1,164 +0,0 @@ ---[[ Element: Runes Bar - - Handle updating and visibility of the Death Knight's Rune indicators. - - Widget - - Runes - An array holding six StatusBar's. - - Sub-Widgets - - .bg - A Texture which functions as a background. It will inherit the color of - the main StatusBar. - - Notes - - The default StatusBar texture will be applied if the UI widget doesn't have a - status bar texture or color defined. - - Sub-Widgets Options - - .multiplier - Defines a multiplier, which is used to tint the background based - on the main widgets R, G and B values. Defaults to 1 if not - present. - - Examples - - local Runes = {} - for index = 1, 6 do - -- Position and size of the rune bar indicators - local Rune = CreateFrame('StatusBar', nil, self) - Rune:SetSize(120 / 6, 20) - Rune:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', index * 120 / 6, 0) - - Runes[index] = Rune - end - - -- Register with oUF - self.Runes = Runes -]] - -if select(2, UnitClass("player")) ~= "DEATHKNIGHT" then return end - - -local parent, ns = ... -local oUF = ns.oUF -local floor = math.floor - -oUF.colors.Runes = { - {0.75, 0, 0}, -- blood - {0.1, 0.75, 0}, -- unholy - {0, 0.5, 0.75}, -- frost - {0.5, 0, 1}, -- death -} - -local runemap = { 1, 2, 5, 6, 3, 4 } -local BLOOD_OF_THE_NORTH = 54637 -local OnUpdate = function(self, elapsed) - local duration = self.duration + elapsed - if(duration >= self.max) then - return self:SetScript("OnUpdate", nil) - else - self.duration = duration - return self:SetValue(duration) - end -end - -local spellName = GetSpellInfo(54637) -local UpdateType = function(self, event, rid, alt) - local isUsable = IsUsableSpell(spellName) - local rune = self.Runes[runemap[rid]] - local runeType = GetRuneType(rid) or alt - if isUsable and runeType == 1 then runeType = 4; end - if(rune.bar.Change) then - rune.bar:Change(runeType) - end - if not runeType then return; end - local colors = oUF.colors.Runes[runeType] - local r, g, b = colors[1], colors[2], colors[3] - rune.bar:SetStatusBarColor(r, g, b) -end - -local UpdateRune = function(self, event, rid) - local rune = self.Runes[runemap[rid]] - if(rune) then - local start, duration, runeReady = GetRuneCooldown(rid) - if(runeReady) then - rune.bar:SetMinMaxValues(0, 1) - rune.bar:SetValue(1) - rune.bar:SetScript("OnUpdate", nil) - else - rune.bar.duration = GetTime() - start - rune.bar.max = duration - rune.bar:SetMinMaxValues(1, duration) - rune.bar:SetScript("OnUpdate", OnUpdate) - end - -- if(rune.bar.Change) then - -- rune.bar:Change(runeType) - -- end - end -end - -local Update = function(self, event) - for i=1, 6 do - UpdateRune(self, event, i) - end -end - -local function UpdateAllRuneTypes(self) - if(self) then - for i=1, 6 do - UpdateType(self, nil, i) - end - end -end - -local ForceUpdate = function(element) - return Update(element.__owner, 'ForceUpdate') -end - -local Enable = function(self, unit) - local runes = self.Runes - if(runes and unit == 'player') then - runes.__owner = self - runes.ForceUpdate = ForceUpdate - - self:RegisterEvent("RUNE_POWER_UPDATE", UpdateRune, true) - self:RegisterEvent("RUNE_TYPE_UPDATE", UpdateType, true) --I have no idea why this won't fire on initial login. - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateAllRuneTypes) - - if not runes.UpdateAllRuneTypes then runes.UpdateAllRuneTypes = UpdateAllRuneTypes end - - for i=1, 6 do - -- From my minor testing this is a okey solution. A full login always remove - -- the death runes, or at least the clients knowledge about them. - UpdateType(self, nil, i, floor((runemap[i]+1)/2)) - end - - -- oUF leaves the vehicle events registered on the player frame, so - -- buffs and such are correctly updated when entering/exiting vehicles. - -- - -- This however makes the code also show/hide the RuneFrame. - RuneFrame.Show = RuneFrame.Hide - RuneFrame:Hide() - - return true - end -end - -local Disable = function(self) - RuneFrame.Show = nil - RuneFrame:Show() - - - local runes = self.Runes - if(runes) then - runes:SetScript('OnUpdate', nil) - - self:UnregisterEvent("RUNE_POWER_UPDATE", UpdateRune) - self:UnregisterEvent("RUNE_TYPE_UPDATE", UpdateType) - self:UnregisterEvent("PLAYER_ENTERING_WORLD", UpdateAllRuneTypes) - end -end - -oUF:AddElement("Runes", Update, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/stagger.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/stagger.lua deleted file mode 100644 index 6cc7dc9..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/stagger.lua +++ /dev/null @@ -1,140 +0,0 @@ -local parent, ns = ... -local oUF = ns.oUF - --- percentages at which the bar should change color -local STAGGER_YELLOW_TRANSITION = STAGGER_YELLOW_TRANSITION -local STAGGER_RED_TRANSITION = STAGGER_RED_TRANSITION - --- table indices of bar colors -local GREEN_INDEX = 1; -local YELLOW_INDEX = 2; -local RED_INDEX = 3; - -local STANCE_OF_THE_STURY_OX_ID = 23 - -local UnitHealthMax = UnitHealthMax -local UnitStagger = UnitStagger - -local _, playerClass = UnitClass("player") - --- TODO: fix color in the power element -oUF.colors.power[BREWMASTER_POWER_BAR_NAME] = { - {0.52, 1.0, 0.52}, - {1.0, 0.98, 0.72}, - {1.0, 0.42, 0.42}, -} -local color = oUF.colors.power[BREWMASTER_POWER_BAR_NAME] - -local function UpdateMaxValues(self) - local stagger = self.Stagger - if(stagger) then - local maxhealth = UnitHealthMax("player"); - stagger:SetMinMaxValues(0, maxhealth); - end -end - -local Update = function(self, event, unit) - if unit and unit ~= self.unit then return end - local element = self.Stagger - - if(element.PreUpdate) then - element:PreUpdate() - end - - local maxHealth = UnitHealthMax("player") - local stagger = UnitStagger("player") - local staggerPercent = stagger / maxHealth - - element:SetMinMaxValues(0, maxHealth) - element:SetValue(stagger) - - local rgb - if(staggerPercent >= STAGGER_RED_TRANSITION) then - rgb = color[RED_INDEX] - elseif(staggerPercent > STAGGER_YELLOW_TRANSITION) then - rgb = color[YELLOW_INDEX] - else - rgb = color[GREEN_INDEX] - end - - local r, g, b = rgb[1], rgb[2], rgb[3] - element:SetStatusBarColor(r, g, b) - - local bg = element.bg - if(bg) then - local mu = bg.multiplier or 1 - bg:SetVertexColor(r * mu, g * mu, b * mu) - end - - if(element.PostUpdate) then - element:PostUpdate(maxHealth, stagger, staggerPercent, r, g, b) - end -end - -local Path = function(self, ...) - return (self.Stagger.Override or Update)(self, ...) -end - -local Visibility = function(self, event, unit) - if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then - if self.Stagger:IsShown() then - self.Stagger:Hide() - self:UnregisterEvent('UNIT_AURA', Path) - end - elseif not self.Stagger:IsShown() then - self.Stagger:Show() - self:RegisterEvent('UNIT_AURA', Path) - return Path(self, event, unit) - end -end - -local VisibilityPath = function(self, ...) - return (self.Stagger.OverrideVisibility or Visibility)(self, ...) -end - -local ForceUpdate = function(element) - return VisibilityPath(element.__owner, "ForceUpdate", element.__owner.unit) -end - -local Enable = function(self, unit) - if(playerClass ~= "MONK" or unit ~= 'player') then return end - - local element = self.Stagger - if(element) then - element.__owner = self - element.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_DISPLAYPOWER', VisibilityPath) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', VisibilityPath) - - if(element:IsObjectType'StatusBar' and not element:GetStatusBarTexture()) then - element:SetStatusBarTexture[[Interface\TargetingFrame\UI-StatusBar]] - end - - MonkStaggerBar.Hide = MonkStaggerBar.Show - MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' - MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' - MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' - MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - return true - end -end - -local Disable = function(self) - local element = self.Stagger - if(element) then - element:Hide() - self:UnregisterEvent('UNIT_AURA', Path) - self:UnregisterEvent('UNIT_DISPLAYPOWER', VisibilityPath) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', VisibilityPath) - - MonkStaggerBar.Show = nil - MonkStaggerBar:Show() - MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' - MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' - MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' - MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - end -end - -oUF:AddElement("Stagger", VisibilityPath, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/totems.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/totems.lua deleted file mode 100644 index c504fd4..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/totems.lua +++ /dev/null @@ -1,133 +0,0 @@ -local parent, ns = ... -local oUF = ns.oUF - -oUF.colors.totems = { - [FIRE_TOTEM_SLOT] = { 181/255, 073/255, 033/255 }, - [EARTH_TOTEM_SLOT] = { 074/255, 142/255, 041/255 }, - [WATER_TOTEM_SLOT] = { 057/255, 146/255, 181/255 }, - [AIR_TOTEM_SLOT] = { 132/255, 056/255, 231/255 } -} - -local priorities = STANDARD_TOTEM_PRIORITIES -if(select(2, UnitClass'player') == 'SHAMAN') then - priorities = SHAMAN_TOTEM_PRIORITIES -end - -local OnClick = function(self) - DestroyTotem(self:GetID()) -end - -local UpdateTooltip = function(self) - GameTooltip:SetTotem(self:GetID()) -end - -local OnEnter = function(self) - if(not self:IsVisible()) then return end - GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT') - self:UpdateTooltip() -end - -local OnLeave = function() - GameTooltip:Hide() -end - -local UpdateTotem = function(self, event, slot) - if(slot > MAX_TOTEMS) then return end - local totems = self.Totems - - if(totems.PreUpdate) then totems:PreUpdate(priorities[slot]) end - - local totem = totems[priorities[slot]] - local haveTotem, name, start, duration, icon = GetTotemInfo(slot) - if(duration > 0) then - if(totem.Icon) then - totem.Icon:SetTexture(icon) - end - - if(totem.Cooldown) then - totem.Cooldown:SetCooldown(start, duration) - end - - totem:Show() - else - totem:Hide() - end - - if(totems.PostUpdate) then - return totems:PostUpdate(priorities[slot], haveTotem, name, start, duration, icon) - end -end - -local Path = function(self, ...) - return (self.Totems.Override or UpdateTotem) (self, ...) -end - -local Update = function(self, event) - for i = 1, MAX_TOTEMS do - Path(self, event, i) - end -end - -local ForceUpdate = function(element) - return Update(element.__owner, 'ForceUpdate') -end - -local Enable = function(self) - local totems = self.Totems - - if(totems) then - totems.__owner = self - totems.__map = { unpack(priorities) } - totems.ForceUpdate = ForceUpdate - - for i = 1, MAX_TOTEMS do - local totem = totems[i] - - totem:SetID(priorities[i]) - - if(totem:HasScript'OnClick') then - totem:SetScript('OnClick', OnClick) - end - - if(totem:IsMouseEnabled()) then - totem:SetScript('OnEnter', OnEnter) - totem:SetScript('OnLeave', OnLeave) - - if(not totem.UpdateTooltip) then - totem.UpdateTooltip = UpdateTooltip - end - end - end - - self:RegisterEvent('PLAYER_TOTEM_UPDATE', Path, true) - - TotemFrame.Show = TotemFrame.Hide - TotemFrame:Hide() - - TotemFrame:UnregisterEvent"PLAYER_TOTEM_UPDATE" - TotemFrame:UnregisterEvent"PLAYER_ENTERING_WORLD" - TotemFrame:UnregisterEvent"UPDATE_SHAPESHIFT_FORM" - TotemFrame:UnregisterEvent"PLAYER_TALENT_UPDATE" - - return true - end -end - -local Disable = function(self) - if(self.Totems) then - for i = 1, MAX_TOTEMS do - self.Totems[i]:Hide() - end - TotemFrame.Show = nil - TotemFrame:Show() - - TotemFrame:RegisterEvent"PLAYER_TOTEM_UPDATE" - TotemFrame:RegisterEvent"PLAYER_ENTERING_WORLD" - TotemFrame:RegisterEvent"UPDATE_SHAPESHIFT_FORM" - TotemFrame:RegisterEvent"PLAYER_TALENT_UPDATE" - - self:UnregisterEvent('PLAYER_TOTEM_UPDATE', Path) - end -end - -oUF:AddElement("Totems", Update, Enable, Disable) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml index b595d50..890bb5a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml @@ -14,7 +14,6 @@ <Script file='oUF\elements\power.lua' /> <Script file='oUF\elements\aura.lua' /> <Script file='oUF\elements\health.lua' /> - <Script file='oUF\elements\cpoints.lua' /> <Script file='oUF\elements\ricons.lua' /> <Script file='oUF\elements\leader.lua' /> <Script file='oUF\elements\combat.lua' /> @@ -26,19 +25,15 @@ <Script file='oUF\elements\threat.lua' /> <Script file='oUF\elements\tags.lua' /> <Script file='oUF\elements\masterlooter.lua' /> - <Script file='oUF\elements\assistant.lua' /> - <Script file='oUF\elements\runebar.lua' /> <Script file='oUF\elements\lfdrole.lua' /> <Script file='oUF\elements\healprediction.lua' /> <Script file='oUF\elements\picon.lua' /> <Script file='oUF\elements\readycheck.lua' /> <Script file='oUF\elements\qicon.lua' /> - <Script file='oUF\elements\eclipsebar.lua' /> <Script file='oUF\elements\altpowerbar.lua' /> - <Script file='oUF\elements\totems.lua' /> <Script file='oUF\elements\resurrect.lua' /> - <Script file='oUF\elements\druidmana.lua' /> - <Script file='oUF\elements\stagger.lua' /> + <Script file='oUF\elements\assistant.lua' /> + <Script file='oUF\elements\maintank.lua' /> <!-- Clique support --> <Button name="oUF_ClickCastUnitTemplate" virtual="true" inherits="SecureUnitButtonTemplate,SecureHandlerEnterLeaveTemplate"> @@ -62,7 +57,6 @@ <Script file="plugins\oUF_AuraBars\oUF_AuraBars.lua"/> <Script file="plugins\oUF_RaidDebuffs\oUF_RaidDebuffs.lua"/> <Script file="plugins\oUF_Smooth\oUF_Smooth.lua"/> - <Script file="plugins\oUF_DruidMana\oUF_DruidMana.lua"/> <Script file="plugins\oUF_CombatFader\oUF_CombatFader.lua"/> <Script file="plugins\oUF_Experience\oUF_Experience.lua"/> <Script file="plugins\oUF_Reputation\oUF_Reputation.lua"/> @@ -71,7 +65,6 @@ <Script file="plugins\oUF_ActionPanel\oUF_ActionPanel.lua"/> <Script file="plugins\oUF_Afflicted\oUF_Afflicted.lua"/> <Script file="plugins\oUF_HunterTraps\oUF_HunterTraps.lua"/> - <Script file="plugins\oUF_MainTank\oUF_MainTank.lua"/> <Script file="plugins\oUF_PallyPower\oUF_PallyPower.lua"/> <Script file="plugins\oUF_WarlockShards\oUF_WarlockShards.lua"/> <Script file="plugins\oUF_PriestOrbs\oUF_PriestOrbs.lua"/> @@ -79,5 +72,8 @@ <Script file="plugins\oUF_DrunkenMaster\oUF_DrunkenMaster.lua"/> <Script file="plugins\oUF_TotemBars\oUF_TotemBars.lua"/> <Script file="plugins\oUF_HyperCombo\oUF_HyperCombo.lua"/> - <Script file="plugins\oUF_Combatant\oUF_Combatant.lua"/> + <Script file="plugins\oUF_Gladiator\oUF_Gladiator.lua"/> + <Script file="plugins\oUF_Necromancy\oUF_Necromancy.lua"/> + <Script file="plugins\oUF_Druidness\oUF_Druidness.lua"/> + <Script file="plugins\oUF_Conqueror\oUF_Conqueror.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/scenario.lua b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua index 4dde835..c5f51c0 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/scenario.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua @@ -191,7 +191,7 @@ end local SetChallengeMedals = function(self, elapsedTime, ...) self:SetHeight(INNER_HEIGHT); - local blockHeight = MOD.Block:GetHeight(); + local blockHeight = MOD.Headers["Scenario"].Block:GetHeight(); MOD.Headers["Scenario"].Block:SetHeight(blockHeight + INNER_HEIGHT + 4); self:FadeIn(); self.Bar:SetMinMaxValues(0, elapsedTime); diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 5ba5487..0361cf6 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -129,13 +129,13 @@ end local function FindAnchorFrame(frame, anchor, badPoint) if badPoint or anchor == 'FRAME' then - if(frame.Combatant and frame.Combatant:IsShown()) then - return frame.Combatant + if(frame.Gladiator and frame.Gladiator:IsShown()) then + return frame.Gladiator else return frame end - elseif(anchor == 'TRINKET' and frame.Combatant and frame.Combatant:IsShown()) then - return frame.Combatant + elseif(anchor == 'TRINKET' and frame.Gladiator and frame.Gladiator:IsShown()) then + return frame.Gladiator 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 diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index 858d45d..4650d10 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -146,7 +146,7 @@ function MOD:CreateReadyCheckIcon(frame) return rdy end -function MOD:CreateCombatant(frame) +function MOD:CreateGladiator(frame) local pvp = CreateFrame("Frame", nil, frame) pvp:SetFrameLevel(pvp:GetFrameLevel() + 1) diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index c21e255..55a4df7 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -204,12 +204,12 @@ local UpdatePlayerFrame = function(self) self:Tag(pvp, db.pvp.tags) end do - if SV.class == "DRUID" and self.DruidAltMana then + if SV.class == "DRUID" and self.DruidMana then if db.power.druidMana then - self:EnableElement("DruidAltMana") + self:EnableElement("DruidMana") else - self:DisableElement("DruidAltMana") - self.DruidAltMana:Hide() + self:DisableElement("DruidMana") + self.DruidMana:Hide() end end if SV.class == "MONK" then @@ -226,12 +226,12 @@ local UpdatePlayerFrame = function(self) end end do - if(self.DruidAltMana) then + if(self.DruidMana) then if db.power.druidMana then - self:EnableElement("DruidAltMana") + self:EnableElement("DruidMana") else - self:DisableElement("DruidAltMana") - self.DruidAltMana:Hide() + self:DisableElement("DruidMana") + self.DruidMana:Hide() end end if(self.DrunkenMaster) then @@ -246,7 +246,7 @@ local UpdatePlayerFrame = function(self) end end - if(self.ClassBar or self.HyperCombo) then + if(self.ClassBar) then if USE_CLASSBAR and self.ClassBarRefresh then self.ClassBarRefresh(self) end @@ -264,21 +264,9 @@ local UpdatePlayerFrame = function(self) classBar:Hide() end end - if(self.HyperCombo) then - if USE_CLASSBAR then - if not self:IsElementEnabled("HyperCombo") then - self:EnableElement("HyperCombo") - end - self.HyperCombo:Show() - else - if self:IsElementEnabled("HyperCombo") then - self:DisableElement("HyperCombo") - end - self.HyperCombo:Hide() - end - end end end + do if db.combatfade and not self:IsElementEnabled("CombatFade")then self:EnableElement("CombatFade") @@ -367,30 +355,6 @@ local UpdateTargetFrame = function(self) end end - if (SV.class == "ROGUE" or SV.class == "DRUID") and self.HyperCombo then - local comboBar = self.HyperCombo; - if self.ComboRefresh then - self.ComboRefresh(self) - end - if db.combobar.autoHide then - comboBar:SetParent(self) - else - comboBar:SetParent(UIParent) - end - - if comboBar.Grip then - comboBar.Grip:SetScale(0.000001) - comboBar.Grip:SetAlpha(0) - end - - if USE_COMBOBAR and not self:IsElementEnabled("HyperCombo")then - self:EnableElement("HyperCombo") - elseif not USE_COMBOBAR and self:IsElementEnabled("HyperCombo")then - self:DisableElement("HyperCombo") - comboBar:Hide() - end - end - self:UpdateAllElements() end @@ -421,12 +385,6 @@ CONSTRUCTORS["target"] = function(self, unit) self.AuraBars = MOD:CreateAuraBarHeader(self, key) self.Afflicted = MOD:CreateAfflicted(self) self.RaidIcon = MOD:CreateRaidIcon(self) - local isSmall = SV.db.SVUnit[key].combobar.smallIcons - if(SV.class == "ROGUE") then - self.HyperCombo = MOD:CreateRogueCombobar(self, isSmall) - elseif(SV.class == "DRUID") then - self.HyperCombo = MOD:CreateDruidCombobar(self, isSmall) - end --self.GPS = MOD:CreateGPS(self) self.Friendship = MOD:CreateFriendshipBar(self) @@ -800,8 +758,8 @@ local UpdateArenaFrame = function(self) MOD:RefreshUnitLayout(self, "arena") - if(self.Combatant) then - local pvp = self.Combatant + if(self.Gladiator) then + local pvp = self.Gladiator local trinket = pvp.Trinket local badge = pvp.Badge @@ -832,11 +790,11 @@ local UpdateArenaFrame = function(self) 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") + if(db.pvp.enable and (not self:IsElementEnabled("Gladiator"))) then + self:EnableElement("Gladiator") pvp:Show() - elseif((not db.pvp.enable) and self:IsElementEnabled("Combatant")) then - self:DisableElement("Combatant") + elseif((not db.pvp.enable) and self:IsElementEnabled("Gladiator")) then + self:DisableElement("Gladiator") pvp:Hide() end end @@ -866,7 +824,7 @@ 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.Combatant = MOD:CreateCombatant(self) + self.Gladiator = MOD:CreateGladiator(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:SetAttribute("type2", "focus") diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index b0a68ba..27562a2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -75,7 +75,7 @@ POSITIONING ]]-- local Reposition = function(self) local db = SV.db.SVUnit.player - local bar = self.Runes; + local bar = self.Necromancy; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; @@ -93,8 +93,6 @@ local Reposition = function(self) bar:SetAllPoints(bar.Holder) for i = 1, max do bar[i]:ClearAllPoints() - -- bar[i]:SetHeight(size*0.68) - -- bar[i]:SetWidth(size*2) bar[i]:SetHeight(size+4) bar[i]:SetWidth(size) bar[i].bar:GetStatusBarTexture():SetHorizTile(false) @@ -105,13 +103,6 @@ local Reposition = function(self) end end - -- bar[1]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 2) - -- bar[2]:SetPoint("TOPLEFT", bar[1], "BOTTOMLEFT", 0, 4) - -- bar[3]:SetPoint("LEFT", bar[1], "RIGHT", -2, 0) - -- bar[4]:SetPoint("TOPLEFT", bar[3], "BOTTOMLEFT", 0, 4) - -- bar[5]:SetPoint("LEFT", bar[3], "RIGHT", -2, 0) - -- bar[6]:SetPoint("TOPLEFT", bar[5], "BOTTOMLEFT", 0, 4) - if bar.UpdateAllRuneTypes then bar.UpdateAllRuneTypes(self) end @@ -121,17 +112,6 @@ end DEATHKNIGHT ########################################################## ]]-- -local RuneUpdate = function(self, isReady) - if(isReady) then - if(not self.FX:IsShown()) then - self.FX:Show() - end - self.FX:UpdateEffect() - else - self.FX:Hide() - end -end - local RuneChange = function(self, runeType) if(runeType and runeType == 4) then self.FX:SetEffect("rune_death") @@ -191,11 +171,10 @@ function MOD:CreateClassBar(playerFrame) local effectName = specEffects[i] SV.SpecialFX:SetFXFrame(rune.bar, effectName) - bar[i] = rune + bar[i] = rune; bar[i].bar.effectIndex = i; - bar[i].bar.Update = RuneUpdate - bar[i].bar.Change = RuneChange - bar[i].bar:SetOrientation("VERTICAL") + bar[i].bar.Change = RuneChange; + bar[i].bar:SetOrientation("VERTICAL"); end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) @@ -206,6 +185,6 @@ function MOD:CreateClassBar(playerFrame) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; - playerFrame.Runes = bar - return 'Runes' + playerFrame.Necromancy = bar + return 'Necromancy' end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index bf4a6ae..c5f822b 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -51,7 +51,29 @@ if(not MOD) then return end DRUID ALT MANA ########################################################## ]]-- -local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]] +local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]]; +local cpointColor = { + [1]={0.69,0.31,0.31}, + [2]={0.69,0.31,0.31}, + [3]={0.65,0.63,0.35}, + [4]={0.65,0.63,0.35}, + [5]={0.33,0.59,0.33} +}; + +local comboTextures = { + [1]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-CLAW-UP]], + [2]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-CLAW-DOWN]], + [3]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-BITE]], +}; + +local ShowPoint = function(self) + self:SetAlpha(1) +end + +local HidePoint = function(self) + self.Icon:SetTexture(comboTextures[random(1,3)]) + self:SetAlpha(0) +end local UpdateAltPower = function(self, unit, arg1, arg2) local value = self:GetParent().TextGrip.Power; @@ -74,37 +96,14 @@ local UpdateAltPower = function(self, unit, arg1, arg2) self.Text:SetText() end end - -local function CreateAltMana(playerFrame, eclipse) - local bar = CreateFrame("Frame", nil, playerFrame) - bar:SetFrameStrata("LOW") - bar:SetPoint("TOPLEFT", eclipse, "TOPLEFT", 38, -2) - bar:SetPoint("TOPRIGHT", eclipse, "TOPRIGHT", 0, -2) - bar:SetHeight(18) - bar:SetStylePanel("Fixed", "Default") - bar:SetFrameLevel(bar:GetFrameLevel() + 1) - bar.colorPower = true; - bar.PostUpdatePower = UpdateAltPower; - bar.ManaBar = CreateFrame("StatusBar", nil, bar) - bar.ManaBar.noupdate = true; - bar.ManaBar:SetStatusBarTexture(SV.Media.bar.glow) - bar.ManaBar:SetAllPointsIn(bar) - bar.bg = bar:CreateTexture(nil, "BORDER") - bar.bg:SetAllPoints(bar.ManaBar) - bar.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - bar.bg.multiplier = 0.3; - bar.Text = bar.ManaBar:CreateFontString(nil, "OVERLAY") - bar.Text:SetAllPoints(bar.ManaBar) - bar.Text:FontManager("unitprimary") - return bar -end --[[ ########################################################## POSITIONING ########################################################## ]]-- local Reposition = function(self) - local bar = self.EclipseBar + local bar = self.Druidness + local chicken = bar.Chicken; local db = SV.db.SVUnit.player if not bar or not db then print("Error") return end local height = db.classbar.height @@ -125,26 +124,44 @@ local Reposition = function(self) bar:ClearAllPoints() bar:SetAllPoints(bar.Holder) + + chicken:ClearAllPoints() + chicken:SetAllPoints() - bar.LunarBar:SetSizeToScale(width, adjustedBar) - bar.LunarBar:SetMinMaxValues(0,0) - bar.LunarBar:SetStatusBarColor(.13,.32,1) + chicken.LunarBar:SetSizeToScale(width, adjustedBar) + chicken.LunarBar:SetMinMaxValues(0,0) + chicken.LunarBar:SetStatusBarColor(.13,.32,1) + + chicken.Moon:SetSizeToScale(height, height) + chicken.Moon[1]:SetSizeToScale(adjustedAnim, adjustedAnim) + chicken.Moon[2]:SetSizeToScale(scaled, scaled) - bar.Moon:SetSizeToScale(height, height) - bar.Moon[1]:SetSizeToScale(adjustedAnim, adjustedAnim) - bar.Moon[2]:SetSizeToScale(scaled, scaled) + chicken.SolarBar:SetSizeToScale(width, adjustedBar) + chicken.SolarBar:SetMinMaxValues(0,0) + chicken.SolarBar:SetStatusBarColor(1,1,0.21) - bar.SolarBar:SetSizeToScale(width, adjustedBar) - bar.SolarBar:SetMinMaxValues(0,0) - bar.SolarBar:SetStatusBarColor(1,1,0.21) + chicken.Sun:SetSizeToScale(height, height) + chicken.Sun[1]:SetSizeToScale(adjustedAnim, adjustedAnim) + chicken.Sun[2]:SetSizeToScale(scaled, scaled) - bar.Sun:SetSizeToScale(height, height) - bar.Sun[1]:SetSizeToScale(adjustedAnim, adjustedAnim) - bar.Sun[2]:SetSizeToScale(scaled, scaled) + chicken.Text:SetPoint("TOPLEFT", chicken, "TOPLEFT", 10, 0) + chicken.Text:SetPoint("BOTTOMRIGHT", chicken, "BOTTOMRIGHT", -10, 0) + chicken.Text:SetFont(TRACKER_FONT, scaled, 'OUTLINE') - bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) - bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) - bar.Text:SetFont(TRACKER_FONT, scaled, 'OUTLINE') + local max = MAX_COMBO_POINTS; + local cat = bar.Cat; + local size = (height - 4) + for i = 1, max do + cat[i]:ClearAllPoints() + cat[i]:SetSizeToScale(size, size) + cat[i].Icon:ClearAllPoints() + cat[i].Icon:SetAllPoints(cat[i]) + if i==1 then + cat[i]:SetPoint("LEFT", cat) + else + cat[i]:SetPointToScale("LEFT", cat[i - 1], "RIGHT", -2, 0) + end + end end --[[ ########################################################## @@ -156,10 +173,13 @@ function MOD:CreateClassBar(playerFrame) bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) bar:SetSizeToScale(100,40) - local moon = CreateFrame('Frame', nil, bar) - moon:SetFrameLevel(bar:GetFrameLevel() + 2) + local chicken = CreateFrame('Frame', nil, bar) + chicken:SetAllPoints(bar) + + local moon = CreateFrame('Frame', nil, chicken) + moon:SetFrameLevel(chicken:GetFrameLevel() + 2) moon:SetSizeToScale(40, 40) - moon:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) + moon:SetPoint("TOPLEFT", chicken, "TOPLEFT", 0, 0) moon[1] = moon:CreateTexture(nil, "BACKGROUND", nil, 1) moon[1]:SetSizeToScale(40, 40) @@ -174,25 +194,24 @@ function MOD:CreateClassBar(playerFrame) moon[2]:SetPoint("CENTER") moon[2]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\DRUID-MOON") moon[1]:Hide() + chicken.Moon = moon; - local lunar = CreateFrame('StatusBar', nil, bar) + local lunar = CreateFrame('StatusBar', nil, chicken) lunar:SetPoint("LEFT", moon, "RIGHT", -10, 0) lunar:SetSizeToScale(100,40) lunar:SetStatusBarTexture(SV.Media.bar.lazer) lunar.noupdate = true; + chicken.LunarBar = lunar; - bar.Moon = moon; - - bar.LunarBar = lunar; - - local solar = CreateFrame('StatusBar', nil, bar) + local solar = CreateFrame('StatusBar', nil, chicken) solar:SetPoint('LEFT', lunar:GetStatusBarTexture(), 'RIGHT') solar:SetSizeToScale(100,40) solar:SetStatusBarTexture(SV.Media.bar.lazer) solar.noupdate = true; + chicken.SolarBar = solar; - local sun = CreateFrame('Frame', nil, bar) - sun:SetFrameLevel(bar:GetFrameLevel() + 2) + local sun = CreateFrame('Frame', nil, chicken) + sun:SetFrameLevel(chicken:GetFrameLevel() + 2) sun:SetSizeToScale(40, 40) sun:SetPoint("LEFT", lunar, "RIGHT", -10, 0) sun[1] = sun:CreateTexture(nil, "BACKGROUND", nil, 1) @@ -208,37 +227,15 @@ function MOD:CreateClassBar(playerFrame) sun[2]:SetPoint("CENTER") sun[2]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\DRUID-SUN") sun[1]:Hide() - bar.Sun = sun; - - bar.SolarBar = solar; - - bar.Text = lunar:CreateFontString(nil, 'OVERLAY') - bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) - bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) - bar.Text:SetFont(SV.Media.font.default, 16, "NONE") - bar.Text:SetShadowOffset(0,0) - - local hyper = CreateFrame("Frame",nil,playerFrame) - hyper:SetFrameStrata("DIALOG") - hyper:SetSizeToScale(45,30) - hyper:SetPointToScale("TOPLEFT", playerFrame.TextGrip, "TOPLEFT", 0, -2) - - local points = CreateFrame('Frame',nil,hyper) - points:SetFrameStrata("DIALOG") - points:SetAllPoints(hyper) - - points.Text = points:CreateFontString(nil,'OVERLAY') - points.Text:SetAllPoints(points) - points.Text:SetFont(TRACKER_FONT, 26, 'OUTLINE') - points.Text:SetTextColor(1,1,1) + chicken.Sun = sun; - playerFrame.HyperCombo = hyper; - playerFrame.HyperCombo.Tracking = points; + chicken.Text = lunar:CreateFontString(nil, 'OVERLAY') + chicken.Text:SetPoint("TOPLEFT", chicken, "TOPLEFT", 10, 0) + chicken.Text:SetPoint("BOTTOMRIGHT", chicken, "BOTTOMRIGHT", -10, 0) + chicken.Text:SetFont(SV.Media.font.default, 16, "NONE") + chicken.Text:SetShadowOffset(0,0) - playerFrame.MaxClassPower = 1; - playerFrame.DruidAltMana = CreateAltMana(playerFrame, bar) - - bar.PostDirectionChange = { + chicken.PostDirectionChange = { ["sun"] = function(this) this.Text:SetJustifyH("LEFT") this.Text:SetText(" >") @@ -266,119 +263,56 @@ function MOD:CreateClassBar(playerFrame) this.Moon[1].anim:Finish() end } - - local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) - bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) - bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) - - playerFrame.ClassBarRefresh = Reposition; - playerFrame.EclipseBar = bar - return 'EclipseBar' -end ---[[ -########################################################## -DRUID COMBO POINTS -########################################################## -]]-- -local cpointColor = { - [1]={0.69,0.31,0.31}, - [2]={0.69,0.31,0.31}, - [3]={0.65,0.63,0.35}, - [4]={0.65,0.63,0.35}, - [5]={0.33,0.59,0.33} -}; - -local comboTextures = { - [1]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-CLAW-UP]], - [2]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-CLAW-DOWN]], - [3]=[[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\DRUID-BITE]], -}; - -local ShowPoint = function(self) - self:SetAlpha(1) -end - -local HidePoint = function(self) - self.Icon:SetTexture(comboTextures[random(1,3)]) - self:SetAlpha(0) -end - -local ShowSmallPoint = function(self) - self:SetAlpha(1) -end -local HideSmallPoint = function(self, i) - self.Icon:SetVertexColor(unpack(cpointColor[i])) - self:SetAlpha(0) -end - -local RepositionCombo = function(self) - local db = SV.db.SVUnit.target - local bar = self.HyperCombo.CPoints; + local cat = CreateFrame('Frame',nil,bar) + cat:SetAllPoints(bar) local max = MAX_COMBO_POINTS; - local height = db.combobar.height - local isSmall = db.combobar.smallIcons - local size = isSmall and 22 or (height - 4) - local width = (size + 4) * max; - bar:ClearAllPoints() - bar:SetSizeToScale(width, height) - bar:SetPointToScale("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) - for i = 1, max do - bar[i]:ClearAllPoints() - bar[i]:SetSizeToScale(size, size) - bar[i].Icon:ClearAllPoints() - bar[i].Icon:SetAllPoints(bar[i]) - if(bar[i].Blood) then - bar[i].Blood:ClearAllPoints() - bar[i].Blood:SetAllPoints(bar[i]) - end - if i==1 then - bar[i]:SetPoint("LEFT", bar) - else - bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) - end - end -end - -function MOD:CreateDruidCombobar(targetFrame, isSmall) - local max = 5 - local size = isSmall and 22 or 30 - local bar = CreateFrame("Frame",nil,targetFrame) - bar:SetFrameStrata("DIALOG") - bar.CPoints = CreateFrame("Frame",nil,bar) for i = 1, max do - local cpoint = CreateFrame('Frame',nil,bar.CPoints) + local cpoint = CreateFrame('Frame',nil,cat) cpoint:SetSizeToScale(size,size) local icon = cpoint:CreateTexture(nil,"OVERLAY",nil,1) icon:SetSizeToScale(size,size) icon:SetPoint("CENTER") icon:SetBlendMode("BLEND") - - if(not isSmall) then - icon:SetTexture(comboTextures[random(1,3)]) - - local blood = cpoint:CreateTexture(nil,"OVERLAY",nil,2) - blood:SetSizeToScale(size,size) - blood:SetPoint("BOTTOMRIGHT",cpoint,12,-12) - blood:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\COMBO-ANIMATION]]) - blood:SetBlendMode("ADD") - cpoint.Blood = blood - - SV.Animate:Sprite8(blood,0.08,2,true) - else - icon:SetTexture([[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\COMBO-POINT-SMALL]]) - end + icon:SetTexture(comboTextures[random(1,3)]) cpoint.Icon = icon - bar.CPoints[i] = cpoint - end - - targetFrame.ComboRefresh = RepositionCombo; - bar.PointShow = isSmall and ShowSmallPoint or ShowPoint; - bar.PointHide = isSmall and HideSmallPoint or HidePoint; - - return bar + cat[i] = cpoint + end + cat.PointShow = ShowPoint; + cat.PointHide = HidePoint; + + local mana = CreateFrame("Frame", nil, playerFrame) + mana:SetFrameStrata("LOW") + mana:SetAllPointsIn(bar, 2, 4) + mana:SetStylePanel("Fixed", "Default") + mana:SetFrameLevel(mana:GetFrameLevel() + 1) + mana.colorPower = true; + mana.PostUpdatePower = UpdateAltPower; + mana.ManaBar = CreateFrame("StatusBar", nil, mana) + mana.ManaBar.noupdate = true; + mana.ManaBar:SetStatusBarTexture(SV.Media.bar.glow) + mana.ManaBar:SetAllPointsIn(mana) + mana.bg = mana:CreateTexture(nil, "BORDER") + mana.bg:SetAllPoints(mana.ManaBar) + mana.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + mana.bg.multiplier = 0.3; + mana.Text = mana.ManaBar:CreateFontString(nil, "OVERLAY") + mana.Text:SetAllPoints(mana.ManaBar) + mana.Text:FontManager("unitprimary") + + bar.Cat = cat; + bar.Chicken = chicken; + bar.Mana = mana; + + local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) + bar.Holder = classBarHolder + SV.Mentalo:Add(bar.Holder, L["Classbar"]) + + playerFrame.ClassBarRefresh = Reposition; + playerFrame.Druidness = bar + return 'Druidness' end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 61c55c3..35a5005 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -71,32 +71,51 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = SV.db.SVUnit.target - local bar = self.HyperCombo.CPoints; + local db = SV.db.SVUnit.player + local bar = self.HyperCombo; + if not db then return end + local height = db.classbar.height + local width = height * 3; + local textwidth = height * 1.25; + bar.Holder:SetSizeToScale(width, height) + if(not db.classbar.detachFromFrame) then + SV.Mentalo:Reset(L["Classbar"]) + end + local holderUpdate = bar.Holder:GetScript('OnSizeChanged') + if holderUpdate then + holderUpdate(bar.Holder) + end + + bar:ClearAllPoints() + bar:SetAllPoints(bar.Holder) + + local points = bar.Combo; local max = MAX_COMBO_POINTS; - local height = db.combobar.height - local isSmall = db.combobar.smallIcons - local size = isSmall and 22 or (height - 4) - local width = (size + 4) * max; - bar:ClearAllPoints() - bar:SetSizeToScale(width, height) - bar:SetPointToScale("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) + local size = height - 4 + points:ClearAllPoints() + points:SetAllPoints(bar) for i = 1, max do - bar[i]:ClearAllPoints() - bar[i]:SetSizeToScale(size, size) - bar[i].Icon:ClearAllPoints() - bar[i].Icon:SetAllPoints(bar[i]) - if(bar[i].Blood) then - bar[i].Blood:ClearAllPoints() - bar[i].Blood:SetAllPoints(bar[i]) - end + points[i]:ClearAllPoints() + points[i]:SetSizeToScale(size, size) + points[i].Icon:ClearAllPoints() + points[i].Icon:SetAllPoints(points[i]) if i==1 then - bar[i]:SetPoint("LEFT", bar) + points[i]:SetPoint("LEFT", points) else - bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) + points[i]:SetPointToScale("LEFT", points[i - 1], "RIGHT", -2, 0) end - end -end + end + + if(bar.Guile) then + bar.Guile:ClearAllPoints() + bar.Guile:SetHeight(size) + bar.Guile:SetWidth(textwidth) + bar.Guile:SetPoint("LEFT", points, "RIGHT", -2, 0) + bar.Guile.Text:ClearAllPoints() + bar.Guile.Text:SetAllPoints(bar.Guile) + bar.Guile.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') + end +end --[[ ########################################################## ROGUE COMBO POINTS @@ -110,26 +129,23 @@ local HidePoint = function(self) local coords = ICON_COORDS[random(2,4)]; self.Icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) self:SetAlpha(0) -end - -local ShowSmallPoint = function(self) - self:SetAlpha(1) -end - -local HideSmallPoint = function(self, i) - self.Icon:SetVertexColor(unpack(cpointColor[i])) - self:SetAlpha(0) -end - -function MOD:CreateRogueCombobar(targetFrame, isSmall) +end +--[[ +########################################################## +ROGUE COMBO TRACKER +########################################################## +]]-- +function MOD:CreateClassBar(playerFrame) local max = 5 - local size = isSmall and 22 or 30 - local bar = CreateFrame("Frame",nil,targetFrame) + local size = 30 local coords + + local bar = CreateFrame("Frame", nil, playerFrame) bar:SetFrameStrata("DIALOG") - bar.CPoints = CreateFrame("Frame",nil,bar) + + bar.Combo = CreateFrame("Frame",nil,bar) for i = 1, max do - local cpoint = CreateFrame('Frame',nil,bar.CPoints) + local cpoint = CreateFrame('Frame',nil,bar.Combo) cpoint:SetSizeToScale(size,size) local icon = cpoint:CreateTexture(nil,"OVERLAY",nil,1) @@ -138,110 +154,15 @@ function MOD:CreateRogueCombobar(targetFrame, isSmall) icon:SetBlendMode("BLEND") icon:SetTexture(ICON_FILE) - if(not isSmall) then - coords = ICON_COORDS[random(2,4)] - icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - - local blood = cpoint:CreateTexture(nil,"OVERLAY",nil,2) - blood:SetSizeToScale(size,size) - blood:SetPoint("BOTTOMRIGHT",cpoint,12,-12) - blood:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\COMBO-ANIMATION]]) - blood:SetBlendMode("ADD") - cpoint.Blood = blood - - SV.Animate:Sprite8(blood,0.08,2,true) - else - coords = ICON_COORDS[1] - icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - end + coords = ICON_COORDS[random(2,4)] + icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) cpoint.Icon = icon - bar.CPoints[i] = cpoint + bar.Combo[i] = cpoint end - targetFrame.ComboRefresh = Reposition; - bar.PointShow = isSmall and ShowSmallPoint or ShowPoint; - bar.PointHide = isSmall and HideSmallPoint or HidePoint; - - return bar -end ---[[ -########################################################## -ROGUE COMBO TRACKER -########################################################## -]]-- -local RepositionTracker = function(self) - local db = SV.db.SVUnit.player - local bar = self.HyperCombo; - if not db then return end - local size = db.classbar.height - local width = size * 3; - local textwidth = size * 1.25; - bar.Holder:SetSizeToScale(width, size) - if(not db.classbar.detachFromFrame) then - SV.Mentalo:Reset(L["Classbar"]) - end - local holderUpdate = bar.Holder:GetScript('OnSizeChanged') - if holderUpdate then - holderUpdate(bar.Holder) - end - - bar:ClearAllPoints() - bar:SetAllPoints(bar.Holder) - if(bar.Tracking) then - bar.Tracking:ClearAllPoints() - bar.Tracking:SetHeight(size) - bar.Tracking:SetWidth(textwidth) - bar.Tracking:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) - bar.Tracking.Text:ClearAllPoints() - bar.Tracking.Text:SetAllPoints(bar.Tracking) - bar.Tracking.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') - end - if(bar.Anticipation) then - bar.Anticipation:ClearAllPoints() - bar.Anticipation:SetHeight(size) - bar.Anticipation:SetWidth(textwidth) - bar.Anticipation:SetPoint("LEFT", bar.Tracking, "RIGHT", -2, 0) - bar.Anticipation.Text:ClearAllPoints() - bar.Anticipation.Text:SetAllPoints(bar.Anticipation) - bar.Anticipation.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') - end - if(bar.Guile) then - bar.Guile:ClearAllPoints() - bar.Guile:SetHeight(size) - bar.Guile:SetWidth(textwidth) - bar.Guile:SetPoint("LEFT", bar.Anticipation, "RIGHT", -2, 0) - bar.Guile.Text:ClearAllPoints() - bar.Guile.Text:SetAllPoints(bar.Guile) - bar.Guile.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') - end -end - -function MOD:CreateClassBar(playerFrame) - local bar = CreateFrame("Frame",nil,playerFrame) - bar:SetFrameStrata("DIALOG") - bar:SetSizeToScale(150, 30) - local points = CreateFrame('Frame',nil,bar) - points:SetFrameStrata("DIALOG") - points:SetSizeToScale(30,30) - - points.Text = points:CreateFontString(nil,'OVERLAY') - points.Text:SetAllPoints(points) - points.Text:SetFont(TRACKER_FONT,30,'OUTLINE') - points.Text:SetTextColor(1,1,1) - - bar.Tracking = points; - - local anticipation = CreateFrame('Frame',nil,bar) - anticipation:SetFrameStrata("DIALOG") - anticipation:SetSizeToScale(30,30) - - anticipation.Text = anticipation:CreateFontString(nil,'OVERLAY') - anticipation.Text:SetAllPoints(anticipation) - anticipation.Text:SetFont(TRACKER_FONT,30,'OUTLINE') - anticipation.Text:SetTextColor(1,1,1) - - bar.Anticipation = anticipation; + bar.PointShow = ShowPoint; + bar.PointHide = HidePoint; local guile = CreateFrame('Frame',nil,bar) guile:SetFrameStrata("DIALOG") @@ -261,7 +182,7 @@ function MOD:CreateClassBar(playerFrame) SV.Mentalo:Add(bar.Holder, L["Classbar"]) playerFrame.MaxClassPower = 5; - playerFrame.ClassBarRefresh = RepositionTracker; + playerFrame.ClassBarRefresh = Reposition; playerFrame.HyperCombo = bar return 'HyperCombo' end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 6335a78..dbc3705 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -57,20 +57,31 @@ local specEffects = { [1] = "affliction", [2] = "none", [3] = "fire" }; LOCAL FUNCTIONS ########################################################## ]]-- -local shardColor = { - [1] = {0.57,0.08,1}, - [2] = {1,0,0}, - [3] = {1,0.25,0} +local shardColors = { + [1] = {{0.67,0.42,0.93,1}, {0,0,0,0.9}}, + [2] = {{0,0,0,0}, {0,0,0,0}}, + [3] = {{1,1,0,1}, {0.1,0,0,0.9}}, + [4] = {{0.5,1,0,1}, {0,0.15,0,0.9}} } -local shardOverColor = { - [1] = {0.67,0.42,0.93}, - [2] = {0,0,0}, - [3] = {1,1,0} -} -local shardBGColor = { - [1] = {0,0,0,0.9}, - [2] = {0,0,0}, - [3] = {0.1,0,0} +local shardTextures = { + [1] = { + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-SHARD]], + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-SHARD-BG]], + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-SHARD-FG]], + "affliction" + }, + [2] = { + [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]], + [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]], + [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]], + "none" + }, + [3] = { + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-EMBER]], + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-EMBER]], + [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\WARLOCK-EMBER-FG]], + "fire" + }, } local SPEC_WARLOCK_DESTRUCTION = SPEC_WARLOCK_DESTRUCTION local SPEC_WARLOCK_AFFLICTION = SPEC_WARLOCK_AFFLICTION @@ -101,7 +112,7 @@ local Reposition = function(self) bar.DemonicFury:ClearAllPoints() bar.DemonicFury:SetAllPointsIn(bar.Holder, 1, 3) - --bar.DemonicFury:SetPoint("LEFT", bar, "LEFT", 0, dbOffset) + for i = 1, max do bar[i]:ClearAllPoints() bar[i]:SetHeight(size) @@ -118,163 +129,43 @@ end CUSTOM HANDLERS ########################################################## ]]-- -local UpdateTextures = function(self, spec, max) - if max == 0 then max = 4 end - local effectName = specEffects[spec] - if spec == SPEC_WARLOCK_DEMONOLOGY then - self[1].overlay:SetTexture(0,0,0,0) - self[2].overlay:SetTexture(0,0,0,0) - self[3].overlay:SetTexture(0,0,0,0) - self[4].overlay:SetTexture(0,0,0,0) - self.CurrentSpec = spec - elseif spec == SPEC_WARLOCK_AFFLICTION then - for i = 1, max do - self[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD") - self[i]:GetStatusBarTexture():SetHorizTile(false) - self[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-BG") - self[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-FG") - self[i].bg:SetVertexColor(unpack(shardBGColor[spec])) - self[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) - self[i].FX:SetEffect(effectName) - end - self.CurrentSpec = spec - elseif spec == SPEC_WARLOCK_DESTRUCTION then - for i = 1, max do - self[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") - self[i]:GetStatusBarTexture():SetHorizTile(false) - self[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") - self[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER-FG") - if GetSpecialization() == SPEC_WARLOCK_DESTRUCTION and IsSpellKnown(101508) then -- GREEN FIRE (Codex of Xeroth): 101508 - self[i].bg:SetVertexColor(0,0.15,0) - self[i].overlay:SetVertexColor(0.5,1,0) - else - self[i].bg:SetVertexColor(unpack(shardBGColor[spec])) - self[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) - end - self[i].FX:SetEffect(effectName) +local UpdateTextures = function(self, spec) + local max = self.MaxCount; + local colors = shardColors[spec]; + local textures = shardTextures[spec]; + if(spec == SPEC_WARLOCK_DESTRUCTION and IsSpellKnown(101508)) then + colors = shardColors[4] + end + for i = 1, max do + self[i]:SetStatusBarTexture(textures[1]) + self[i]:GetStatusBarTexture():SetHorizTile(false) + self[i].overlay:SetTexture(textures[3]) + self[i].overlay:SetVertexColor(unpack(colors[1])) + self[i].bg:SetTexture(textures[2]) + self[i].bg:SetVertexColor(unpack(colors[2])) + if(textures[4] ~= none) then + self[i].FX:SetEffect(textures[4]) end - self.CurrentSpec = spec end + self.CurrentSpec = spec end -local Update = function(self, event, unit, powerType) - local bar = self.WarlockShards; - local fury = bar.DemonicFury; - if UnitHasVehicleUI("player") then - bar:Hide() - else - bar:Show() - end - local spec = GetSpecialization() - if spec then - if not bar:IsShown() then - bar:Show() +local ShardUpdate = function(self, value) + if (value and value == 1) then + if(self.overlay) then + self.overlay:Show() + SV.Animate:Flash(self.overlay,1,true) end - - if (spec == SPEC_WARLOCK_DESTRUCTION) then - fury:Hide() - local maxPower = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) - local power = UnitPower("player", SPELL_POWER_BURNING_EMBERS, true) - local numEmbers = power / MAX_POWER_PER_EMBER - local numBars = floor(maxPower / MAX_POWER_PER_EMBER) - bar.number = numBars - - for i = 1, 4 do - if((i == 4) and (numBars == 3)) then - bar[i]:Hide() - else - bar[i]:Show() - bar[i]:SetStatusBarColor(unpack(shardColor[spec])) - end - end - - if bar.CurrentSpec ~= spec then - UpdateTextures(bar, spec, numBars) - end - - for i = 1, numBars do - bar[i]:SetMinMaxValues((MAX_POWER_PER_EMBER * i) - MAX_POWER_PER_EMBER, MAX_POWER_PER_EMBER * i) - bar[i]:SetValue(power) - if (power >= MAX_POWER_PER_EMBER * i) then - bar[i].overlay:Show() - bar[i].FX:Show() - SV.Animate:Flash(bar[i].overlay,1,true) - else - SV.Animate:StopFlash(bar[i].overlay) - bar[i].overlay:Hide() - bar[i].FX:Hide() - end - end - elseif ( spec == SPEC_WARLOCK_AFFLICTION ) then - fury:Hide() - local numShards = UnitPower("player", SPELL_POWER_SOUL_SHARDS) - local maxShards = UnitPowerMax("player", SPELL_POWER_SOUL_SHARDS) - bar.number = maxShards - - for i = 1, 4 do - if((i == 4) and (maxShards == 3)) then - bar[i]:Hide() - else - bar[i]:Show() - bar[i]:SetStatusBarColor(unpack(shardColor[spec])) - end - end - - if bar.CurrentSpec ~= spec then - UpdateTextures(bar, spec, maxShards) - end - - for i = 1, maxShards do - bar[i]:SetMinMaxValues(0, 1) - if i <= numShards then - bar[i]:SetValue(1) - bar[i]:SetAlpha(1) - bar[i].overlay:Show() - bar[i].FX:Show() - SV.Animate:Flash(bar[i].overlay,1,true) - else - bar[i]:SetValue(0) - bar[i]:SetAlpha(0) - SV.Animate:StopFlash(bar[i].overlay) - bar[i].FX:Hide() - end - end - elseif spec == SPEC_WARLOCK_DEMONOLOGY then - if not fury:IsShown() then - fury:Show() - end - fury.bar:SetStatusBarColor(unpack(shardColor[spec])) - local power = UnitPower("player", SPELL_POWER_DEMONIC_FURY) - local maxPower = UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) - local percent = (power / maxPower) * 100 - bar.number = 1 - if bar.CurrentSpec ~= spec then - UpdateTextures(bar, spec, 1) - end - bar[1]:Hide() - bar[2]:Hide() - bar[3]:Hide() - bar[4]:Hide() - fury.bar:SetMinMaxValues(0, maxPower) - fury.bar:SetValue(power) - if(percent > 80) then - if(not fury.bar.FX:IsShown()) then - fury.bar.FX:Show() - end - else - fury.bar.FX:Hide() - end + if(not self.FX:IsShown()) then + self.FX:Show() end + self.FX:UpdateEffect() else - if bar:IsShown() then - bar:Hide() + if(self.overlay) then + SV.Animate:StopFlash(self.overlay) + self.overlay:Hide() end - if fury:IsShown() then - fury:Hide() - end - end - if(bar.PostUpdate) then - return bar:PostUpdate(unit, spec) + self.FX:Hide() end end --[[ @@ -287,33 +178,32 @@ local EffectModel_OnShow = function(self) end function MOD:CreateClassBar(playerFrame) - local max = 4 + local max = 4; + local textures = shardTextures[1]; + local colors = shardColors[1]; local bar = CreateFrame("Frame",nil,playerFrame) bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i = 1, max do bar[i] = CreateFrame("StatusBar", nil, bar) bar[i].noupdate = true; bar[i]:SetOrientation("VERTICAL") - bar[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD") + bar[i]:SetStatusBarTexture(textures[1]) bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i].bg = bar[i]:CreateTexture(nil,'BORDER',nil,1) bar[i].bg:SetAllPoints(bar[i]) - bar[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD-BG") + bar[i].bg:SetTexture(textures[2]) + bar[i].bg:SetVertexColor(unpack(colors[2])) bar[i].overlay = bar[i]:CreateTexture(nil,'OVERLAY') bar[i].overlay:SetAllPoints(bar[i]) - bar[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD-FG") + bar[i].overlay:SetTexture(textures[3]) bar[i].overlay:SetBlendMode("BLEND") bar[i].overlay:Hide() + bar[i].overlay:SetVertexColor(unpack(colors[1])) - bar[i].bg:SetVertexColor(unpack(shardBGColor[1])) - bar[i].overlay:SetVertexColor(unpack(shardOverColor[1])) - - local spec = GetSpecialization() - local effectName = specEffects[spec] - SV.SpecialFX:SetFXFrame(bar[i], effectName, true) - bar[i].FX:SetScript("OnShow", EffectModel_OnShow) + SV.SpecialFX:SetFXFrame(bar[i], textures[4], true) + bar[i].Update = ShardUpdate end local demonicFury = CreateFrame("Frame", nil, bar) @@ -363,12 +253,14 @@ function MOD:CreateClassBar(playerFrame) SV.SpecialFX:SetFXFrame(demonBar, "overlay_demonbar", true) demonBar.FX:SetScript("OnShow", EffectModel_OnShow) + demonBar.Update = ShardUpdate; + demonicFury.bg = bgTexture; demonicFury.bar = demonBar; bar.DemonicFury = demonicFury; - bar.CurrentSpec = 0; - bar.Override = Update; + bar.UpdateTextures = UpdateTextures; + bar.MaxCount = max; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) @@ -380,16 +272,4 @@ function MOD:CreateClassBar(playerFrame) playerFrame.ClassBarRefresh = Reposition; playerFrame.WarlockShards = bar return 'WarlockShards' -end - -local preLoader = CreateFrame("Frame", nil) -preLoader:SetScript("OnEvent", function(self, event, ...) - if(event == "PLAYER_ENTERING_WORLD") then - local frame = _G['SVUI_Player'] - if not frame or not frame.WarlockShards then return end - Update(frame, nil, 'player') - self:UnregisterEvent("PLAYER_ENTERING_WORLD") - self:SetScript("OnEvent", nil) - end -end) -preLoader:RegisterEvent("PLAYER_ENTERING_WORLD") \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua index 363e81e..81c10dd 100644 --- a/Interface/AddOns/SVUI/setup/presets.lua +++ b/Interface/AddOns/SVUI/setup/presets.lua @@ -507,42 +507,42 @@ local function LoadPresetData() portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["target"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["pet"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, ["targettarget"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, ["boss"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["party"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, }, @@ -551,42 +551,42 @@ local function LoadPresetData() portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["target"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["pet"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, ["targettarget"] = { portrait = { enable = false, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, ["boss"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", } }, ["party"] = { portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, }, }, @@ -678,7 +678,7 @@ local function LoadPresetData() portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, icons = { roleIcon = { @@ -735,7 +735,7 @@ local function LoadPresetData() portrait = { enable = true, overlay = true, - style = "3D", + style = "3DOVERLAY", }, ["icons"] = { ["roleIcon"] = {