mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added support for mh/oh weapon enchants to the custom counter module
This commit is contained in:
13
IceHUD.lua
13
IceHUD.lua
@ -777,6 +777,19 @@ function IceHUD:GetDebuffCount(unit, ability, onlyMine, matchByName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine, matchByName)
|
function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine, matchByName)
|
||||||
|
if unit == "main hand weapon" or unit == "off hand weapon" then
|
||||||
|
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges
|
||||||
|
= GetWeaponEnchantInfo()
|
||||||
|
|
||||||
|
if unit == "main hand weapon" and hasMainHandEnchant then
|
||||||
|
return mainHandCharges
|
||||||
|
elseif unit == "off hand weapon" and hasOffHandEnchant then
|
||||||
|
return offHandCharges
|
||||||
|
end
|
||||||
|
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
for i = 1, 40 do
|
for i = 1, 40 do
|
||||||
local name, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
|
local name, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ local waterfall = AceLibrary("Waterfall-1.0")
|
|||||||
|
|
||||||
IceCustomCount.prototype.countSize = 20
|
IceCustomCount.prototype.countSize = 20
|
||||||
|
|
||||||
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget"}
|
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
|
||||||
local buffOrDebuff = {"buff", "debuff"}
|
local buffOrDebuff = {"buff", "debuff"}
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
@ -67,6 +67,7 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
self.moduleSettings.auraTarget = v
|
self.moduleSettings.auraTarget = v
|
||||||
self.unit = v
|
self.unit = v
|
||||||
self:Redraw()
|
self:Redraw()
|
||||||
|
AceLibrary("Waterfall-1.0"):Refresh("IceHUD")
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled
|
||||||
@ -87,7 +88,7 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
||||||
end,
|
end,
|
||||||
order = 20.5,
|
order = 20.5,
|
||||||
}
|
}
|
||||||
@ -104,7 +105,7 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
||||||
end,
|
end,
|
||||||
order = 20.6,
|
order = 20.6,
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
||||||
end,
|
end,
|
||||||
order = 20.7,
|
order = 20.7,
|
||||||
}
|
}
|
||||||
@ -524,7 +525,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function IceCustomCount.prototype:UpdateCustomCount(unit)
|
function IceCustomCount.prototype:UpdateCustomCount(unit)
|
||||||
if unit and unit ~= self.unit then
|
if unit and unit ~= self.unit and self.unit ~= "main hand weapon" and self.unit ~= "off hand weapon" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user