diff --git a/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua b/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua index d82f20e..d4544ab 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua @@ -66,7 +66,7 @@ local EFFECTS_LIST = setmetatable({ ["holy"] = {[[Spells\Solar_precast_hand.m2]], -12, 12, 12, -12, 0.23, 0, 0}, ["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}, + ["fire"] = {[[Spells\Bloodlust_state_hand.m2]], -8, 4, 24, -24, 0.70, -0.22, 0.22}, ["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.04, -0.1}, ["lightning"] = {[[Spells\Fill_lightning_cast_01.m2]], -12, 12, 12, -12, 1.25, 0, 0}, diff --git a/SVUI_UnitFrames/class_resources/rogue.lua b/SVUI_UnitFrames/class_resources/rogue.lua index 3e94f93..33f59fa 100644 --- a/SVUI_UnitFrames/class_resources/rogue.lua +++ b/SVUI_UnitFrames/class_resources/rogue.lua @@ -69,12 +69,14 @@ local OnMove = function() end local ShowPoint = function(self) - self.FX:SetEffect("default") + --self.FX:SetEffect("default") + --self.Blood:SetTexture(BLOOD_TEXTURE) end local HidePoint = function(self) local coords = ICON_COORDS[random(2,4)]; self.Icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) + self.Blood:SetTexture(BLOOD_TEXTURE) end local Reposition = function(self) @@ -100,23 +102,16 @@ local Reposition = function(self) bar:SetAllPoints(bar.Holder) local points = bar.Combo; - local max = MAX_COMBO_POINTS; + local max = UnitPowerMax('player', SPELL_POWER_COMBO_POINTS); local size = height + 4 points:ClearAllPoints() points:SetAllPoints(bar) - if(db.classbar.altComboPoints) then + --if(db.classbar.altComboPoints) then for i = 1, max do - points[i].FX:SetAlpha(0) + --points[i].FX:SetAlpha(0) points[i]:ClearAllPoints() points[i]:SetSize(size, size) - points[i].Icon:SetTexture(ICON_FILE) - points[i].Icon:ClearAllPoints() - points[i].Icon:SetAllPoints(points[i]) - if(points[i].Blood) then - points[i].Blood:SetTexture(BLOOD_TEXTURE) - points[i].Blood:ClearAllPoints() - points[i].Blood:SetAllPoints(points[i]) - end + --points[i].Icon:SetTexture(ICON_FILE) if i==1 then points[i]:SetPoint("LEFT", points) else @@ -125,28 +120,24 @@ local Reposition = function(self) end bar.PointShow = nil; bar.PointHide = HidePoint; - else - for i = 1, max do - points[i].FX:SetAlpha(1) - points[i]:ClearAllPoints() - points[i]:SetSize(size, size) - points[i].Icon:SetTexture(EMPTY_TEXTURE) - if(points[i].Blood) then - points[i].Blood:SetTexture(EMPTY_TEXTURE) - end - if i==1 then - points[i]:SetPoint("LEFT", points) - else - points[i]:SetPoint("LEFT", points[i - 1], "RIGHT", -8, 0) - end - end - bar.PointShow = ShowPoint; - bar.PointHide = nil; - end - - if(bar.Guile) then - bar.Guile:SetFont(TRACKER_FONT, height, 'OUTLINE') - end + -- else + -- for i = 1, max do + -- points[i].FX:SetAlpha(1) + -- points[i]:ClearAllPoints() + -- points[i]:SetSize(size, size) + -- points[i].Icon:SetTexture(EMPTY_TEXTURE) + -- if(points[i].Blood) then + -- points[i].Blood:SetTexture(EMPTY_TEXTURE) + -- end + -- if i==1 then + -- points[i]:SetPoint("LEFT", points) + -- else + -- points[i]:SetPoint("LEFT", points[i - 1], "RIGHT", -8, 0) + -- end + -- end + -- bar.PointShow = ShowPoint; + -- bar.PointHide = nil; + -- end end --[[ ########################################################## @@ -155,7 +146,7 @@ ROGUE COMBO TRACKER ]]-- function MOD:CreateClassBar(playerFrame) local max = 5 - local size = 30 + local size = 25 local coords local bar = CreateFrame("Frame", nil, playerFrame) @@ -167,7 +158,7 @@ function MOD:CreateClassBar(playerFrame) local cpoint = CreateFrame('Frame', nil, bar.Combo) cpoint:SetSize(size,size) - SV.SpecialFX:SetFXFrame(cpoint, "default") + --SV.SpecialFX:SetFXFrame(cpoint, "default") local icon = cpoint:CreateTexture(nil,"OVERLAY",nil,1) icon:SetAllPoints(cpoint) @@ -178,37 +169,19 @@ function MOD:CreateClassBar(playerFrame) local blood = cpoint:CreateTexture(nil,"OVERLAY",nil,2) blood:SetSize(size,size) - blood:SetPoint("BOTTOMRIGHT",cpoint,12,-12) - blood:SetTexture([[Interface\Addons\SVUI_UnitFrames\assets\Class\COMBO-ANIMATION]]) + blood:SetPoint("BOTTOMRIGHT",cpoint,6,-6) + blood:SetTexture(EMPTY_TEXTURE) blood:SetBlendMode("ADD") SV.Animate:Sprite4(blood,0.08,2,true) cpoint.Blood = blood - local anti = CreateFrame('Frame',nil,bar.Combo) - anti:WrapPoints(cpoint, 8, 8) - anti:SetFrameLevel(bar.Combo:GetFrameLevel() - 2) - - anti.icon = anti:CreateTexture(nil,"BACKGROUND",nil,-1) - anti.icon:SetPoint("TOPLEFT", anti, "TOPLEFT", -8, 0) - anti.icon:SetPoint("BOTTOMRIGHT", anti, "BOTTOMRIGHT", 6, -2) - anti.icon:SetTexture(ICON_ANTI) - anti:Hide() - cpoint.Anticipation = anti - bar.Combo[i] = cpoint end bar.PointShow = ShowPoint; bar.PointHide = HidePoint; - local guile = bar:CreateFontString(nil, 'OVERLAY', nil, 7) - guile:SetPoint("RIGHT", bar, "LEFT", 0, -3) - guile:SetFont(TRACKER_FONT, 30, 'OUTLINE') - guile:SetTextColor(1,1,1) - - bar.Guile = guile; - local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) diff --git a/SVUI_UnitFrames/class_resources/warlock.lua b/SVUI_UnitFrames/class_resources/warlock.lua index 4b80161..c29e4c6 100644 --- a/SVUI_UnitFrames/class_resources/warlock.lua +++ b/SVUI_UnitFrames/class_resources/warlock.lua @@ -38,10 +38,7 @@ local oUF_SVUI = MOD.oUF assert(oUF_SVUI, "SVUI UnitFrames: unable to locate oUF.") if(SV.class ~= "WARLOCK") then return end -SV.SpecialFX:Register("affliction", [[Spells\Warlock_bodyofflames_medium_state_shoulder_right_purple.m2]], -12, 12, 12, -12, 0.22, 0, 0.52) -SV.SpecialFX:Register("overlay_demonbar", [[Spells\Warlock_destructioncharge_impact_chest.m2]], -20, -1, 20, -50, 0.9, 0, 0.8) -SV.SpecialFX:Register("underlay_demonbar", [[Spells\Fill_fire_cast_01.m2]], 3, -2, -3, 2, 0.5, -0.45, 1) -local specEffects = { [1] = "affliction", [2] = "none", [3] = "fire" }; +SV.SpecialFX:Register("affliction", [[Spells\Warlock_bodyofflames_medium_state_shoulder_right_purple.m2]], -12, 12, 12, -12, 0.45, 0, 0.45); --[[ ########################################################## LOCAL FUNCTIONS @@ -50,9 +47,9 @@ LOCAL FUNCTIONS local FURY_FONT = [[Interface\AddOns\SVUI_!Core\assets\fonts\Numbers.ttf]] 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}} + [2] = {{0.87,0.32,0.93,1}, {0,0,0,0.9}}, + [3] = {{1,1,0,1}, {0,0,0,0.9}}, + [4] = {{0.5,1,0,1}, {0,0,0,0.9}} } local shardTextures = { [1] = { @@ -62,10 +59,10 @@ local shardTextures = { "affliction" }, [2] = { - SV.NoTexture, - SV.NoTexture, - SV.NoTexture, - "none" + [[Interface\Addons\SVUI_UnitFrames\assets\Class\WARLOCK-SHARD]], + [[Interface\Addons\SVUI_UnitFrames\assets\Class\WARLOCK-SHARD-BG]], + [[Interface\Addons\SVUI_UnitFrames\assets\Class\WARLOCK-SHARD-FG]], + "affliction" }, [3] = { [[Interface\Addons\SVUI_UnitFrames\assets\Class\WARLOCK-EMBER]], @@ -115,15 +112,6 @@ local Reposition = function(self) bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -2, 0) end end - - local barHeight = bar.Holder:GetHeight() - local fontSize = floor(barHeight * 0.45) - local offset = fontSize * 2 - - bar.DemonicFury:ClearAllPoints() - bar.DemonicFury:SetPoint("TOPLEFT", bar.Holder, "TOPLEFT", 0, 0) - bar.DemonicFury:SetPoint("BOTTOMRIGHT", bar.Holder, "BOTTOMRIGHT", -offset, 6) - bar.DemonicFury.text:SetFont(FURY_FONT, fontSize, 'OUTLINE') end --[[ ########################################################## @@ -133,7 +121,7 @@ CUSTOM HANDLERS local UpdateTextures = function(self, spec) local max = self.MaxCount; local colors = shardColors[spec]; - local textures = shardTextures[spec]; + local textures = shardTextures[1]; if(spec == SPEC_WARLOCK_DESTRUCTION and IsSpellKnown(101508)) then colors = shardColors[4] end @@ -179,7 +167,7 @@ local EffectModel_OnShow = function(self) end function MOD:CreateClassBar(playerFrame) - local max = 4; + local max = 5; local textures = shardTextures[1]; local colors = shardColors[1]; local bar = CreateFrame("Frame",nil,playerFrame) @@ -205,68 +193,8 @@ function MOD:CreateClassBar(playerFrame) SV.SpecialFX:SetFXFrame(bar[i], textures[4], true) bar[i].Update = ShardUpdate - end - - local demonicFury = CreateFrame("Frame", nil, bar) - demonicFury:SetFrameStrata("BACKGROUND") - demonicFury:SetFrameLevel(0) - SV.SpecialFX:SetFXFrame(demonicFury, "underlay_demonbar") - demonicFury.FX:SetFrameStrata("BACKGROUND") - demonicFury.FX:SetFrameLevel(0) - - local bgFrame = CreateFrame("Frame", nil, demonicFury) - bgFrame:InsetPoints(demonicFury) - - local bgTexture = bgFrame:CreateTexture(nil, "BACKGROUND") - bgTexture:SetAllPoints(bgFrame) - bgTexture:SetColorTexture(0.1,0,0,0.75) - - local borderB = bgFrame:CreateTexture(nil,"OVERLAY") - borderB:SetColorTexture(0,0,0) - borderB:SetPoint("BOTTOMLEFT") - borderB:SetPoint("BOTTOMRIGHT") - borderB:SetHeight(2) - - local borderT = bgFrame:CreateTexture(nil,"OVERLAY") - borderT:SetColorTexture(0,0,0) - borderT:SetPoint("TOPLEFT") - borderT:SetPoint("TOPRIGHT") - borderT:SetHeight(2) - - local borderL = bgFrame:CreateTexture(nil,"OVERLAY") - borderL:SetColorTexture(0,0,0) - borderL:SetPoint("TOPLEFT") - borderL:SetPoint("BOTTOMLEFT") - borderL:SetWidth(2) - - local borderR = bgFrame:CreateTexture(nil,"OVERLAY") - borderR:SetColorTexture(0,0,0) - borderR:SetPoint("TOPRIGHT") - borderR:SetPoint("BOTTOMRIGHT") - borderR:SetWidth(2) - - local demonBar = CreateFrame("StatusBar", nil, bgFrame) - demonBar.noupdate = true; - demonBar:InsetPoints(bgFrame,2,2) - demonBar:SetOrientation("HORIZONTAL") - demonBar:SetStatusBarTexture(SV.media.statusbar.default) - - demonicFury.text = demonicFury:CreateFontString(nil, "OVERLAY") - demonicFury.text:SetPoint("LEFT", demonicFury, "RIGHT", 0, 0) - demonicFury.text:SetFont(FURY_FONT, 16, 'OUTLINE') - demonicFury.text:SetJustifyH('LEFT') - demonicFury.text:SetTextColor(1,1,0) - demonicFury.text:SetText("0") - - 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; + end + bar.UpdateTextures = UpdateTextures; bar.MaxCount = max; diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua index 710beb6..5604a0c 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua @@ -88,41 +88,22 @@ end local UpdateVisibility = function(self, event) local bar = self.Druidness - --local chicken = bar.Chicken local cat = bar.Cat local mana = bar.Mana local form = GetShapeshiftFormID() if(form) then - if(form == MOONKIN_FORM) then - --chicken:ProxyShow() - mana:Hide() - cat:Hide() - self:RegisterEvent('UNIT_AURA', UpdateAura) - else - --chicken:Hide() - self:UnregisterEvent('UNIT_AURA', UpdateAura) - - if (form == BEAR_FORM or form == CAT_FORM) then - if(CatOverMana(mana, form)) then - cat:ProxyShow() - else - cat:Hide() - end + if (form == BEAR_FORM or form == CAT_FORM) then + if(CatOverMana(mana, form)) then + cat:ProxyShow() else cat:Hide() - mana:Hide() end - end - else - local ptt = GetSpecialization() - if(ptt and ptt == 1) then -- player has balance spec - --chicken:ProxyShow() - self:RegisterEvent('UNIT_AURA', UpdateAura) else - --chicken:Hide() - self:UnregisterEvent('UNIT_AURA', UpdateAura) + cat:Hide() + mana:Hide() end + else mana:Hide() cat:Hide() end @@ -132,27 +113,6 @@ local UpdatePower = function(self, event, unit, powerType) if(self.unit ~= unit) then return end local bar = self.Druidness - if(powerType == 'ECLIPSE' and bar.Chicken) then - --local chicken = bar.Chicken - local power = UnitPower('player', SPELL_POWER_ECLIPSE) - local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) - if maxPower == 0 then maxPower = 100 end - --print(maxPower)print(power) - --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 - -- chicken:PostUpdatePower() - --end - end - if(bar.Mana and bar.Mana.ManaBar) then local mana = bar.Mana if(mana.PreUpdate) then @@ -210,12 +170,13 @@ local UpdateComboPoints = function(self, event, unit) local current = 0 if(UnitHasVehicleUI'player') then - current = GetComboPoints('vehicle', 'target') + current = UnitPower("vehicle", SPELL_POWER_COMBO_POINTS); else - current = GetComboPoints('player', 'target') + current = UnitPower("player", SPELL_POWER_COMBO_POINTS); end if(cpoints) then + local MAX_COMBO_POINTS = UnitPowerMax("player", SPELL_POWER_COMBO_POINTS); for i=1, MAX_COMBO_POINTS do if(i <= current) then cpoints[i]:Show() @@ -251,27 +212,20 @@ local function Enable(self) local bar = self.Druidness if(bar) then - --local chicken = bar.Chicken; local mana = bar.Mana; local cpoints = bar.Cat; - --chicken.__owner = self; - --chicken.ForceUpdate = ForceUpdate; - --chicken.ProxyShow = ProxyShow; mana.ProxyShow = ProxyShow; cpoints.ProxyShow = ProxyShow; - --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 - self:RegisterEvent('UNIT_POWER_FREQUENT', UpdatePower) self:RegisterEvent('PLAYER_TALENT_UPDATE', UpdateVisibility, true) self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UpdateVisibility, true) - self:RegisterEvent('UNIT_COMBO_POINTS', UpdateComboPoints, true) self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateComboPoints, true) + self:RegisterEvent('UNIT_DISPLAYPOWER', UpdateComboPoints, true) + self:RegisterEvent('UNIT_MAXPOWER', UpdateComboPoints, true) + self:RegisterUnitEvent('UNIT_DISPLAYPOWER', "player") + self:RegisterUnitEvent("UNIT_POWER_FREQUENT", "player") + self:RegisterUnitEvent("UNIT_MAXPOWER", "player") UpdateVisibility(self) return true @@ -292,6 +246,8 @@ local function Disable(self) self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UpdateVisibility) self:UnregisterEvent('UNIT_COMBO_POINTS', UpdateComboPoints) self:UnregisterEvent('PLAYER_TARGET_CHANGED', UpdateComboPoints) + self:UnregisterEvent('UNIT_DISPLAYPOWER', UpdateComboPoints) + self:UnregisterEvent('UNIT_MAXPOWER', UpdateComboPoints) end end diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua b/SVUI_UnitFrames/libs/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua index 26b9e92..007e596 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua @@ -35,10 +35,6 @@ 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}, @@ -48,34 +44,23 @@ local TextColors = { [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 Update = function(self, event, unit) - if(unit == 'pet') then return end + if(not (unit == 'player')) then return end local bar = self.HyperCombo; local cpoints = bar.Combo; - - if(bar.PreUpdate) then - bar:PreUpdate() + local current = 0 + if(UnitHasVehicleUI'player') then + current = UnitPower("vehicle", SPELL_POWER_COMBO_POINTS); + else + current = UnitPower("player", SPELL_POWER_COMBO_POINTS); end - local comboSource = (UnitHasVehicleUI'player') and 'vehicle' or 'player'; - local current = GetComboPoints(comboSource) - if(not current) then return end - local anti = select(4, UnitBuff("player", ANTICIPATION)) -- Anticipation stacks + if(cpoints and current) then + if(bar.PreUpdate) then + bar:PreUpdate() + end - if(cpoints) then + local MAX_COMBO_POINTS = UnitPowerMax("player", SPELL_POWER_COMBO_POINTS); for i=1, MAX_COMBO_POINTS do if(i <= current) then cpoints[i]:Show() @@ -85,34 +70,15 @@ local Update = function(self, event, unit) else cpoints[i]:Hide() if(bar.PointHide) then - bar.PointHide(cpoints[i]) - end - end - if(cpoints[i].Anticipation) then - anti = anti or 0 - if(i <= anti and (current > 0)) then - cpoints[i].Anticipation:Show() - else - cpoints[i].Anticipation:Hide() + bar.PointHide(cpoints[i], i) end end end - end - local guile = bar.Guile; - if(guile) then - local insight = UpdateGuile() - if(insight and insight > 0) then - guile:SetText(insight) - guile:SetTextColor(unpack(TextColors[insight])) - else - guile:SetText("") + if(bar.PostUpdate) then + return bar:PostUpdate(current) end end - - if(bar.PostUpdate) then - return bar:PostUpdate(current) - end end local Path = function(self, ...) @@ -128,14 +94,19 @@ local Enable = function(self) if(bar) then bar.__owner = self bar.ForceUpdate = ForceUpdate - - self:RegisterEvent('UNIT_COMBO_POINTS', Path, true) + self:RegisterEvent('PLAYER_ENTERING_WORLD', Path, true) self:RegisterEvent('PLAYER_TARGET_CHANGED', Path, true) - self:RegisterEvent('UNIT_AURA', Path, true) + self:RegisterEvent('UNIT_DISPLAYPOWER', Path, true) + self:RegisterUnitEvent('UNIT_DISPLAYPOWER', "player") + self:RegisterEvent('UNIT_POWER_FREQUENT', Path, true) + self:RegisterUnitEvent("UNIT_POWER_FREQUENT", "player") + self:RegisterEvent('UNIT_MAXPOWER', Path, true) + self:RegisterUnitEvent("UNIT_MAXPOWER", "player") local cpoints = bar.Combo; if(cpoints) then - for index = 1, MAX_COMBO_POINTS do + local maxComboPoints = UnitPowerMax("player", SPELL_POWER_COMBO_POINTS); + for index = 1, maxComboPoints do local cpoint = cpoints[index] if(cpoint:IsObjectType'Texture' and not cpoint:GetTexture()) then cpoint:SetTexture[[Interface\ComboFrame\ComboPoint]] @@ -152,13 +123,16 @@ local Disable = function(self) if(bar) then local cpoints = bar.Combo; if(cpoints) then - for index = 1, MAX_COMBO_POINTS do + local maxComboPoints = UnitPowerMax(self.unit, SPELL_POWER_COMBO_POINTS); + for index = 1, maxComboPoints do cpoints[index]:Hide() end end - self:UnregisterEvent('UNIT_COMBO_POINTS', Path) + self:UnregisterEvent('PLAYER_ENTERING_WORLD', Path) + self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) self:UnregisterEvent('PLAYER_TARGET_CHANGED', Path) - self:UnregisterEvent('UNIT_AURA', Path) + self:UnregisterEvent('UNIT_POWER_FREQUENT', Path) + self:UnregisterEvent('UNIT_MAXPOWER', Path) end end diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua b/SVUI_UnitFrames/libs/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua index 108c54a..ce045d0 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua @@ -20,24 +20,20 @@ local oUF = ns.oUF or oUF assert(oUF, 'oUF_WarlockShards was unable to locate oUF install') -local MAX_POWER_PER_EMBER = 10 -local SPELL_POWER_DEMONIC_FURY = SPELL_POWER_DEMONIC_FURY -local SPELL_POWER_BURNING_EMBERS = SPELL_POWER_BURNING_EMBERS -local SPELL_POWER_SOUL_SHARDS = SPELL_POWER_SOUL_SHARDS -local SPEC_WARLOCK_DESTRUCTION = SPEC_WARLOCK_DESTRUCTION -local SPEC_WARLOCK_AFFLICTION = SPEC_WARLOCK_AFFLICTION -local SPEC_WARLOCK_DEMONOLOGY = SPEC_WARLOCK_DEMONOLOGY - local shardColor = { [1] = {0.57,0.08,1}, [2] = {1,0,0}, [3] = {1,0.25,0} } +local shardMax = { + [1] = 5, + [2] = 4, + [3] = 4 +} + local Update = function(self, event, unit, powerType) local bar = self.WarlockShards; - local fury = bar.DemonicFury; - local maxBars = bar.MaxCount or 4; if(bar.PreUpdate) then bar:PreUpdate(unit) end @@ -50,6 +46,7 @@ local Update = function(self, event, unit, powerType) local spec = GetSpecialization() if spec then + bar.MaxCount = shardMax[spec] if not bar:IsShown() then bar:Show() end @@ -60,78 +57,24 @@ local Update = function(self, event, unit, powerType) 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) - - 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) - - for i = 1, maxBars do - if((i == maxBars) and (maxShards == 3)) then - bar[i]:Hide() - else - 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 + local numShards = UnitPower("player", SPELL_POWER_SOUL_SHARDS); - for i = 1, maxBars do + for i = 1, 5 do + if(i > bar.MaxCount) then bar[i]:Hide() - end - - fury.bar:SetStatusBarColor(unpack(colors)) - fury.bar:SetMinMaxValues(0, maxPower) - fury.bar:SetValue(power) - fury.text:SetText(power) - if(percent > 99) then - fury.text:SetTextColor(1,0,0) - elseif(percent > 80) then - fury.text:SetTextColor(1,0.5,0) - elseif(percent > 50) then - fury.text:SetTextColor(1,1,0) else - fury.text:SetTextColor(1,1,1) - end - - if(fury.bar.Update) then - local filled = (percent > 80) and 1 or 0 - fury.bar:Update(filled) + 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 else if bar:IsShown() then bar:Hide() end; - if fury:IsShown() then fury:Hide() end; end if(bar.PostUpdate) then @@ -158,9 +101,14 @@ local function Enable(self, unit) self:RegisterEvent('UNIT_POWER', Path) self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) - - local maxBars = bar.MaxCount or 4; - for i = 1, maxBars do + self:RegisterEvent('UNIT_DISPLAYPOWER', Path) + self:RegisterEvent("UNIT_POWER_FREQUENT", Path) + self:RegisterEvent("UNIT_MAXPOWER", Path) + self:RegisterUnitEvent('UNIT_DISPLAYPOWER', "player") + self:RegisterUnitEvent("UNIT_POWER_FREQUENT", "player") + self:RegisterUnitEvent("UNIT_MAXPOWER", "player") + + for i = 1, 5 do if not bar[i]:GetStatusBarTexture() then bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end @@ -179,6 +127,9 @@ local function Disable(self) self:UnregisterEvent('UNIT_POWER', Path) self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) + self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) + self:UnregisterEvent("UNIT_POWER_FREQUENT", Path) + self:UnregisterEvent("UNIT_MAXPOWER", Path) bar:Hide() end end