Skip to content

Commit

Permalink
Cleanup some old code
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed Nov 15, 2020
1 parent 137f976 commit 78f1ff6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 63 deletions.
1 change: 0 additions & 1 deletion Modules/HolyPower/HolyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ local L = PitBull4.L
-- CONSTANTS ----------------------------------------------------------------

local SPELL_POWER_HOLY_POWER = 9 -- Enum.PowerType.HolyPower
local SPEC_PALADIN_RETRIBUTION = _G.SPEC_PALADIN_RETRIBUTION

local MAX_POWER = 5

Expand Down
5 changes: 1 addition & 4 deletions Modules/PhaseIcon/PhaseIcon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ end

function PitBull4_PhaseIcon:OnEnter()
local unit = self:GetParent().unit
local tooltip = _G.PARTY_PHASED_MESSAGE
local phaseReason = UnitPhaseReason(unit)
if phaseReason then
tooltip = PartyUtil.GetPhasedReasonString(phaseReason, unit)
end
local tooltip = PartyUtil.GetPhasedReasonString(phaseReason, unit) or _G.PARTY_PHASED_MESSAGE
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(tooltip, nil, nil, nil, nil, true)
GameTooltip:Show()
Expand Down
55 changes: 1 addition & 54 deletions Modules/SoulShards/Controls.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

local PitBull4 = _G.PitBull4
local is_725 = _G.ClassNameplateBarWarlockShardMixin and true

-- CONSTANTS ----------------------------------------------------------------

Expand Down Expand Up @@ -60,31 +59,6 @@ function SoulShard:Update(powerAmount)
end
end

if not is_725 then
function SoulShard:Setup(id)
self.shardIndex = id
end

function SoulShard:Update(powerAmount)
local fillAmount = min(max(powerAmount - self.shardIndex, 0), 1)
local active = fillAmount >= 1

if fillAmount ~= self.fillAmount then
self.fillAmount = fillAmount
self.shine.ag:Stop()
self.shine:SetAlpha(0)
if active then
self.shine.ag:Play()
self.texture:SetDesaturated(false)
self.texture:SetAlpha(READY_ALPHA)
else
self.texture:SetDesaturated(true)
self.texture:SetAlpha(UNREADY_ALPHA)
end
end
end
end

function SoulShard_scripts:OnEnter()
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(_G.SOUL_SHARDS_POWER)
Expand All @@ -98,33 +72,6 @@ end

PitBull4.Controls.MakeNewControlType("SoulShard", "Frame", function(control)
-- onCreate
if not is_725 then
local texture = PitBull4.Controls.MakeTexture(control, "ARTWORK")
control.texture = texture
texture:SetAllPoints(control)
texture:SetTexture(ICON_TEXTURE)

local shine = PitBull4.Controls.MakeAnimatedTexture(control, "OVERLAY")
control.shine = shine
shine:SetAllPoints(control)
shine:SetTexture(SHINE_TEXTURE)
shine:SetBlendMode("ADD")
shine:SetVertexColor(unpack(PitBull4.PowerColors["SOUL_SHARDS"]))
shine:SetAlpha(0)

local fade_in = PitBull4.Controls.MakeAlpha(shine.ag)
fade_in:SetDuration(SHINE_HALF_TIME)
fade_in:SetFromAlpha(0)
fade_in:SetToAlpha(1)
fade_in:SetOrder(1)

local fade_out = PitBull4.Controls.MakeAlpha(shine.ag)
fade_out:SetDuration(SHINE_HALF_TIME)
fade_out:SetFromAlpha(1)
fade_out:SetToAlpha(0)
fade_out:SetOrder(2)
end

for k, v in pairs(SoulShard) do
control[k] = v
end
Expand All @@ -142,4 +89,4 @@ end, function(control)
control.shardIndex = nil
control.fillAmount = nil

end, is_725 and "ClassNameplateBarShardFrame")
end, "ClassNameplateBarShardFrame")
7 changes: 3 additions & 4 deletions Modules/SoulShards/SoulShards.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ end

local PitBull4 = _G.PitBull4
local L = PitBull4.L
local is_725 = _G.ClassNameplateBarWarlockShardMixin and true

-- CONSTANTS ----------------------------------------------------------------

local SPELL_POWER_SOUL_SHARDS = 7 -- Enum.PowerType.SoulShards

local MAX_SHARDS = 5

local STANDARD_WIDTH = is_725 and 17 or 15
local STANDARD_HEIGHT = is_725 and 22 or 15
local STANDARD_WIDTH = 17
local STANDARD_HEIGHT = 22
local BORDER_SIZE = 3
local SPACING = is_725 and 6 or 3
local SPACING = 6

local HALF_STANDARD_WIDTH = STANDARD_WIDTH / 2
local HALF_STANDARD_HEIGHT = STANDARD_HEIGHT / 2
Expand Down

0 comments on commit 78f1ff6

Please sign in to comment.