Only show placeholder icon when in config mode

If a CD bar was tracking a spell that was currently unknown to the player (such as the not-currently-active variations of Wildfire Bomb for Survival Hunters after first login/UI reload) then the placeholder frost icon would show up instead. The icon was only meant to be used to aid in configuration mode, so now the icon is set to the placeholder icon when config mode is enabled only. Technically we should clear the icon if it's set to the default whenever config mode is exited, but I figure config mode is pretty rare and should be okay for now.
This commit is contained in:
Parnic
2018-09-12 21:59:29 -05:00
parent 43aff89b5c
commit 6986131d73

View File

@ -132,8 +132,6 @@ function IceCustomCDBar.prototype:CreateBar()
if not self.barFrame.icon then if not self.barFrame.icon then
self.barFrame.icon = self.masterFrame:CreateTexture(nil, "LOW") self.barFrame.icon = self.masterFrame:CreateTexture(nil, "LOW")
-- default texture so that 'config mode' can work without activating the bar first
self.barFrame.icon:SetTexture("Interface\\Icons\\Spell_Frost_Frost")
-- this cuts off the border around the buff icon -- this cuts off the border around the buff icon
self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
self.barFrame.icon:SetDrawLayer("OVERLAY") self.barFrame.icon:SetDrawLayer("OVERLAY")
@ -675,6 +673,9 @@ function IceCustomCDBar.prototype:UpdateIcon()
end end
if IceHUD.IceCore:IsInConfigMode() or self.moduleSettings.displayAuraIcon then if IceHUD.IceCore:IsInConfigMode() or self.moduleSettings.displayAuraIcon then
if not self.barFrame.icon:GetTexture() and IceHUD.IceCore:IsInConfigMode() then
self.barFrame.icon:SetTexture("Interface\\Icons\\Spell_Frost_Frost")
end
self.barFrame.icon:Show() self.barFrame.icon:Show()
else else
self.barFrame.icon:Hide() self.barFrame.icon:Hide()
@ -694,7 +695,10 @@ function IceCustomCDBar.prototype:UpdateItemUnitInventoryChanged(event, unit)
end end
end end
function IceCustomCDBar.prototype:UpdateCustomBarEvent() function IceCustomCDBar.prototype:UpdateCustomBarEvent(event, unit)
if unit ~= self.unit then
return
end
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
self:UpdateCustomBar() self:UpdateCustomBar()
end end
@ -722,6 +726,8 @@ function IceCustomCDBar.prototype:UpdateCustomBar(fromUpdate)
else else
self.cooldownEndTime = remaining + now self.cooldownEndTime = remaining + now
end end
self:UpdateIcon()
end end
if self.cooldownEndTime and self.cooldownEndTime >= now then if self.cooldownEndTime and self.cooldownEndTime >= now then