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
+3 -1
View File
@@ -1,4 +1,6 @@
## Interface: 90207 ## Interface-Mainline: 90207
## Interface-BCC: 20504
## Interface-Wrath: 30400
## Title: Details! Damage Meter ## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid. ## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global ## SavedVariables: _detalhes_global
+15 -1
View File
@@ -1,6 +1,6 @@
local dversion = 331 local dversion = 332
local major, minor = "DetailsFramework-1.0", dversion local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor) 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) fontString:SetShadowOffset (x, y)
end 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) function DF:AddClassColorToText (text, class)
if (type (class) ~= "string") then if (type (class) ~= "string") then
return DF:RemoveRealName (text) return DF:RemoveRealName (text)
+16 -1
View File
@@ -182,7 +182,21 @@ local LabelMetaFunctions = _G[DF.GlobalWidgetControlNames ["label"]]
local smember_outline = function (_object, _value) local smember_outline = function (_object, _value)
DF:SetFontOutline (_object.label, _value) DF:SetFontOutline (_object.label, _value)
end 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 = LabelMetaFunctions.SetMembers or {}
LabelMetaFunctions.SetMembers["show"] = smember_show LabelMetaFunctions.SetMembers["show"] = smember_show
LabelMetaFunctions.SetMembers["hide"] = smember_hide LabelMetaFunctions.SetMembers["hide"] = smember_hide
@@ -200,6 +214,7 @@ local LabelMetaFunctions = _G[DF.GlobalWidgetControlNames ["label"]]
LabelMetaFunctions.SetMembers["textsize"] = smember_textsize--alias LabelMetaFunctions.SetMembers["textsize"] = smember_textsize--alias
LabelMetaFunctions.SetMembers["shadow"] = smember_outline LabelMetaFunctions.SetMembers["shadow"] = smember_outline
LabelMetaFunctions.SetMembers["outline"] = smember_outline--alias LabelMetaFunctions.SetMembers["outline"] = smember_outline--alias
LabelMetaFunctions.SetMembers["rotation"] = smember_rotation--alias
LabelMetaFunctions.__newindex = function (_table, _key, _value) LabelMetaFunctions.__newindex = function (_table, _key, _value)
local func = LabelMetaFunctions.SetMembers [_key] local func = LabelMetaFunctions.SetMembers [_key]
+6 -3
View File
@@ -5275,7 +5275,7 @@ DF.IconRowFunctions = {
end end
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) local actualSpellName, _, spellIcon = GetSpellInfo (spellId)
@@ -5284,6 +5284,7 @@ DF.IconRowFunctions = {
end end
spellName = spellName or actualSpellName or "unknown_aura" spellName = spellName or actualSpellName or "unknown_aura"
modRate = modRate or 1
if (spellIcon) then if (spellIcon) then
local iconFrame = self:GetIcon() local iconFrame = self:GetIcon()
@@ -5297,14 +5298,14 @@ DF.IconRowFunctions = {
end end
if (startTime) then 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 if (self.options.show_text) then
iconFrame.CountdownText:Show() iconFrame.CountdownText:Show()
local now = GetTime() local now = GetTime()
iconFrame.timeRemaining = startTime + duration - now iconFrame.timeRemaining = (startTime + duration - now) / modRate
iconFrame.expirationTime = startTime + duration 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 "" 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 end
iconFrame.Cooldown:SetReverse (self.options.cooldown_reverse) iconFrame.Cooldown:SetReverse (self.options.cooldown_reverse)
iconFrame.Cooldown:SetDrawSwipe (self.options.cooldown_swipe_enabled)
iconFrame.Cooldown:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer) iconFrame.Cooldown:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
else else
iconFrame.timeRemaining = nil iconFrame.timeRemaining = nil
@@ -5620,6 +5622,7 @@ local default_icon_row_options = {
on_tick_cooldown_update = true, on_tick_cooldown_update = true,
decimal_timer = false, decimal_timer = false,
cooldown_reverse = false, cooldown_reverse = false,
cooldown_swipe = true,
} }
function DF:CreateIconRow (parent, name, options) function DF:CreateIconRow (parent, name, options)
+2 -2
View File
@@ -6,8 +6,8 @@
local version, build, date, tocversion = GetBuildInfo() local version, build, date, tocversion = GetBuildInfo()
_detalhes.build_counter = 10001 _detalhes.build_counter = 10008
_detalhes.alpha_build_counter = 10001 --if this is higher than the regular counter, use it instead _detalhes.alpha_build_counter = 10008 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 41 _detalhes.bcc_counter = 41
_detalhes.wotlk_counter = 4 _detalhes.wotlk_counter = 4
_detalhes.dont_open_news = true _detalhes.dont_open_news = true
+7 -7
View File
@@ -4143,13 +4143,13 @@ function gump:CreateNewLine (instancia, index)
icone_classe:SetTexCoord (.75, 1, .75, 1) icone_classe:SetTexCoord (.75, 1, .75, 1)
newLine.icone_classe = icone_classe newLine.icone_classe = icone_classe
local icon_frame = CreateFrame ("frame", "DetailsBarra_IconFrame_" .. instancia.meu_id .. "_" .. index, newLine.statusbar) local iconFrame = CreateFrame ("frame", "DetailsBarra_IconFrame_" .. instancia.meu_id .. "_" .. index, newLine.statusbar)
icon_frame:SetPoint ("topleft", icone_classe, "topleft") iconFrame:SetPoint ("topleft", icone_classe, "topleft")
icon_frame:SetPoint ("bottomright", icone_classe, "bottomright") iconFrame:SetPoint ("bottomright", icone_classe, "bottomright")
icon_frame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1) iconFrame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1)
icon_frame.instance_id = instancia.meu_id iconFrame.instance_id = instancia.meu_id
icon_frame.row = newLine iconFrame.row = newLine
newLine.icon_frame = icon_frame newLine.icon_frame = iconFrame
icone_classe:SetPoint ("left", newLine, "left") icone_classe:SetPoint ("left", newLine, "left")
newLine.statusbar:SetPoint ("topleft", icone_classe, "topright") newLine.statusbar:SetPoint ("topleft", icone_classe, "topright")