- user-submitted patch for an 'invert' option in addition to the 'reverse' option for all bars. now 'reverse' controls bar movement direction while 'invert' controls bar fill behavior http://www.wowace.com/addons/ice-hud/tickets/73-reversing-cast-bars-and-channels

This commit is contained in:
Parnic
2010-07-20 01:34:21 +00:00
parent 44ee8e66a6
commit 41806602df
2 changed files with 48 additions and 6 deletions

View File

@ -65,6 +65,7 @@ function IceCastBar.prototype:GetDefaultSettings()
settings["displayAuraIcon"] = false
settings["auraIconXOffset"] = 40
settings["auraIconYOffset"] = 0
settings["reverseChannel"] = true
return settings
end
@ -178,6 +179,23 @@ function IceCastBar.prototype:GetOptions()
order = 53,
}
opts["reverseChannel"] = {
type = 'toggle',
name = "Reverse channel direction",
desc = "Whether or not to reverse the direction of a channel's castbar",
get = function()
return self.moduleSettings.reverseChannel
end,
set = function(v)
self.moduleSettings.reverseChannel = v
end,
disabled = function()
return not self.moduleSettings.enabled
end,
usage = "<whether or not to reverse the direction of a channel's castbar>",
order = 32.5,
}
return opts
end
@ -233,7 +251,7 @@ function IceCastBar.prototype:OnUpdate()
local remainingTime = self.actionStartTime + self.actionDuration - time
local scale = 1 - (self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0)
if (self.action == IceCastBar.Actions.Channel) then
if (self.moduleSettings.reverseChannel and self.action == IceCastBar.Actions.Channel) then
scale = self.actionDuration ~= 0 and remainingTime / self.actionDuration or 0
end