mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added an option that allows a custom bar to track a substring or full name at the user's discretion. previously it was always a substring match. this was causing a custom bar for "trauma" to also trigger for "mind trauma", for example.
This commit is contained in:
@ -79,6 +79,7 @@ function IceCustomBar.prototype:GetDefaultSettings()
|
|||||||
settings["displayAuraIcon"] = false
|
settings["displayAuraIcon"] = false
|
||||||
settings["auraIconXOffset"] = 40
|
settings["auraIconXOffset"] = 40
|
||||||
settings["auraIconYOffset"] = 0
|
settings["auraIconYOffset"] = 0
|
||||||
|
settings["exactMatch"] = false
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -221,6 +222,24 @@ function IceCustomBar.prototype:GetOptions()
|
|||||||
order = 20.6,
|
order = 20.6,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["exactMatch"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = 'Exact match only',
|
||||||
|
desc = 'If this is checked, then the buff name must be entered exactly as the full buff name. Otherwise, you can use only a portion of the name such as "Sting" to track all stings.',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.exactMatch
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.exactMatch = v
|
||||||
|
self:Redraw()
|
||||||
|
self:UpdateCustomBar(self.unit)
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
||||||
|
end,
|
||||||
|
order = 20.65,
|
||||||
|
}
|
||||||
|
|
||||||
opts["trackOnlyMine"] = {
|
opts["trackOnlyMine"] = {
|
||||||
type = 'toggle',
|
type = 'toggle',
|
||||||
name = 'Only track auras by me',
|
name = 'Only track auras by me',
|
||||||
@ -423,7 +442,9 @@ function IceCustomBar.prototype:GetAuraDuration(unitName, buffName)
|
|||||||
duration = self.moduleSettings.maxDuration
|
duration = self.moduleSettings.maxDuration
|
||||||
end
|
end
|
||||||
|
|
||||||
if (string.match(buff:upper(), buffName:upper()) and (not self.moduleSettings.trackOnlyMine or isMine)) then
|
if (((self.moduleSettings.exactMatch and buff:upper() == buffName:upper())
|
||||||
|
or (not self.moduleSettings.exactMatch and string.match(buff:upper(), buffName:upper())))
|
||||||
|
and (not self.moduleSettings.trackOnlyMine or isMine)) then
|
||||||
if endTime and not remaining then
|
if endTime and not remaining then
|
||||||
remaining = endTime - GetTime()
|
remaining = endTime - GetTime()
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user