|
|
@ -67,70 +67,70 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
-- OVERRIDE
|
|
|
|
-- OVERRIDE
|
|
|
|
function SliceAndDice.prototype:GetDefaultSettings()
|
|
|
|
function SliceAndDice.prototype:GetDefaultSettings()
|
|
|
|
local settings = SliceAndDice.super.prototype.GetDefaultSettings(self)
|
|
|
|
local settings = SliceAndDice.super.prototype.GetDefaultSettings(self)
|
|
|
|
|
|
|
|
|
|
|
|
settings["enabled"] = false
|
|
|
|
settings["enabled"] = false
|
|
|
|
settings["shouldAnimate"] = false
|
|
|
|
settings["shouldAnimate"] = false
|
|
|
|
settings["desiredLerpTime"] = nil
|
|
|
|
settings["desiredLerpTime"] = nil
|
|
|
|
settings["lowThreshold"] = 0
|
|
|
|
settings["lowThreshold"] = 0
|
|
|
|
settings["side"] = IceCore.Side.Right
|
|
|
|
settings["side"] = IceCore.Side.Right
|
|
|
|
settings["offset"] = 6
|
|
|
|
settings["offset"] = 6
|
|
|
|
settings["upperText"]="SnD:"
|
|
|
|
settings["upperText"]="SnD:"
|
|
|
|
settings["showAsPercentOfMax"] = true
|
|
|
|
settings["showAsPercentOfMax"] = true
|
|
|
|
settings["durationAlpha"] = 0.6
|
|
|
|
settings["durationAlpha"] = 0.6
|
|
|
|
settings["usesDogTagStrings"] = false
|
|
|
|
settings["usesDogTagStrings"] = false
|
|
|
|
settings["lockLowerFontAlpha"] = false
|
|
|
|
settings["lockLowerFontAlpha"] = false
|
|
|
|
settings["lowerTextString"] = ""
|
|
|
|
settings["lowerTextString"] = ""
|
|
|
|
settings["lowerTextVisible"] = false
|
|
|
|
settings["lowerTextVisible"] = false
|
|
|
|
settings["hideAnimationSettings"] = true
|
|
|
|
settings["hideAnimationSettings"] = true
|
|
|
|
settings["bAllowExpand"] = true
|
|
|
|
settings["bAllowExpand"] = true
|
|
|
|
|
|
|
|
|
|
|
|
return settings
|
|
|
|
return settings
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- OVERRIDE
|
|
|
|
-- OVERRIDE
|
|
|
|
function SliceAndDice.prototype:GetOptions()
|
|
|
|
function SliceAndDice.prototype:GetOptions()
|
|
|
|
local opts = SliceAndDice.super.prototype.GetOptions(self)
|
|
|
|
local opts = SliceAndDice.super.prototype.GetOptions(self)
|
|
|
|
|
|
|
|
|
|
|
|
opts["textSettings"].args["upperTextString"]["desc"] = "The text to display under this bar. # will be replaced with the number of Slice and Dice seconds remaining."
|
|
|
|
opts["textSettings"].args["upperTextString"]["desc"] = "The text to display under this bar. # will be replaced with the number of Slice and Dice seconds remaining."
|
|
|
|
|
|
|
|
|
|
|
|
opts["showAsPercentOfMax"] =
|
|
|
|
opts["showAsPercentOfMax"] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type = 'toggle',
|
|
|
|
type = 'toggle',
|
|
|
|
name = L["Show bar as % of maximum"],
|
|
|
|
name = L["Show bar as % of maximum"],
|
|
|
|
desc = L["If this is checked, then the SnD buff time shows as a percent of the maximum attainable (taking set bonuses and talents into account). Otherwise, the bar always goes from full to empty when applying SnD no matter the duration."],
|
|
|
|
desc = L["If this is checked, then the SnD buff time shows as a percent of the maximum attainable (taking set bonuses and talents into account). Otherwise, the bar always goes from full to empty when applying SnD no matter the duration."],
|
|
|
|
get = function()
|
|
|
|
get = function()
|
|
|
|
return self.moduleSettings.showAsPercentOfMax
|
|
|
|
return self.moduleSettings.showAsPercentOfMax
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
set = function(info, v)
|
|
|
|
set = function(info, v)
|
|
|
|
self.moduleSettings.showAsPercentOfMax = v
|
|
|
|
self.moduleSettings.showAsPercentOfMax = v
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
disabled = function()
|
|
|
|
disabled = function()
|
|
|
|
return not self.moduleSettings.enabled
|
|
|
|
return not self.moduleSettings.enabled
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
opts["durationAlpha"] =
|
|
|
|
opts["durationAlpha"] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type = "range",
|
|
|
|
type = "range",
|
|
|
|
name = L["Potential SnD time bar alpha"],
|
|
|
|
name = L["Potential SnD time bar alpha"],
|
|
|
|
desc = L["What alpha value to use for the bar that displays how long your SnD will last if you activate it. (This gets multiplied by the bar's current alpha to stay in line with the bar on top of it)"],
|
|
|
|
desc = L["What alpha value to use for the bar that displays how long your SnD will last if you activate it. (This gets multiplied by the bar's current alpha to stay in line with the bar on top of it)"],
|
|
|
|
min = 0,
|
|
|
|
min = 0,
|
|
|
|
max = 100,
|
|
|
|
max = 100,
|
|
|
|
step = 5,
|
|
|
|
step = 5,
|
|
|
|
get = function()
|
|
|
|
get = function()
|
|
|
|
return self.moduleSettings.durationAlpha * 100
|
|
|
|
return self.moduleSettings.durationAlpha * 100
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
set = function(info, v)
|
|
|
|
set = function(info, v)
|
|
|
|
self.moduleSettings.durationAlpha = v / 100.0
|
|
|
|
self.moduleSettings.durationAlpha = v / 100.0
|
|
|
|
self:Redraw()
|
|
|
|
self:Redraw()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
disabled = function()
|
|
|
|
disabled = function()
|
|
|
|
return not self.moduleSettings.enabled
|
|
|
|
return not self.moduleSettings.enabled
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return opts
|
|
|
|
return opts
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:CreateFrame()
|
|
|
|
function SliceAndDice.prototype:CreateFrame()
|
|
|
@ -172,32 +172,32 @@ end
|
|
|
|
-- 'Protected' methods --------------------------------------------------------
|
|
|
|
-- 'Protected' methods --------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:GetBuffDuration(unitName, buffName)
|
|
|
|
function SliceAndDice.prototype:GetBuffDuration(unitName, buffName)
|
|
|
|
local i = 1
|
|
|
|
local i = 1
|
|
|
|
local buff, rank, texture, count, type, duration, endTime, remaining
|
|
|
|
local buff, rank, texture, count, type, duration, endTime, remaining
|
|
|
|
if IceHUD.WowVer >= 30000 then
|
|
|
|
if IceHUD.WowVer >= 30000 then
|
|
|
|
buff, rank, texture, count, type, duration, endTime = UnitBuff(unitName, i)
|
|
|
|
buff, rank, texture, count, type, duration, endTime = UnitBuff(unitName, i)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
buff, rank, texture, count, duration, remaining = UnitBuff(unitName, i)
|
|
|
|
buff, rank, texture, count, duration, remaining = UnitBuff(unitName, i)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
while buff do
|
|
|
|
while buff do
|
|
|
|
if (texture and string.match(texture, buffName)) then
|
|
|
|
if (texture and string.match(texture, buffName)) then
|
|
|
|
if endTime and not remaining then
|
|
|
|
if endTime and not remaining then
|
|
|
|
remaining = endTime - GetTime()
|
|
|
|
remaining = endTime - GetTime()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return duration, remaining
|
|
|
|
return duration, remaining
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
i = i + 1;
|
|
|
|
i = i + 1;
|
|
|
|
|
|
|
|
|
|
|
|
if IceHUD.WowVer >= 30000 then
|
|
|
|
if IceHUD.WowVer >= 30000 then
|
|
|
|
buff, rank, texture, count, type, duration, endTime = UnitBuff(unitName, i)
|
|
|
|
buff, rank, texture, count, type, duration, endTime = UnitBuff(unitName, i)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
buff, rank, texture, count, duration, remaining = UnitBuff(unitName, i)
|
|
|
|
buff, rank, texture, count, duration, remaining = UnitBuff(unitName, i)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return nil, nil
|
|
|
|
return nil, nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:MyOnUpdate()
|
|
|
|
function SliceAndDice.prototype:MyOnUpdate()
|
|
|
@ -208,54 +208,54 @@ function SliceAndDice.prototype:MyOnUpdate()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
|
|
|
function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
|
|
|
if unit and unit ~= self.unit then
|
|
|
|
if unit and unit ~= self.unit then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local now = GetTime()
|
|
|
|
local now = GetTime()
|
|
|
|
local remaining = nil
|
|
|
|
local remaining = nil
|
|
|
|
|
|
|
|
|
|
|
|
if not fromUpdate or IceHUD.WowVer < 30000 then
|
|
|
|
if not fromUpdate or IceHUD.WowVer < 30000 then
|
|
|
|
sndDuration, remaining = self:GetBuffDuration(self.unit, "Ability_Rogue_SliceDice")
|
|
|
|
sndDuration, remaining = self:GetBuffDuration(self.unit, "Ability_Rogue_SliceDice")
|
|
|
|
|
|
|
|
|
|
|
|
if not remaining then
|
|
|
|
if not remaining then
|
|
|
|
sndEndTime = 0
|
|
|
|
sndEndTime = 0
|
|
|
|
else
|
|
|
|
else
|
|
|
|
sndEndTime = remaining + now
|
|
|
|
sndEndTime = remaining + now
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if sndEndTime and sndEndTime >= now then
|
|
|
|
if sndEndTime and sndEndTime >= now then
|
|
|
|
if not fromUpdate then
|
|
|
|
if not fromUpdate then
|
|
|
|
self.bUpdateSnd = true
|
|
|
|
self.bUpdateSnd = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
self:Show(true)
|
|
|
|
self:Show(true)
|
|
|
|
if not remaining then
|
|
|
|
if not remaining then
|
|
|
|
remaining = sndEndTime - now
|
|
|
|
remaining = sndEndTime - now
|
|
|
|
end
|
|
|
|
end
|
|
|
|
local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration)
|
|
|
|
local denominator = (self.moduleSettings.showAsPercentOfMax and CurrMaxSnDDuration or sndDuration)
|
|
|
|
self:UpdateBar(denominator ~= 0 and remaining / denominator or 0, "SliceAndDice")
|
|
|
|
self:UpdateBar(denominator ~= 0 and remaining / denominator or 0, "SliceAndDice")
|
|
|
|
|
|
|
|
|
|
|
|
formatString = self.moduleSettings.upperText or ''
|
|
|
|
formatString = self.moduleSettings.upperText or ''
|
|
|
|
else
|
|
|
|
else
|
|
|
|
self:UpdateBar(0, "SliceAndDice")
|
|
|
|
self:UpdateBar(0, "SliceAndDice")
|
|
|
|
|
|
|
|
|
|
|
|
if ((IceHUD.WowVer >= 30000 and GetComboPoints(self.unit, "target") == 0) or (IceHUD.WowVer < 30000 and GetComboPoints() == 0)) or not UnitExists("target") then
|
|
|
|
if ((IceHUD.WowVer >= 30000 and GetComboPoints(self.unit, "target") == 0) or (IceHUD.WowVer < 30000 and GetComboPoints() == 0)) or not UnitExists("target") then
|
|
|
|
if self.bIsVisible then
|
|
|
|
if self.bIsVisible then
|
|
|
|
self.bUpdateSnd = nil
|
|
|
|
self.bUpdateSnd = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if not self.moduleSettings.alwaysFullAlpha then
|
|
|
|
if not self.moduleSettings.alwaysFullAlpha then
|
|
|
|
self:Show(false)
|
|
|
|
self:Show(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- somewhat redundant, but we also need to check potential remaining time
|
|
|
|
-- somewhat redundant, but we also need to check potential remaining time
|
|
|
|
if (remaining ~= nil) or PotentialSnDDuration > 0 then
|
|
|
|
if (remaining ~= nil) or PotentialSnDDuration > 0 then
|
|
|
|
self:SetBottomText1(self.moduleSettings.upperText .. tostring(floor(remaining or 0)) .. " (" .. PotentialSnDDuration .. ")")
|
|
|
|
self:SetBottomText1(self.moduleSettings.upperText .. tostring(floor(remaining or 0)) .. " (" .. PotentialSnDDuration .. ")")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|
|
|
function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|
|
@ -293,7 +293,7 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|
|
|
|
|
|
|
|
|
|
|
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
|
|
|
|
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
|
|
|
|
if (self.moduleSettings.reverse) then
|
|
|
|
if (self.moduleSettings.reverse) then
|
|
|
|
scale = 1 - scale
|
|
|
|
scale = 1 - scale
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha))
|
|
|
|
self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.alpha * self.moduleSettings.durationAlpha))
|
|
|
@ -305,27 +305,27 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:GetMaxBuffTime(numComboPoints)
|
|
|
|
function SliceAndDice.prototype:GetMaxBuffTime(numComboPoints)
|
|
|
|
local maxduration
|
|
|
|
local maxduration
|
|
|
|
|
|
|
|
|
|
|
|
if numComboPoints == 0 then
|
|
|
|
if numComboPoints == 0 then
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
maxduration = baseTime + ((numComboPoints - 1) * gapPerComboPoint)
|
|
|
|
maxduration = baseTime + ((numComboPoints - 1) * gapPerComboPoint)
|
|
|
|
|
|
|
|
|
|
|
|
if self:HasNetherbladeBonus() then
|
|
|
|
if self:HasNetherbladeBonus() then
|
|
|
|
maxduration = maxduration + netherbladeBonus
|
|
|
|
maxduration = maxduration + netherbladeBonus
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if self:HasGlyphBonus() then
|
|
|
|
if self:HasGlyphBonus() then
|
|
|
|
maxduration = maxduration + glyphBonusSec
|
|
|
|
maxduration = maxduration + glyphBonusSec
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
_, _, _, _, rank = GetTalentInfo(impSndTalentPage, impSndTalentIdx)
|
|
|
|
_, _, _, _, rank = GetTalentInfo(impSndTalentPage, impSndTalentIdx)
|
|
|
|
|
|
|
|
|
|
|
|
maxduration = maxduration * (1 + (rank * impSndBonusPerRank))
|
|
|
|
maxduration = maxduration * (1 + (rank * impSndBonusPerRank))
|
|
|
|
|
|
|
|
|
|
|
|
return maxduration
|
|
|
|
return maxduration
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function SliceAndDice.prototype:HasNetherbladeBonus()
|
|
|
|
function SliceAndDice.prototype:HasNetherbladeBonus()
|
|
|
@ -395,5 +395,5 @@ end
|
|
|
|
local _, unitClass = UnitClass("player")
|
|
|
|
local _, unitClass = UnitClass("player")
|
|
|
|
-- Load us up
|
|
|
|
-- Load us up
|
|
|
|
if unitClass == "ROGUE" then
|
|
|
|
if unitClass == "ROGUE" then
|
|
|
|
IceHUD.SliceAndDice = SliceAndDice:new()
|
|
|
|
IceHUD.SliceAndDice = SliceAndDice:new()
|
|
|
|
end
|
|
|
|
end
|
|
|
|