Skip to content

Commit

Permalink
Fixes #180 - Unable to dismiss totems/elementals
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Jul 5, 2019
1 parent 15ae49b commit b3c5a8f
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 106 deletions.
35 changes: 13 additions & 22 deletions Modules/PlayerFrames/scripts/FrameStyle_Classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -350,29 +350,20 @@ local CreatePlayerFrame = function(self, unit)
self.Power.colorPower = true
self.Power.frequentUpdates = true
end

--Totem Bar
local Totems = {}
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(20, 20)
Totem:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', index * Totem:GetWidth(), 0)

local Icon = Totem:CreateTexture(nil, 'OVERLAY')
Icon:SetAllPoints()

local Cooldown = CreateFrame('Cooldown', nil, Totem, 'CooldownFrameTemplate')
Cooldown:SetAllPoints()

Totem.Icon = Icon
Totem.Cooldown = Cooldown

Totems[index] = Totem
for index = 1, 4 do
_G['TotemFrameTotem' .. index]:SetFrameStrata('MEDIUM')
_G['TotemFrameTotem' .. index]:SetFrameLevel(4)
_G['TotemFrameTotem' .. index]:SetScale(.8)
end

-- Register with SUF
self.Totems = Totems
hooksecurefunc(
'TotemFrame_Update',
function()
TotemFrameTotem1:ClearAllPoints()
TotemFrameTotem1:SetParent(self)
TotemFrameTotem1:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', 20, 0)
end
)
end
do -- setup ring, icons, and text
local ring = CreateFrame('Frame', nil, self)
Expand Down Expand Up @@ -1998,7 +1989,7 @@ function PlayerFrames:SetupExtras()
SUI.DBMod.PlayerFrames.ClassBar.movement.yOffset = self:GetPoint(self:GetNumPoints())
end
)

-- Totem Frame (Pally Concentration, Shaman Totems, Monk Statues)
for i = 1, 4 do
local timer = _G['TotemFrameTotem' .. i .. 'Duration']
Expand Down
36 changes: 14 additions & 22 deletions Modules/Style_Fel/Module-UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ local CreateLargeFrame = function(self, unit)
self.ReadyCheckIndicator = self:CreateTexture(nil, 'OVERLAY')
self.ReadyCheckIndicator:SetSize(30, 30)
self.ReadyCheckIndicator:SetPoint('LEFT', self, 'LEFT', 0, 0)

--Combo Points & Special unit power itemsitems = CreateFrame("Frame",nil,self);
local items = CreateFrame('Frame', nil, self)
items:SetFrameStrata('BACKGROUND')
Expand Down Expand Up @@ -523,27 +523,19 @@ local CreateLargeFrame = function(self, unit)
self.AdditionalPower.bg = Background

--Totem Bar
local Totems = {}
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(20, 20)
Totem:SetPoint('TOPLEFT', self.Name, 'BOTTOMLEFT', index * Totem:GetWidth(), 0)

local Icon = Totem:CreateTexture(nil, 'OVERLAY')
Icon:SetAllPoints()

local Cooldown = CreateFrame('Cooldown', nil, Totem, 'CooldownFrameTemplate')
Cooldown:SetAllPoints()

Totem.Icon = Icon
Totem.Cooldown = Cooldown

Totems[index] = Totem
for index = 1, 4 do
_G['TotemFrameTotem' .. index]:SetFrameStrata('MEDIUM')
_G['TotemFrameTotem' .. index]:SetFrameLevel(4)
_G['TotemFrameTotem' .. index]:SetScale(.8)
end

-- Register with SUF
self.Totems = Totems
hooksecurefunc(
'TotemFrame_Update',
function()
TotemFrameTotem1:ClearAllPoints()
TotemFrameTotem1:SetParent(self)
TotemFrameTotem1:SetPoint('TOPLEFT', self.Name, 'BOTTOMLEFT', 20, 0)
end
)
end
end
do -- setup buffs and debuffs
Expand Down Expand Up @@ -716,7 +708,7 @@ local CreateMediumFrame = function(self, unit)
self.ReadyCheckIndicator = self:CreateTexture(nil, 'OVERLAY')
self.ReadyCheckIndicator:SetSize(30, 30)
self.ReadyCheckIndicator:SetPoint('LEFT', self, 'LEFT', 0, 0)

self.CombatIndicator = self:CreateTexture(nil, 'ARTWORK')
self.CombatIndicator:SetSize(20, 20)
self.CombatIndicator:SetPoint('CENTER', self.RestingIndicator, 'CENTER')
Expand Down
33 changes: 12 additions & 21 deletions Modules/Style_Minimal/UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -570,27 +570,19 @@ local MakeLargeFrame = function(self, unit, width)
do --Special Icons/Bars
if unit == 'player' then
--Totem Bar
local Totems = {}
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(20, 20)
Totem:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', index * Totem:GetWidth(), 0)

local Icon = Totem:CreateTexture(nil, 'OVERLAY')
Icon:SetAllPoints()

local Cooldown = CreateFrame('Cooldown', nil, Totem, 'CooldownFrameTemplate')
Cooldown:SetAllPoints()

Totem.Icon = Icon
Totem.Cooldown = Cooldown

Totems[index] = Totem
for index = 1, 4 do
_G['TotemFrameTotem' .. index]:SetFrameStrata('MEDIUM')
_G['TotemFrameTotem' .. index]:SetFrameLevel(4)
_G['TotemFrameTotem' .. index]:SetScale(.8)
end

-- Register with SUF
self.Totems = Totems
hooksecurefunc(
'TotemFrame_Update',
function()
TotemFrameTotem1:ClearAllPoints()
TotemFrameTotem1:SetParent(self)
TotemFrameTotem1:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', 20, 0)
end
)

local DruidMana = CreateFrame('StatusBar', nil, self)
DruidMana:SetSize(self:GetWidth(), 4)
Expand Down Expand Up @@ -686,7 +678,6 @@ local MakeLargeFrame = function(self, unit, width)
self.StatusText:SetJustifyH('CENTER')
self:Tag(self.StatusText, '[afkdnd]')


--Runes
local playerClass = select(2, UnitClass('player'))
if unit == 'player' and playerClass == 'DEATHKNIGHT' then
Expand Down
32 changes: 12 additions & 20 deletions Modules/Style_Transparent/Module-UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,27 +454,19 @@ local CreatePlayerFrame = function(self, unit)
self.AdditionalPower.bg = Background

--Totem Bar
local Totems = {}
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(20, 20)
Totem:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', index * Totem:GetWidth(), 0)

local Icon = Totem:CreateTexture(nil, 'OVERLAY')
Icon:SetAllPoints()

local Cooldown = CreateFrame('Cooldown', nil, Totem, 'CooldownFrameTemplate')
Cooldown:SetAllPoints()

Totem.Icon = Icon
Totem.Cooldown = Cooldown

Totems[index] = Totem
for index = 1, 4 do
_G['TotemFrameTotem' .. index]:SetFrameStrata('MEDIUM')
_G['TotemFrameTotem' .. index]:SetFrameLevel(4)
_G['TotemFrameTotem' .. index]:SetScale(.8)
end

-- Register with SUF
self.Totems = Totems
hooksecurefunc(
'TotemFrame_Update',
function()
TotemFrameTotem1:ClearAllPoints()
TotemFrameTotem1:SetParent(self)
TotemFrameTotem1:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', 20, 0)
end
)
end
end
do -- setup ring, icons, and text
Expand Down
34 changes: 13 additions & 21 deletions Modules/Style_War/Module-UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -535,29 +535,21 @@ local CreateLargeFrame = function(self, unit)
Background:SetTexture(1, 1, 1, .2)
self.AdditionalPower = DruidMana
self.AdditionalPower.bg = Background

--Totem Bar
local Totems = {}
for index = 1, 5 do
-- Position and size of the totem indicator
local Totem = CreateFrame('Button', nil, self)
Totem:SetSize(20, 20)
Totem:SetPoint('TOPLEFT', self.Name, 'BOTTOMLEFT', index * Totem:GetWidth(), 0)

local Icon = Totem:CreateTexture(nil, 'OVERLAY')
Icon:SetAllPoints()

local Cooldown = CreateFrame('Cooldown', nil, Totem, 'CooldownFrameTemplate')
Cooldown:SetAllPoints()

Totem.Icon = Icon
Totem.Cooldown = Cooldown

Totems[index] = Totem
for index = 1, 4 do
_G['TotemFrameTotem' .. index]:SetFrameStrata('MEDIUM')
_G['TotemFrameTotem' .. index]:SetFrameLevel(4)
_G['TotemFrameTotem' .. index]:SetScale(.8)
end

-- Register with SUF
self.Totems = Totems
hooksecurefunc(
'TotemFrame_Update',
function()
TotemFrameTotem1:ClearAllPoints()
TotemFrameTotem1:SetParent(self)
TotemFrameTotem1:SetPoint('TOPLEFT', self.Name, 'BOTTOMLEFT', 20, 0)
end
)
end
end
do -- setup buffs and debuffs
Expand Down

0 comments on commit b3c5a8f

Please sign in to comment.