diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua index ff0ad09..f481c2d 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua @@ -69,7 +69,7 @@ local EFFECTS_LIST = setmetatable({ ["shadow"] = {[[Spells\Shadow_precast_uber_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, ["arcane"] = {[[Spells\Cast_arcane_01.m2]], -12, 12, 12, -12, 0.25, 0, 0}, ["fire"] = {[[Spells\Bloodlust_state_hand.m2]], -8, 4, 24, -24, 0.23, -0.08, 0.08}, - ["frost"] = {[[Spells\Ice_cast_low_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, + ["frost"] = {[[Spells\Ice_cast_low_hand.m2]], -12, 12, 12, -12, 0.25, -0.2, -0.35}, ["chi"] = {[[Spells\Fel_fire_precast_high_hand.m2]], -12, 12, 12, -12, 0.3, 0, 0}, ["lightning"] = {[[Spells\Fill_lightning_cast_01.m2]], -12, 12, 12, -12, 1.25, 0, 0}, ["water"] = {[[Spells\Monk_drunkenhaze_impact.m2]], -12, 12, 12, -12, 0.9, 0, 0}, diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua deleted file mode 100644 index 37c65e5..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua +++ /dev/null @@ -1,130 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; ---BLIZZARD API -local GetTime = _G.GetTime; -local GetSpecialization = _G.GetSpecialization; -local UnitDebuff = _G.UnitDebuff; - -if select(2, UnitClass('player')) ~= "MAGE" then return end - -local _, ns = ... -local oUF = oUF or ns.oUF -if not oUF then return end - -local function UpdateBar(self, elapsed) - if not self.duration then return end - self.elapsed = (self.elapsed or 0) + elapsed - if self.elapsed >= 0.5 then - local timeLeft = (self.duration - GetTime()) - if timeLeft > 0 then - self:SetValue(timeLeft) - else - self.start = nil - self.duration = nil - self:SetValue(0) - self:Hide() - self:SetScript("OnUpdate", nil) - end - end -end - -local Update = function(self, event, unit) - if(self.unit ~= unit) then return end - local bar = self.ArcaneChargeBar - local spec = GetSpecialization() - - if(bar.PreUpdate) then bar:PreUpdate(spec) end - - local arcaneCharges, start, duration = 0; - if bar:IsShown() then - for index=1, 30 do - local count, _, spellID = 0; - _, _, _, count, _, start, duration, _, _, _, spellID = UnitDebuff(unit, index) - if spellID == 36032 then - arcaneCharges = count or 0 - start = start - duration = duration - break - end - end - - for i = 1, 4 do - if start and duration then - bar[i]:SetMinMaxValues(0, start) - bar[i].start = start - bar[i].duration = duration - end - - if i <= arcaneCharges then - bar[i]:Show() - bar[i]:SetValue(start) - bar[i]:SetScript('OnUpdate', UpdateBar) - else - bar[i]:SetValue(0) - bar[i]:Hide() - end - end - end - - if(bar.PostUpdate) then - return bar:PostUpdate(event, arcaneCharges, maxCharges) - end -end - - -local Path = function(self, ...) - return (self.ArcaneChargeBar.Override or Update) (self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, 'ForceUpdate', element.__owner.unit) -end - -local function Enable(self, unit) - local bar = self.ArcaneChargeBar - - if(bar) then - self:RegisterEvent("UNIT_AURA", Path) - self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) - self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) - bar.__owner = self - bar.ForceUpdate = ForceUpdate - - for i = 1, 4 do - if not bar[i]:GetStatusBarTexture() then - bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) - end - - bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) - bar[i]:GetStatusBarTexture():SetHorizTile(false) - - if bar[i].bg then - bar[i]:SetMinMaxValues(0, 1) - bar[i]:SetValue(0) - bar[i].bg:SetAlpha(0.4) - bar[i].bg:SetAllPoints() - bar[i]:Hide() - end - end - - return true; - end -end - -local function Disable(self,unit) - local bar = self.ArcaneChargeBar - - if(bar) then - self:UnregisterEvent("UNIT_AURA", Path) - self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) - bar:Hide() - end -end - -oUF:AddElement("ArcaneChargeBar",Path,Enable,Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc deleted file mode 100644 index 9f98003..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ /dev/null @@ -1,8 +0,0 @@ -## Interface: 50001 -## Title: oUF Arcane Charge -## Notes: Adds support for arcane charge indicators to oUF. -## Author: Munglunch -## Version: 5.4.15 -## Dependencies: oUF - -oUF_ArcaneCharge.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 index 1d6cdaa..c8ad6d0 100644 --- 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 @@ -11,44 +11,53 @@ local UnitDebuff = _G.UnitDebuff; local parent, ns = ... local oUF = ns.oUF -local RAGE_AURAS = {} +local ENRAGE_ID = 13046; local function getRageAmount() for i = 1, 40 do - local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = - UnitDebuff("player", i) - if RAGE_AURAS[spellID] then - return amount + local name, rank, icon, count, dispelType, duration, expires, _, _, _, spellID, _, _, _, amount = + UnitBuff("player", i) + if spellID == ENRAGE_ID then + return duration, expires end end - return 0 + return 0,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 +local BarOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - GetTime()) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + self.start = nil + self.duration = nil + self:SetValue(0) + self:Hide() + self:SetScript("OnUpdate", nil) + end + 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() + local element = self.Conqueror + local bar = element.Enrage + if(element.PreUpdate) then element:PreUpdate(event) end + + local start, duration = getRageAmount() + + if(duration and start) then + bar:SetMinMaxValues(0, start) + bar:SetValue(start) + bar.start = start + bar.duration = duration + bar:SetScript('OnUpdate', BarOnUpdate) end - if(bar.PostUpdate) then - return bar:PostUpdate(event) + if(element.PostUpdate) then + return element:PostUpdate(event) end end @@ -69,9 +78,11 @@ local Enable = function(self) self:RegisterEvent('UNIT_AURA', Path, true) - if(bar:IsObjectType'Texture' and not bar:GetTexture()) then - bar:SetTexture[[Interface\TargetingFrame\UI-StatusBar]] + if(bar.Enrage:IsObjectType'Texture' and not bar.Enrage:GetTexture()) then + bar.Enrage:SetTexture[[Interface\TargetingFrame\UI-StatusBar]] end + bar.Enrage:SetMinMaxValues(0, 100) + bar.Enrage:SetValue(0) return true end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua deleted file mode 100644 index 9641835..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua +++ /dev/null @@ -1,215 +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; ---BLIZZARD API -local GetLocale = _G.GetLocale; -local GetShapeshiftFormID = _G.GetShapeshiftFormID; -local UnitAura = _G.UnitAura; -local UnitHasVehiclePlayerFrameUI = _G.UnitHasVehiclePlayerFrameUI; -local MonkStaggerBar = _G.MonkStaggerBar; - -if select(2, UnitClass('player')) ~= "MONK" then return end - -local parent, ns = ... -local oUF = ns.oUF -local floor = math.floor; -local DM_L = {}; - -if GetLocale() == "enUS" then - DM_L["Stagger"] = "Stagger" - DM_L["Light Stagger"] = "Light Stagger" - DM_L["Moderate Stagger"] = "Moderate Stagger" - DM_L["Heavy Stagger"] = "Heavy Stagger" - -elseif GetLocale() == "frFR" then - DM_L["Stagger"] = "Report" - DM_L["Light Stagger"] = "Report mineur" - DM_L["Moderate Stagger"] = "Report mod??" - DM_L["Heavy Stagger"] = "Report majeur" - -elseif GetLocale() == "itIT" then - DM_L["Stagger"] = "Noncuranza" - DM_L["Light Stagger"] = "Noncuranza Parziale" - DM_L["Moderate Stagger"] = "Noncuranza Moderata" - DM_L["Heavy Stagger"] = "Noncuranza Totale" - -elseif GetLocale() == "deDE" then - DM_L["Stagger"] = "Staffelung" - DM_L["Light Stagger"] = "Leichte Staffelung" - DM_L["Moderate Stagger"] = "Moderate Staffelung" - DM_L["Heavy Stagger"] = "Schwere Staffelung" - -elseif GetLocale() == "zhCN" then - DM_L["Stagger"] = "醉拳" - DM_L["Light Stagger"] = "轻度醉拳" - DM_L["Moderate Stagger"] = "中度醉拳" - DM_L["Heavy Stagger"] = "重度醉拳" - -elseif GetLocale() == "ruRU" then - DM_L["Stagger"] = "Пошатывание" - DM_L["Light Stagger"] = "Легкое пошатывание" - DM_L["Moderate Stagger"] = "Умеренное пошатывание" - DM_L["Heavy Stagger"] = "Сильное пошатывание" - -else - DM_L["Stagger"] = "Stagger" - DM_L["Light Stagger"] = "Light Stagger" - DM_L["Moderate Stagger"] = "Moderate Stagger" - DM_L["Heavy Stagger"] = "Heavy Stagger" -end - -local STANCE_OF_THE_STURY_OX_ID = 23 - -local UnitHealthMax = UnitHealthMax -local UnitStagger = UnitStagger -local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; -local BREW_COLORS = { - [124275] = {0, 1, 0, 1}, -- Light - [124274] = {1, 0.5, 0, 1}, -- Moderate - [124273] = {1, 0, 0, 1}, -- Heavy -}; -local DEFAULT_STAGGER_COLOR = {1, 1, 1, 0.5}; -local STAGGER_COLORS = { - [124275] = {0.2, 0.8, 0.2, 1}, -- Light - [124274] = {1.0, 0.8, 0.2, 1}, -- Moderate - [124273] = {1.0, 0.4, 0.2, 1}, -- Heavy -}; -local STAGGER_DEBUFFS = { - [124275] = true, -- Light - [124274] = true, -- Moderate - [124273] = true, -- Heavy -}; -local staggerColor = {1, 1, 1, 0.5}; -local brewColor = {0.91, 0.75, 0.25, 0.5}; - -local function getStaggerAmount() - for i = 1, 40 do - local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = - UnitDebuff("player", i) - if STAGGER_DEBUFFS[spellID] then - if (spellID) then - staggerColor = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR - brewColor = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR - else - staggerColor = DEFAULT_STAGGER_COLOR - brewColor = DEFAULT_BREW_COLOR - end - return amount - end - end - return 0 -end - -local Update = function(self, event, unit) - if(unit and unit ~= self.unit) then return end - local stagger = self.DrunkenMaster - if(stagger.PreUpdate) then - stagger:PreUpdate() - end - local staggering = getStaggerAmount() - if staggering == 0 then - stagger:SetValue(0) - return - end - - local health = UnitHealth("player") - local maxHealth = UnitHealthMax("player") - local staggerTotal = UnitStagger("player") - if staggerTotal == 0 and staggering > 0 then - staggerTotal = staggering * 10 - end - - local staggerPercent = staggerTotal / maxHealth * 100 - local currentStagger = floor(staggerPercent) - stagger:SetMinMaxValues(0, 100) - if(staggerPercent == 0) then - stagger:SetStatusBarColor(unpack(DEFAULT_BREW_COLOR)) - else - stagger:SetStatusBarColor(unpack(brewColor)) - end - stagger:SetValue(staggerPercent) - - local icon = stagger.icon - if(icon) then - icon:SetVertexColor(unpack(staggerColor)) - end - - if(stagger.PostUpdate) then - stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) - end -end - -local Visibility = function(self, ...) - if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then - if self.DrunkenMaster:IsShown() then - self.DrunkenMaster:Hide() - self:UnregisterEvent('UNIT_AURA', Update) - end - else - self.DrunkenMaster:Show() - self:RegisterEvent('UNIT_AURA', Update) - return Update(self, ...) - end -end - -local Path = function(self, ...) - return (self.DrunkenMaster.Override or Visibility)(self, ...) -end - -local ForceUpdate = function(element) - return Path(element.__owner, "ForceUpdate", element.__owner.unit) -end - -local function Enable(self, unit) - if(unit ~= 'player') then return end - local element = self.DrunkenMaster - if(element) then - element.__owner = self - element.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_DISPLAYPOWER', Path) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', Path) - - if(element:IsObjectType'StatusBar' and not element:GetStatusBarTexture()) then - element:SetStatusBarTexture(0.91, 0.75, 0.25) - end - element:SetStatusBarColor(unpack(brewColor)) - element:SetMinMaxValues(0, 100) - element:SetValue(0) - - 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 function Disable(self) - local element = self.DrunkenMaster - if(element) then - element:Hide() - self:UnregisterEvent('UNIT_AURA', Update) - self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path) - - 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("DrunkenMaster", Path, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua new file mode 100644 index 0000000..b9872e7 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_KungFu/oUF_KungFu.lua @@ -0,0 +1,287 @@ +--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; + +if select(2, UnitClass('player')) ~= "MONK" then return end + +--BLIZZARD API +local UnitStagger = _G.UnitStagger; +local UnitPower = _G.UnitPower; +local UnitPowerMax = _G.UnitPowerMax; +local UnitHealthMax = _G.UnitHealthMax; +local UnitHasVehicleUI = _G.UnitHasVehicleUI; +local GetLocale = _G.GetLocale; +local GetShapeshiftFormID = _G.GetShapeshiftFormID; +local UnitAura = _G.UnitAura; +local UnitHasVehiclePlayerFrameUI = _G.UnitHasVehiclePlayerFrameUI; +local MonkStaggerBar = _G.MonkStaggerBar; +local SPELL_POWER_CHI = _G.SPELL_POWER_CHI; + + +local parent, ns = ... +local oUF = ns.oUF +local floor = math.floor; +local DM_L = {}; + +if GetLocale() == "enUS" then + DM_L["Stagger"] = "Stagger" + DM_L["Light Stagger"] = "Light Stagger" + DM_L["Moderate Stagger"] = "Moderate Stagger" + DM_L["Heavy Stagger"] = "Heavy Stagger" + +elseif GetLocale() == "frFR" then + DM_L["Stagger"] = "Report" + DM_L["Light Stagger"] = "Report mineur" + DM_L["Moderate Stagger"] = "Report mod??" + DM_L["Heavy Stagger"] = "Report majeur" + +elseif GetLocale() == "itIT" then + DM_L["Stagger"] = "Noncuranza" + DM_L["Light Stagger"] = "Noncuranza Parziale" + DM_L["Moderate Stagger"] = "Noncuranza Moderata" + DM_L["Heavy Stagger"] = "Noncuranza Totale" + +elseif GetLocale() == "deDE" then + DM_L["Stagger"] = "Staffelung" + DM_L["Light Stagger"] = "Leichte Staffelung" + DM_L["Moderate Stagger"] = "Moderate Staffelung" + DM_L["Heavy Stagger"] = "Schwere Staffelung" + +elseif GetLocale() == "zhCN" then + DM_L["Stagger"] = "醉拳" + DM_L["Light Stagger"] = "轻度醉拳" + DM_L["Moderate Stagger"] = "中度醉拳" + DM_L["Heavy Stagger"] = "重度醉拳" + +elseif GetLocale() == "ruRU" then + DM_L["Stagger"] = "Пошатывание" + DM_L["Light Stagger"] = "Легкое пошатывание" + DM_L["Moderate Stagger"] = "Умеренное пошатывание" + DM_L["Heavy Stagger"] = "Сильное пошатывание" + +else + DM_L["Stagger"] = "Stagger" + DM_L["Light Stagger"] = "Light Stagger" + DM_L["Moderate Stagger"] = "Moderate Stagger" + DM_L["Heavy Stagger"] = "Heavy Stagger" +end + +local STANCE_OF_THE_STURY_OX_ID = 23; +local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; +local BREW_COLORS = { + [124275] = {0, 1, 0, 1}, -- Light + [124274] = {1, 0.5, 0, 1}, -- Moderate + [124273] = {1, 0, 0, 1}, -- Heavy +}; +local DEFAULT_STAGGER_COLOR = {1, 1, 1, 0.5}; +local STAGGER_COLORS = { + [124275] = {0.2, 0.8, 0.2, 1}, -- Light + [124274] = {1.0, 0.8, 0.2, 1}, -- Moderate + [124273] = {1.0, 0.4, 0.2, 1}, -- Heavy +}; +local STAGGER_DEBUFFS = { + [124275] = true, -- Light + [124274] = true, -- Moderate + [124273] = true, -- Heavy +}; +local CURRENT_STAGGER_COLOR = {1, 1, 1, 0.5}; +local CURRENT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; +local CHI_COLORS = { + [1] = {.57, .63, .35, 1}, + [2] = {.47, .63, .35, 1}, + [3] = {.37, .63, .35, 1}, + [4] = {.27, .63, .33, 1}, + [5] = {.17, .63, .33, 1}, + [6] = {0, .63, .33, 1}, +} + +local function getStaggerAmount() + for i = 1, 40 do + local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = + UnitDebuff("player", i) + if STAGGER_DEBUFFS[spellID] then + if (spellID) then + CURRENT_STAGGER_COLOR = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR + CURRENT_BREW_COLOR = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR + else + CURRENT_STAGGER_COLOR = DEFAULT_STAGGER_COLOR + CURRENT_BREW_COLOR = DEFAULT_BREW_COLOR + end + return amount + end + end + return 0 +end + +local Update = function(self, event, unit) + if(unit and unit ~= self.unit) then return end + local bar = self.KungFu + local stagger = bar.DrunkenMaster + + if(bar.PreUpdate) then bar:PreUpdate(event) end + + local light = UnitPower("player", SPELL_POWER_CHI) + local numPoints = UnitPowerMax("player", SPELL_POWER_CHI) + + for i = 1, numPoints do + local orb = bar[i] + if(orb) then + if i <= light then + orb:Show() + else + orb:Hide() + end + end + end + + if UnitHasVehicleUI("player") then + bar:Hide() + else + bar:Show() + end + + if bar.numPoints ~= numPoints then + if numPoints == 6 then + bar[5]:Show() + bar[6]:Show() + elseif numPoints == 5 then + bar[5]:Show() + bar[6]:Hide() + else + bar[5]:Hide() + bar[6]:Hide() + end + end + + bar.numPoints = numPoints + + if(stagger:IsShown()) then + local staggering = getStaggerAmount() + if staggering == 0 then + stagger:SetValue(0) + else + local health = UnitHealth("player") + local maxHealth = UnitHealthMax("player") + local staggerTotal = UnitStagger("player") + if staggerTotal == 0 and staggering > 0 then + staggerTotal = staggering * 10 + end + + local staggerPercent = staggerTotal / maxHealth * 100 + local currentStagger = floor(staggerPercent) + stagger:SetMinMaxValues(0, 100) + + if(staggerPercent == 0) then + stagger:SetStatusBarColor(unpack(DEFAULT_BREW_COLOR)) + else + stagger:SetStatusBarColor(unpack(CURRENT_BREW_COLOR)) + end + + stagger:SetValue(staggerPercent) + + -- local icon = stagger.icon + -- if(icon) then + -- icon:SetVertexColor(unpack(CURRENT_STAGGER_COLOR)) + -- end + if(stagger.PostUpdate) then + stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) + end + end + end + + if(bar.PostUpdate) then bar:PostUpdate(event) end +end + +local Visibility = function(self, ...) + local bar = self.KungFu + local stagger = bar.DrunkenMaster + if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then + if stagger:IsShown() then + stagger:Hide() + self:UnregisterEvent('UNIT_AURA', Update) + end + else + stagger:Show() + self:RegisterEvent('UNIT_AURA', Update) + return Update(self, ...) + end +end + +local Path = function(self, ...) + return (self.KungFu.Override or Visibility)(self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, "ForceUpdate", element.__owner.unit) +end + +local function Enable(self, unit) + if(unit ~= 'player') then return end + local bar = self.KungFu + + if bar then + local stagger = bar.DrunkenMaster + stagger.__owner = self + stagger.ForceUpdate = ForceUpdate + + self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) + self:RegisterEvent("UNIT_POWER", Update) + self:RegisterEvent("PLAYER_LEVEL_UP", Update) + self:RegisterEvent('UNIT_DISPLAYPOWER', Path) + self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', Path) + + for i = 1, 6 do + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + end + + bar[i]:SetStatusBarColor(unpack(oUF.colors.KungFu[i])) + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) + end + bar.numPoints = 6 + + if(stagger:IsObjectType'StatusBar' and not stagger:GetStatusBarTexture()) then + stagger:SetStatusBarTexture(0.91, 0.75, 0.25) + end + stagger:SetStatusBarColor(unpack(brewColor)) + stagger:SetMinMaxValues(0, 100) + stagger:SetValue(0) + + 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 function Disable(self) + if self.KungFu then + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) + self:UnregisterEvent("UNIT_POWER", Update) + self:UnregisterEvent("PLAYER_LEVEL_UP", Update) + self:UnregisterEvent("UNIT_DISPLAYPOWER", Path) + self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path) + + 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('KungFu', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua new file mode 100644 index 0000000..2653700 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.lua @@ -0,0 +1,362 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +--BLIZZARD API +local GetTime = _G.GetTime; +local GetSpecialization = _G.GetSpecialization; +local UnitDebuff = _G.UnitDebuff; + +if select(2, UnitClass('player')) ~= "MAGE" then return end + +local _, ns = ... +local oUF = oUF or ns.oUF +if not oUF then return end + +local playerGUID; + +local ARCANE_CHARGE_ID = 36032; + +local IGNITE_ID = 12654; +local COMBUSTION_ID = 83853; +local PYROBLAST_ID = 11366; +local ICICLE_ID = 148022; +local FROSTBOLT_ID = 116; +local FROSTFIREBOLT_ID = 44614; +local ICELANCE_ID = 30455; +local ICYVEINS_NAME = GetSpellInfo(12472); +local ALTERTIME_ID = 108978; +local ALTERTIMEAURA_ID = 110909; + +local CAST_SUCCESS = 'SPELL_CAST_SUCCESS'; +local AURA_REMOVED = 'SPELL_AURA_REMOVED'; +local SPELL_START = 'SPELL_CAST_START'; + +local DAMAGECOUNT = 0; +local DAMAGETOTAL = 0; +local SPELLCOUNT = 0; +local ALTERCOUNT = 0; +local LASTRECORD = 0; + +local SpecMaximum = { + [1] = 4, + [2] = 4, + [3] = 5, +}; + +local ResetMagic = function(self) + local bar = self.MageMagic; + local ignite = bar.Ignite; + local igniteBar = ignite.Bar; + SPELLCOUNT = 0; + ALTERCOUNT = 0; + LASTRECORD = 0; + DAMAGETOTAL = 0; + for i = 1, 5 do + bar[i].start = nil + bar[i].duration = nil + bar[i]:SetValue(0) + bar[i]:Hide() + bar[i]:SetScript("OnUpdate", nil) + end + + igniteBar.start = 0 + igniteBar.duration = 0 + igniteBar:SetValue(0) + ignite:Hide() + igniteBar:SetScript("OnUpdate", nil) +end + +local GetResources = { + [1] = function(self, event, ...) + if(event == 'UNIT_AURA') then + local unit = ...; + for index = 1, 30 do + local _, _, _, count, _, start, duration, _, _, _, spellID = UnitDebuff(unit, index) + if(spellID == ARCANE_CHARGE_ID) then + SPELLCOUNT = count + return start, duration + end + end + end + return 0,0,true + end, + [2] = function(self, event, ...) + if(event == 'COMBAT_LOG_EVENT_UNFILTERED') then + local _, eventType, _, srcGUID, _, _, _, destGUID, _, _, _, spellID, _, _, amount = ... + if(srcGUID == playerGUID) then + if(eventType:find("_DAMAGE")) then + if(spellID == IGNITE_ID) then + DAMAGETOTAL = amount + elseif(spellID == COMBUSTION_ID) then + DAMAGETOTAL = 0 + end + end + end + elseif(event == 'UNIT_AURA') then + local unit = ...; + if(unit == 'player') then + for index = 1, 30 do + local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID = UnitDebuff('target', index) + if(spellID == IGNITE_ID) then + return floor(expires), duration + end + end + end + end + return 0,0,true + end, + [3] = function(self, event, ...) + if(event == 'COMBAT_LOG_EVENT_UNFILTERED') then + local _, eventType, _, srcGUID, _, _, _, _, _, _, _, spellID, _, _, amount = ... + if not (srcGUID == playerGUID) then + return 0,0,true; + end + + if(eventType == CAST_SUCCESS) and (spellID == ALTERTIME_ID) then + ALTERCOUNT = SPELLCOUNT + elseif(eventType == AURA_REMOVED) and (spellID == ALTERTIMEAURA_ID) then + SPELLCOUNT = ALTERCOUNT + ALTERCOUNT = 0 + return 0,0; + end + + if(not eventType:find("_DAMAGE")) then return end + if(spellID == ICICLE_ID) then + if(SPELLCOUNT > 0) then + SPELLCOUNT = SPELLCOUNT - 1 + return 0,0; + end + elseif((spellID == FROSTBOLT_ID) or (spellID == FROSTFIREBOLT_ID)) then + if(SPELLCOUNT < 5) then + if(ICYVEINS_NAME and UnitBuff("player", ICYVEINS_NAME)) then + SPELLCOUNT = SPELLCOUNT + 3 + if(SPELLCOUNT > 5) then SPELLCOUNT = 5 end + else + SPELLCOUNT = SPELLCOUNT + 1 + end + + return 0,0; + end + end + end + return 0,0,true; + end, +}; + +local BarOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - GetTime()) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + self.start = nil + self.duration = nil + self:SetValue(0) + self:Hide() + self:SetScript("OnUpdate", nil) + end + end +end + +local IgniteOnUpdate = function(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - self.elapsed) + local remaining = floor(timeLeft * DAMAGETOTAL) + if timeLeft > 0 then + self:SetValue(timeLeft) + self.text:SetText(remaining) + else + self.text:SetText('0') + DAMAGETOTAL = 0; + self.start = 0; + self.duration = 5; + self.elapsed = 0; + self:SetValue(0); + self:SetScript("OnUpdate", nil); + end + end +end + +local IcicleOnUpdate = function(self, elapsed) + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (31 - self.elapsed) + if timeLeft > 0 then + self:SetValue(timeLeft) + else + if(SPELLCOUNT > 0) then + SPELLCOUNT = SPELLCOUNT - 1 + end + self.elapsed = nil; + self:SetValue(0); + self:Hide(); + self:SetScript("OnUpdate", nil); + end + end +end + +local Update = function(self, event, ...) + local bar = self.MageMagic + local spec = bar.CurrentSpec; + + if(bar.PreUpdate) then bar:PreUpdate(spec) end + + local maxCount = SpecMaximum[spec]; + local start, duration, reset = GetResources[spec](self, event, ...); + if(not reset) then + if(spec == 2) then + local ignite = bar.Ignite; + local igniteBar = ignite.Bar; + if(not ignite:IsShown()) then ignite:Show() end + if(duration and start and (start > igniteBar.start)) then + igniteBar.start = start + igniteBar.duration = duration + igniteBar:SetMinMaxValues(0, duration) + igniteBar.elapsed = 0 + igniteBar:SetValue(duration) + igniteBar:SetScript('OnUpdate', IgniteOnUpdate) + end + else + for i = 1, 5 do + if(i > maxCount) then + bar[i]:SetValue(0) + bar[i]:Hide() + else + if(not bar[i]:IsShown()) then bar[i]:Show() end + if(spec == 1) then + if i <= SPELLCOUNT then + if start and duration then + bar[i]:Show() + bar[i]:SetMinMaxValues(0, start) + bar[i].start = start + bar[i].duration = duration + bar[i]:SetValue(start) + bar[i]:SetScript('OnUpdate', BarOnUpdate) + else + bar[i]:SetValue(0) + bar[i]:SetScript('OnUpdate', nil) + bar[i]:Hide() + end + else + bar[i]:SetValue(0) + bar[i]:Hide() + end + else + bar[i]:SetMinMaxValues(0, 31) + if i <= SPELLCOUNT then + bar[i]:FadeIn() + bar[i]:SetValue(31) + bar[i]:SetScript('OnUpdate', IcicleOnUpdate) + else + bar[i]:SetValue(0) + bar[i]:SetScript('OnUpdate', nil) + bar[i]:FadeOut() + end + end + end + end + end + end + + if(bar.PostUpdate) then + return bar:PostUpdate(event, SPELLCOUNT, maxCount) + end +end + +local Proxy = function(self, ...) + local bar = self.MageMagic + local spec = GetSpecialization() + + if(not playerGUID) then + playerGUID = UnitGUID('player') + end + if((not bar.CurrentSpec) or (bar.CurrentSpec ~= spec)) then + ResetMagic(self); + if(spec) then + bar.CurrentSpec = spec; + if(bar.CurrentSpec == 3) then + self:UnregisterEvent('UNIT_AURA', Update) + self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update, true) + --print("Switch To Frost") + elseif(bar.CurrentSpec == 2) then + self:RegisterEvent('UNIT_AURA', Update) + self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update, true) + if(not bar.Ignite:IsShown()) then bar.Ignite:Show() end + bar.Ignite.Bar:SetValue(0) + --print("Switch To Fire") + elseif(bar.CurrentSpec == 1) then + self:RegisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update) + --print("Switch To Arcane") + end + if(bar.PostTalentUpdate) then bar:PostTalentUpdate(spec) end + else + self:UnregisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update) + end + end + return Update(self, ...) +end + +local Path = function(self, ...) + return (self.MageMagic.Override or Proxy) (self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate', element.__owner.unit) +end + +local Enable = function(self, unit) + local bar = self.MageMagic + + if(bar) then + self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) + bar.__owner = self + bar.ForceUpdate = ForceUpdate + + for i = 1, 5 do + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + end + + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) + + if bar[i].bg then + bar[i]:SetMinMaxValues(0, 1) + bar[i]:SetValue(0) + bar[i].bg:SetAlpha(0.4) + bar[i].bg:SetAllPoints() + bar[i]:Hide() + end + end + bar.Ignite.Bar:SetMinMaxValues(0, 5) + bar.Ignite.Bar:SetValue(0) + bar.Ignite:Hide() + + return true; + end +end + +local Disable = function(self, unit) + local bar = self.MageMagic + + if(bar) then + self:UnregisterEvent("UNIT_AURA", Update) + self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED", Update) + self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) + bar:Hide() + end +end + +oUF:AddElement("MageMagic", Path, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc new file mode 100644 index 0000000..cccf22e --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MageMagic/oUF_MageMagic.toc @@ -0,0 +1,8 @@ +## Interface: 50001 +## Title: oUF Mage Magic +## Notes: Adds support for mage spell indicators to oUF. +## Author: Munglunch +## Version: 5.4.15 +## Dependencies: oUF + +oUF_MageMagic.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua deleted file mode 100644 index 4abe6dd..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_MonkHarmony/oUF_MonkHarmony.lua +++ /dev/null @@ -1,105 +0,0 @@ ---GLOBAL NAMESPACE -local _G = _G; ---LUA -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; ---BLIZZARD API -local UnitPower = _G.UnitPower; -local UnitPowerMax = _G.UnitPowerMax; -local UnitHasVehicleUI = _G.UnitHasVehicleUI; - -if select(2, UnitClass('player')) ~= "MONK" then return end - -local _, ns = ... -local oUF = ns.oUF or oUF - -local SPELL_POWER_CHI = SPELL_POWER_CHI - -oUF.colors.MonkHarmony = { - [1] = {.57, .63, .35, 1}, - [2] = {.47, .63, .35, 1}, - [3] = {.37, .63, .35, 1}, - [4] = {.27, .63, .33, 1}, - [5] = {.17, .63, .33, 1}, - [6] = {0, .63, .33, 1}, -} - -local function Update(self, event, unit) - local hb = self.MonkHarmony - if(hb.PreUpdate) then hb:PreUpdate(event) end - local light = UnitPower("player", SPELL_POWER_CHI) - - -- if max light changed, show/hide the 5th and update anchors - local numPoints = UnitPowerMax("player", SPELL_POWER_CHI) - - for i = 1, numPoints do - local orb = hb[i] - if(orb) then - if i <= light then - orb:Show() - else - orb:Hide() - end - end - end - - if UnitHasVehicleUI("player") then - hb:Hide() - else - hb:Show() - end - - if hb.numPoints ~= numPoints then - if numPoints == 6 then - hb[5]:Show() - hb[6]:Show() - elseif numPoints == 5 then - hb[5]:Show() - hb[6]:Hide() - else - hb[5]:Hide() - hb[6]:Hide() - end - end - - hb.numPoints = numPoints - - if(hb.PostUpdate) then hb:PostUpdate(event) end -end - -local function Enable(self, unit) - if(unit ~= 'player') then return end - local hb = self.MonkHarmony - if hb then - self:RegisterEvent("PLAYER_ENTERING_WORLD", Update) - self:RegisterEvent("UNIT_POWER", Update) - self:RegisterEvent("UNIT_DISPLAYPOWER", Update) - self:RegisterEvent("PLAYER_LEVEL_UP", Update) - - for i = 1, 6 do - if not hb[i]:GetStatusBarTexture() then - hb[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) - end - - hb[i]:SetStatusBarColor(unpack(oUF.colors.MonkHarmony[i])) - hb[i]:SetFrameLevel(hb:GetFrameLevel() + 1) - hb[i]:GetStatusBarTexture():SetHorizTile(false) - end - - hb.numPoints = 6 - - return true - end -end - -local function Disable(self) - if self.MonkHarmony then - self:UnregisterEvent("PLAYER_ENTERING_WORLD", Update) - self:UnregisterEvent("UNIT_POWER", Update) - self:UnregisterEvent("UNIT_DISPLAYPOWER", Update) - self:UnregisterEvent("PLAYER_LEVEL_UP", Update) - end -end - -oUF:AddElement('MonkHarmony', Update, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml index 890bb5a..251115a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml @@ -61,15 +61,14 @@ <Script file="plugins\oUF_Experience\oUF_Experience.lua"/> <Script file="plugins\oUF_Reputation\oUF_Reputation.lua"/> <Script file="plugins\oUF_Friendship\oUF_Friendship.lua"/> - <Script file="plugins\oUF_ArcaneCharge\oUF_ArcaneCharge.lua"/> + <Script file="plugins\oUF_MageMagic\oUF_MageMagic.lua"/> <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_PallyPower\oUF_PallyPower.lua"/> <Script file="plugins\oUF_WarlockShards\oUF_WarlockShards.lua"/> <Script file="plugins\oUF_PriestOrbs\oUF_PriestOrbs.lua"/> - <Script file="plugins\oUF_MonkHarmony\oUF_MonkHarmony.lua"/> - <Script file="plugins\oUF_DrunkenMaster\oUF_DrunkenMaster.lua"/> + <Script file="plugins\oUF_KungFu\oUF_KungFu.lua"/> <Script file="plugins\oUF_TotemBars\oUF_TotemBars.lua"/> <Script file="plugins\oUF_HyperCombo\oUF_HyperCombo.lua"/> <Script file="plugins\oUF_Gladiator\oUF_Gladiator.lua"/> diff --git a/Interface/AddOns/SVUI/packages/quest/components/active.lua b/Interface/AddOns/SVUI/packages/quest/components/active.lua index e540c5f..2bd50cf 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/active.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/active.lua @@ -231,6 +231,7 @@ local SetActiveData = function(self, title, level, icon, questID, questLogIndex, block.Badge.Icon:SetTexture(icon); local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + MOD.QuestItem:RemoveAbility() if(link) then if(MOD.QuestItem:SetAbility(link, texture)) then MOD.QuestItem.CurrentQuest = questLogIndex diff --git a/Interface/AddOns/SVUI/packages/quest/components/button.lua b/Interface/AddOns/SVUI/packages/quest/components/button.lua index aa97152..f5fc6b7 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/button.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/button.lua @@ -111,13 +111,15 @@ local UpdateButton = function(self) end end - if(closestLink) then - self.CurrentQuest = closestIndex; - self:SetAbility(closestLink, closestTexture, closestQuest, closestLevel, closestTexture, closestID, closestIndex, closestCount, closestDuration, closestExpiration, closestComplete); - self.ArtFile = [[Interface\ExtraButton\Smash]]; - elseif(self:IsShown() and (self.CurrentQuest ~= MOD.CurrentQuest)) then - self.CurrentQuest = 0; - self:RemoveAbility(); + if(self.CurrentQuest ~= MOD.CurrentQuest) then + if(closestLink) then + self.CurrentQuest = closestIndex; + self:SetAbility(closestLink, closestTexture, closestQuest, closestLevel, closestTexture, closestID, closestIndex, closestCount, closestDuration, closestExpiration, closestComplete); + self.ArtFile = [[Interface\ExtraButton\Smash]]; + elseif(self:IsShown()) then + self.CurrentQuest = 0; + self:RemoveAbility(); + end end end --[[ diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index 4650d10..0451860 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -575,4 +575,108 @@ function MOD:CreateHealPrediction(frame, fullSet) end return healPrediction -end \ No newline at end of file +end +--[[ +########################################################## +RESOLVE +########################################################## +]]-- +local resolve +local resolveId = GetSpellInfo(158300) + +local function Short(value) + local fmt + if value >= 10000 then + fmt = "%.0fk" + value = value / 1000 + elseif value >= 1000 then + fmt = "%.1fk" + value = value / 1000 + else + fmt = "%d" + end + return fmt:format(value) +end + +local function IsTank() + local _, playerclass = UnitClass("player") + local masteryIndex + local tank = false + if playerclass == "DEATHKNIGHT" then + masteryIndex = GetSpecialization() + if masteryIndex and masteryIndex == 1 then + tank = true + end + elseif playerclass == "DRUID" then + masteryIndex = GetSpecialization() + if masteryIndex and masteryIndex == 3 then + tank = true + end + elseif playerclass == "MONK" then + masteryIndex = GetSpecialization() + if masteryIndex and masteryIndex == 1 then + tank = true + end + elseif playerclass == "PALADIN" then + masteryIndex = GetSpecialization() + if masteryIndex and masteryIndex == 2 then + tank = true + end + elseif playerclass == "WARRIOR" then + masteryIndex = GetSpecialization() + if masteryIndex and masteryIndex == 3 then + tank = true + end + end + return tank +end + +local ResolveBar_OnEvent = function(self, event, unit) + if(event == 'UNIT_AURA') then + local _, _, _, _, _, _, _, _, _, _, _, _, _, _, value, amount = UnitBuff(unit, resolveId) + if resolve ~= amount then + resolve = amount + self:SetValue(value) + self.text:SetText(Short(amount)) + end + else + if IsTank() then + if(not self:IsShown()) then + self:RegisterUnitEvent("UNIT_AURA", "player") + self:Show() + end + else + if(self:IsShown()) then + self:UnregisterEvent("UNIT_AURA") + self:Hide() + end + end + end +end + +function MOD:CreateResolveBar(frame) + local health = frame.Health; + + local resolve = CreateFrame('StatusBar', nil, health) + resolve:SetPoint("BOTTOMLEFT", health, "BOTTOMLEFT", -1, -1) + resolve:SetPoint("BOTTOMRIGHT", health, "BOTTOMRIGHT", 1, -1) + resolve:SetHeight(5) + resolve:SetFrameStrata("LOW") + resolve:SetFrameLevel(11) + resolve:SetStylePanel("Default", "Bar") + resolve:SetStatusBarTexture([[Interface\BUTTONS\WHITE8X8]]) + resolve:SetStatusBarColor(0.15, 0.7, 0.05, 0.9) + resolve:SetMinMaxValues(0, 100) + + resolve.text = resolve:CreateFontString(nil, "OVERLAY") + resolve.text:SetPoint("RIGHT") + resolve.text:FontManager("pixel", "RIGHT") + + resolve:Hide() + + resolve:RegisterEvent("PLAYER_TALENT_UPDATE") + resolve:RegisterEvent("PLAYER_ENTERING_WORLD") + resolve:SetScript('OnEvent', ResolveBar_OnEvent) + + return resolve +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 55a4df7..69ed2ad 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -226,14 +226,6 @@ local UpdatePlayerFrame = function(self) end end do - if(self.DruidMana) then - if db.power.druidMana then - self:EnableElement("DruidMana") - else - self:DisableElement("DruidMana") - self.DruidMana:Hide() - end - end if(self.DrunkenMaster) then if db.stagger.enable then if not self:IsElementEnabled("DrunkenMaster")then @@ -306,6 +298,7 @@ CONSTRUCTORS["player"] = function(self, unit) self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) + self.ResolveBar = MOD:CreateResolveBar(self) self.CombatFade = true; self:SetPointToScale("BOTTOMLEFT", SV.Screen, "BOTTOM", -413, 182) SV.Mentalo:Add(self, L["Player Frame"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/.subl53c.tmp b/Interface/AddOns/SVUI/packages/unit/resources/.subl53c.tmp new file mode 100644 index 0000000..e69de29 diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index 51468c7..4e1c59d 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -46,7 +46,11 @@ if(SV.class ~= "MAGE") then return end local MOD = SV.SVUnit if(not MOD) then return end -local specEffects = { [1] = "arcane", [2] = "none", [3] = "none" }; +local ORB_ICON = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB]]; +local ORB_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB-BG]]; +local MAGE_ANIMATION = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\MAGE-BG-ANIMATION]]; +SV.SpecialFX:Register("mage_fire", [[Spells\Fill_fire_cast_01.m2]], 2, -2, -2, 2, 0.5, -0.45, 1) +local specEffects = { [1] = "arcane", [2] = "mage_fire", [3] = "frost" }; --[[ ########################################################## POSITIONING @@ -54,7 +58,7 @@ POSITIONING ]]-- local Reposition = function(self) local db = SV.db.SVUnit.player - local bar = self.ArcaneChargeBar; + local bar = self.MageMagic; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; @@ -86,59 +90,100 @@ end MAGE CHARGES ########################################################## ]]-- -local PreUpdate = function(self, spec) - if(self.CurrentSpec ~= spec) then - local effectName = specEffects[spec] - if(effectName and effectName ~= 'none') then - if(not self:IsShown()) then - self:Show() - end - for i = 1, 4 do - self[i].FX:SetEffect(effectName) - end - else - self:Hide() +local PostTalentUpdate = function(self, spec) + if(not self:IsShown()) then + self:Show() + end + if(spec == 1 or spec == 3) then + for i = 1, 5 do + self[i].FX:SetEffect(specEffects[spec]) end - self.CurrentSpec = spec + else + self.Ignite.FX:SetEffect(specEffects[spec]) end end -local ChargeUpdate = function(self) - if not self.fg:IsShown() then self.fg:Show() end - if not self.fg.anim:IsPlaying() then self.fg.anim:Play() end -end - function MOD:CreateClassBar(playerFrame) - local max = 4 + local max = 5 + local spec = GetSpecialization() + local effectName = specEffects[spec] 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]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB") + bar[i]:SetStatusBarTexture(ORB_ICON) bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i]:SetOrientation("VERTICAL") bar[i].noupdate = true; bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") bar[i].bg:SetAllPoints(bar[i]) - bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG"); + bar[i].bg:SetTexture(ORB_BG); bar[i].fg = bar[i]:CreateTexture(nil, "OVERLAY") bar[i].fg:SetAllPoints(bar[i]) - bar[i].fg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-BG-ANIMATION") + bar[i].fg:SetTexture(MAGE_ANIMATION) bar[i].fg:SetBlendMode("ADD") bar[i].fg:SetVertexColor(0.5,0.6,0.6) bar[i].fg:SetTexCoord(0,0.25,0,1) - --bar[i].Update = ChargeUpdate - - local spec = GetSpecialization() - local effectName = specEffects[spec] SV.SpecialFX:SetFXFrame(bar[i], effectName) - end + end + + local bgFrame = CreateFrame("Frame", nil, bar) + bgFrame:SetAllPointsIn(bar) + SV.SpecialFX:SetFXFrame(bgFrame, effectName) + + local bgTexture = bgFrame:CreateTexture(nil, "BACKGROUND") + bgTexture:SetAllPoints(bgFrame) + bgTexture:SetTexture(0.09,0.01,0,0.5) + + local borderB = bgFrame:CreateTexture(nil,"OVERLAY") + borderB:SetTexture(0,0,0) + borderB:SetPoint("BOTTOMLEFT") + borderB:SetPoint("BOTTOMRIGHT") + borderB:SetHeight(2) + + local borderT = bgFrame:CreateTexture(nil,"OVERLAY") + borderT:SetTexture(0,0,0) + borderT:SetPoint("TOPLEFT") + borderT:SetPoint("TOPRIGHT") + borderT:SetHeight(2) + + local borderL = bgFrame:CreateTexture(nil,"OVERLAY") + borderL:SetTexture(0,0,0) + borderL:SetPoint("TOPLEFT") + borderL:SetPoint("BOTTOMLEFT") + borderL:SetWidth(2) + + local borderR = bgFrame:CreateTexture(nil,"OVERLAY") + borderR:SetTexture(0,0,0) + borderR:SetPoint("TOPRIGHT") + borderR:SetPoint("BOTTOMRIGHT") + borderR:SetWidth(2) + + bar.bg = bgTexture; + + + local ignite = CreateFrame("StatusBar", nil, bgFrame) + ignite.noupdate = true; + ignite:SetAllPointsIn(bgFrame) + ignite:SetOrientation("HORIZONTAL") + ignite:SetStatusBarTexture(SV.Media.bar.glow) + ignite:SetStatusBarColor(1, 0.2, 0, 0.75) + ignite.text = ignite:CreateFontString(nil, "OVERLAY") + ignite.text:SetPoint("LEFT") + ignite.text:FontManager("unitsecondary", "LEFT") + ignite.text:SetTextColor(1,1,0) + ignite.text:SetText("0") + bgFrame.Bar = ignite; + --SV.SpecialFX:SetFXFrame(ignite, "conqueror", true) + --ignite.FX:SetScript("OnShow", EffectModel_OnShow) + bar.Ignite = bgFrame; + bar.Ignite:Hide(); - bar.PreUpdate = PreUpdate; + bar.PostTalentUpdate = PostTalentUpdate; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) @@ -147,6 +192,6 @@ function MOD:CreateClassBar(playerFrame) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; - playerFrame.ArcaneChargeBar = bar - return 'ArcaneChargeBar' + playerFrame.MageMagic = bar + return 'MageMagic' end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index 84d7b30..e172bd7 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -45,6 +45,24 @@ local L = SV.L; if(SV.class ~= "MONK") then return end local MOD = SV.SVUnit if(not MOD) then return end + +local ORB_ICON = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB]]; +local ORB_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB-BG]]; + +local STAGGER_BAR = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\MONK-STAGGER-BAR]]; +local STAGGER_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\MONK-STAGGER-BG]]; +local STAGGER_FG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\MONK-STAGGER-FG]]; +local STAGGER_ICON = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\MONK-STAGGER-ICON]]; + +local CHI_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\MONK]]; +local CHI_COORDS = { + [1] = {0,0.5,0,0.5}, + [2] = {0.5,1,0,0.5}, + [3] = {0,0.5,0.5,1}, + [4] = {0.5,1,0.5,1}, + [5] = {0.5,1,0,0.5}, + [6] = {0,0.5,0.5,1}, +}; --[[ ########################################################## POSITIONING @@ -52,7 +70,7 @@ POSITIONING ]]-- local Reposition = function(self) local db = SV.db.SVUnit.player - local bar = self.MonkHarmony; + local bar = self.KungFu; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; @@ -86,62 +104,23 @@ local StartFlash = function(self) SV.Animate:Flash(self.overlay,1,true) end local StopFlash = function(self) SV.Animate:StopFlash(self.overlay) end --[[ ########################################################## -MONK STAGGER BAR -########################################################## -]]-- -local function CreateDrunkenMasterBar(playerFrame) - local stagger = CreateFrame("Statusbar",nil,playerFrame) - stagger:SetSize(45,90) - stagger:SetPointToScale('BOTTOMLEFT', playerFrame, 'BOTTOMRIGHT', 6, 0) - stagger:SetOrientation("VERTICAL") - stagger:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-BAR") - stagger:GetStatusBarTexture():SetHorizTile(false) - - stagger.bg = stagger:CreateTexture(nil,'BORDER',nil,1) - stagger.bg:SetAllPoints(stagger) - stagger.bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-BG") - stagger.bg:SetVertexColor(1,1,1,0.6) - - stagger.overlay = stagger:CreateTexture(nil,'OVERLAY') - stagger.overlay:SetAllPoints(stagger) - stagger.overlay:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-FG") - stagger.overlay:SetVertexColor(1,1,1) - - stagger.icon = stagger:CreateTexture(nil,'OVERLAY') - stagger.icon:SetAllPoints(stagger) - stagger.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-ICON") - - stagger:Hide() - return stagger -end ---[[ -########################################################## MONK HARMONY ########################################################## ]]-- -local CHI_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\MONK]]; -local CHI_DATA = { - [1] = {0,0.5,0,0.5}, - [2] = {0.5,1,0,0.5}, - [3] = {0,0.5,0.5,1}, - [4] = {0.5,1,0.5,1}, - [5] = {0.5,1,0,0.5}, - [6] = {0,0.5,0.5,1}, -}; function MOD:CreateClassBar(playerFrame) local max = 6 local bar = CreateFrame("Frame",nil,playerFrame) bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i=1, max do - local coords = CHI_DATA[i] + local coords = CHI_COORDS[i] bar[i] = CreateFrame("StatusBar", nil, bar) - bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB") + bar[i]:SetStatusBarTexture(ORB_ICON) bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i].noupdate = true; bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") bar[i].bg:SetAllPoints(bar[i]) - bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG") + bar[i].bg:SetTexture(ORB_BG) bar[i].glow = bar[i]:CreateTexture(nil, "OVERLAY") bar[i].glow:SetAllPoints(bar[i]) @@ -158,7 +137,32 @@ function MOD:CreateClassBar(playerFrame) bar[i]:SetScript("OnHide", StopFlash) SV.SpecialFX:SetFXFrame(bar[i], "chi") - end + end + + local stagger = CreateFrame("Statusbar",nil,playerFrame) + stagger:SetSize(45,90) + stagger:SetPointToScale('BOTTOMLEFT', playerFrame, 'BOTTOMRIGHT', 6, 0) + stagger:SetOrientation("VERTICAL") + stagger:SetStatusBarTexture(STAGGER_BAR) + stagger:GetStatusBarTexture():SetHorizTile(false) + + stagger.bg = stagger:CreateTexture(nil,'BORDER',nil,1) + stagger.bg:SetAllPoints(stagger) + stagger.bg:SetTexture(STAGGER_BG) + stagger.bg:SetVertexColor(1,1,1,0.6) + + stagger.overlay = stagger:CreateTexture(nil,'OVERLAY') + stagger.overlay:SetAllPoints(stagger) + stagger.overlay:SetTexture(STAGGER_FG) + stagger.overlay:SetVertexColor(1,1,1) + + stagger.icon = stagger:CreateTexture(nil,'OVERLAY') + stagger.icon:SetAllPoints(stagger) + stagger.icon:SetTexture(STAGGER_ICON) + + stagger:Hide() + + bar.DrunkenMaster = stagger local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) @@ -167,9 +171,8 @@ function MOD:CreateClassBar(playerFrame) SV.Mentalo:Add(bar.Holder, L["Classbar"]) playerFrame.MaxClassPower = max - playerFrame.DrunkenMaster = CreateDrunkenMasterBar(playerFrame) playerFrame.ClassBarRefresh = Reposition - playerFrame.MonkHarmony = bar - return 'MonkHarmony' + playerFrame.KungFu = bar + return 'KungFu' end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index aeb5251..59bab61 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -48,7 +48,8 @@ if(SV.class ~= "PRIEST") then return end local MOD = SV.SVUnit if(not MOD) then return end -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\PRIEST]] +local ORB_ICON = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB]] +local ORB_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB-BG]] local specEffects = { [1] = "holy", [2] = "holy", [3] = "shadow" }; --[[ ########################################################## @@ -106,13 +107,13 @@ function MOD:CreateClassBar(playerFrame) for i=1, max do bar[i] = CreateFrame("StatusBar", nil, bar) - bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB") + bar[i]:SetStatusBarTexture(ORB_ICON) bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i].noupdate = true; bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") bar[i].bg:SetAllPoints(bar[i]) - bar[i].bg:SetTexture(ICON_FILE) + bar[i].bg:SetTexture(ORB_BG) bar[i].bg:SetTexCoord(0,0.5,0,0.5) local spec = GetSpecialization() diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua index bf8280d..194d588 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua @@ -34,12 +34,106 @@ assert(oUF_Villain, "SVUI was unable to locate oUF.") local L = SV.L; if(SV.class ~= "WARRIOR") then return end local MOD = SV.SVUnit -if(not MOD) then return end +if(not MOD) then return end + +local ORB_ICON = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB]]; +local ORB_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\ORB-BG]]; +SV.SpecialFX:Register("conqueror", [[Spells\Warlock_destructioncharge_impact_chest.m2]], 2, -2, -2, 2, 0.9, 0, 0.8) --[[ ########################################################## -PLACEHOLDER +POSITIONING ########################################################## ]]-- +local Reposition = function(self) + local db = SV.db.SVUnit.player + local bar = self.Conqueror; + local max = self.MaxClassPower; + local size = db.classbar.height + local width = size * max; + 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) +end + +local EffectModel_OnShow = function(self) + self:SetEffect("conqueror"); +end + function MOD:CreateClassBar(playerFrame) - return -end \ No newline at end of file + return +end +-- function MOD:CreateClassBar(playerFrame) +-- local max = 6 +-- local bar = CreateFrame("Frame",nil,playerFrame) + +-- bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) +-- --SV.SpecialFX:SetFXFrame(bar, "conqueror") +-- --bar.FX:SetFrameStrata("BACKGROUND") +-- --bar.FX:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 1) + +-- local bgFrame = CreateFrame("Frame", nil, bar) +-- bgFrame:SetAllPointsIn(bar, 1, 4) +-- SV.SpecialFX:SetFXFrame(bgFrame, "conqueror") + +-- local bgTexture = bgFrame:CreateTexture(nil, "BACKGROUND") +-- bgTexture:SetAllPoints(bgFrame) +-- bgTexture:SetTexture(0.2,0,0,0.5) + +-- local borderB = bgFrame:CreateTexture(nil,"OVERLAY") +-- borderB:SetTexture(0,0,0) +-- borderB:SetPoint("BOTTOMLEFT") +-- borderB:SetPoint("BOTTOMRIGHT") +-- borderB:SetHeight(2) + +-- local borderT = bgFrame:CreateTexture(nil,"OVERLAY") +-- borderT:SetTexture(0,0,0) +-- borderT:SetPoint("TOPLEFT") +-- borderT:SetPoint("TOPRIGHT") +-- borderT:SetHeight(2) + +-- local borderL = bgFrame:CreateTexture(nil,"OVERLAY") +-- borderL:SetTexture(0,0,0) +-- borderL:SetPoint("TOPLEFT") +-- borderL:SetPoint("BOTTOMLEFT") +-- borderL:SetWidth(2) + +-- local borderR = bgFrame:CreateTexture(nil,"OVERLAY") +-- borderR:SetTexture(0,0,0) +-- borderR:SetPoint("TOPRIGHT") +-- borderR:SetPoint("BOTTOMRIGHT") +-- borderR:SetWidth(2) + +-- bar.bg = bgTexture; + +-- local enrage = CreateFrame("StatusBar", nil, bgFrame) +-- enrage.noupdate = true; +-- enrage:SetAllPointsIn(bgFrame) +-- enrage:SetOrientation("HORIZONTAL") +-- enrage:SetStatusBarTexture(SV.Media.bar.glow) +-- enrage:SetStatusBarColor(1, 0.2, 0, 0.75) + +-- --SV.SpecialFX:SetFXFrame(enrage, "conqueror", true) +-- --enrage.FX:SetScript("OnShow", EffectModel_OnShow) +-- bar.Enrage = enrage; + + +-- 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.MaxClassPower = max +-- playerFrame.ClassBarRefresh = Reposition + +-- playerFrame.Conqueror = bar +-- return 'Conqueror' +-- end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index 6b197c3..dd6d5b8 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -231,11 +231,12 @@ do function SV:SetReversePoint(frame, point, target, x, y) if((not frame) or (not point)) then return; end + target = target or frame:GetParent() + if(not target) then print(frame:GetName()) return; end local anchor = _inverted[point]; local relative = _translated[point]; x = x or 0; y = y or 0; - target = target or frame:GetParent() frame:SetPoint(anchor, target, relative, x, y) --[[ auto-set specific properties to save on logic ]]-- frame.initialAnchor = anchor;