Framework update

This commit is contained in:
Tercio Jose
2022-08-29 18:33:41 -03:00
parent ab2d87b27e
commit e092c4d0aa
6 changed files with 49 additions and 15 deletions
+15 -1
View File
@@ -1,6 +1,6 @@
local dversion = 331
local dversion = 332
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -722,6 +722,20 @@ function DF:SetFontShadow (fontString, r, g, b, a, x, y)
fontString:SetShadowOffset (x, y)
end
function DF:SetFontRotation(fontString, degrees)
if (type(degrees) == "number") then
if (not fontString.__rotationAnimation) then
fontString.__rotationAnimation = DF:CreateAnimationHub(fontString)
fontString.__rotationAnimation.rotator = DF:CreateAnimation(fontString.__rotationAnimation, "rotation", 1, 0, 0)
fontString.__rotationAnimation.rotator:SetEndDelay(math.huge)
fontString.__rotationAnimation.rotator:SetSmoothProgress(1)
end
fontString.__rotationAnimation.rotator:SetDegrees(degrees)
fontString.__rotationAnimation:Play()
fontString.__rotationAnimation:Pause()
end
end
function DF:AddClassColorToText (text, class)
if (type (class) ~= "string") then
return DF:RemoveRealName (text)
+16 -1
View File
@@ -182,7 +182,21 @@ local LabelMetaFunctions = _G[DF.GlobalWidgetControlNames ["label"]]
local smember_outline = function (_object, _value)
DF:SetFontOutline (_object.label, _value)
end
local smember_rotation = function(object, rotation)
if (type(rotation) == "number") then
if (not object.__rotationAnimation) then
object.__rotationAnimation = DF:CreateAnimationHub(object.label)
object.__rotationAnimation.rotator = DF:CreateAnimation(object.__rotationAnimation, "rotation", 1, 0, 0)
object.__rotationAnimation.rotator:SetEndDelay(math.huge)
object.__rotationAnimation.rotator:SetSmoothProgress(1)
end
object.__rotationAnimation.rotator:SetDegrees(rotation)
object.__rotationAnimation:Play()
object.__rotationAnimation:Pause()
end
end
LabelMetaFunctions.SetMembers = LabelMetaFunctions.SetMembers or {}
LabelMetaFunctions.SetMembers["show"] = smember_show
LabelMetaFunctions.SetMembers["hide"] = smember_hide
@@ -200,6 +214,7 @@ local LabelMetaFunctions = _G[DF.GlobalWidgetControlNames ["label"]]
LabelMetaFunctions.SetMembers["textsize"] = smember_textsize--alias
LabelMetaFunctions.SetMembers["shadow"] = smember_outline
LabelMetaFunctions.SetMembers["outline"] = smember_outline--alias
LabelMetaFunctions.SetMembers["rotation"] = smember_rotation--alias
LabelMetaFunctions.__newindex = function (_table, _key, _value)
local func = LabelMetaFunctions.SetMembers [_key]
+6 -3
View File
@@ -5275,7 +5275,7 @@ DF.IconRowFunctions = {
end
end,
SetIcon = function (self, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff)
SetIcon = function (self, spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff, modRate)
local actualSpellName, _, spellIcon = GetSpellInfo (spellId)
@@ -5284,6 +5284,7 @@ DF.IconRowFunctions = {
end
spellName = spellName or actualSpellName or "unknown_aura"
modRate = modRate or 1
if (spellIcon) then
local iconFrame = self:GetIcon()
@@ -5297,14 +5298,14 @@ DF.IconRowFunctions = {
end
if (startTime) then
CooldownFrame_Set (iconFrame.Cooldown, startTime, duration, true, true)
CooldownFrame_Set (iconFrame.Cooldown, startTime, duration, true, true, modRate)
if (self.options.show_text) then
iconFrame.CountdownText:Show()
local now = GetTime()
iconFrame.timeRemaining = startTime + duration - now
iconFrame.timeRemaining = (startTime + duration - now) / modRate
iconFrame.expirationTime = startTime + duration
local formattedTime = (iconFrame.timeRemaining > 0) and self.options.decimal_timer and iconFrame.parentIconRow.FormatCooldownTimeDecimal(iconFrame.timeRemaining) or iconFrame.parentIconRow.FormatCooldownTime(iconFrame.timeRemaining) or ""
@@ -5328,6 +5329,7 @@ DF.IconRowFunctions = {
end
iconFrame.Cooldown:SetReverse (self.options.cooldown_reverse)
iconFrame.Cooldown:SetDrawSwipe (self.options.cooldown_swipe_enabled)
iconFrame.Cooldown:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
else
iconFrame.timeRemaining = nil
@@ -5620,6 +5622,7 @@ local default_icon_row_options = {
on_tick_cooldown_update = true,
decimal_timer = false,
cooldown_reverse = false,
cooldown_swipe = true,
}
function DF:CreateIconRow (parent, name, options)