mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-18 18:40:49 +00:00
tracking: move menu refresh into separate function
This commit is contained in:
+24
-20
@@ -72,26 +72,7 @@ pfUI:RegisterModule("tracking", "vanilla", function ()
|
||||
end
|
||||
|
||||
this:RefreshSpells()
|
||||
local texture = GetTrackingTexture()
|
||||
if texture and texture ~= state.texture then
|
||||
state.texture = texture
|
||||
this.pulse = nil
|
||||
this.icon:SetTexture(texture)
|
||||
this.icon:SetVertexColor(1,1,1,1)
|
||||
this:Show()
|
||||
elseif not texture then
|
||||
state.texture = nil
|
||||
|
||||
if pulse and HasEntries(state.spells) then
|
||||
this.pulse = true
|
||||
this.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
|
||||
this.icon:SetVertexColor(1,1,1,1)
|
||||
this:Show()
|
||||
else
|
||||
this.pulse = nil
|
||||
this:Hide()
|
||||
end
|
||||
end
|
||||
this:RefreshMenu()
|
||||
end)
|
||||
|
||||
pfUI.tracking:SetScript("OnUpdate", function()
|
||||
@@ -174,6 +155,29 @@ pfUI:RegisterModule("tracking", "vanilla", function ()
|
||||
end
|
||||
end
|
||||
|
||||
function pfUI.tracking:RefreshMenu()
|
||||
local texture = GetTrackingTexture()
|
||||
if texture and texture ~= state.texture then
|
||||
state.texture = texture
|
||||
pfUI.tracking.pulse = nil
|
||||
pfUI.tracking.icon:SetTexture(texture)
|
||||
pfUI.tracking.icon:SetVertexColor(1,1,1,1)
|
||||
pfUI.tracking:Show()
|
||||
elseif not texture then
|
||||
state.texture = nil
|
||||
|
||||
if pulse and HasEntries(state.spells) then
|
||||
pfUI.tracking.pulse = true
|
||||
pfUI.tracking.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
|
||||
pfUI.tracking.icon:SetVertexColor(1,1,1,1)
|
||||
pfUI.tracking:Show()
|
||||
else
|
||||
pfUI.tracking.pulse = nil
|
||||
pfUI.tracking:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function pfUI.tracking:PlayerIsDruidInCatForm(playerClass)
|
||||
if playerClass == "DRUID" then
|
||||
for i = 0, 31 do
|
||||
|
||||
Reference in New Issue
Block a user