From e95e399176d6ee7b729e0cff45ee3781b8253003 Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 17 May 2010 15:07:16 +0000 Subject: [PATCH] - 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. --- modules/CustomBar.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index 659292a..b84b995 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -79,6 +79,7 @@ function IceCustomBar.prototype:GetDefaultSettings() settings["displayAuraIcon"] = false settings["auraIconXOffset"] = 40 settings["auraIconYOffset"] = 0 + settings["exactMatch"] = false return settings end @@ -220,6 +221,24 @@ function IceCustomBar.prototype:GetOptions() usage = "", 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"] = { type = 'toggle', @@ -423,7 +442,9 @@ function IceCustomBar.prototype:GetAuraDuration(unitName, buffName) duration = self.moduleSettings.maxDuration 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 remaining = endTime - GetTime() end