From e092c4d0aa4ad7cb2a5cbc331797f04b04d030d4 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 29 Aug 2022 18:33:41 -0300 Subject: [PATCH] Framework update --- Details.toc | 4 +++- Libs/DF/fw.lua | 16 +++++++++++++++- Libs/DF/label.lua | 17 ++++++++++++++++- Libs/DF/panel.lua | 9 ++++++--- boot.lua | 4 ++-- frames/window_main.lua | 14 +++++++------- 6 files changed, 49 insertions(+), 15 deletions(-) diff --git a/Details.toc b/Details.toc index 3f846e423..8f4614fa6 100644 --- a/Details.toc +++ b/Details.toc @@ -1,4 +1,6 @@ -## Interface: 90207 +## Interface-Mainline: 90207 +## Interface-BCC: 20504 +## Interface-Wrath: 30400 ## Title: Details! Damage Meter ## Notes: Essential tool to impress that chick in your raid. ## SavedVariables: _detalhes_global diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index c138c87bd..61fc48b2f 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -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) diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index 83830b5e4..4bd855c07 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -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] diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 08becb5b1..034ccb04b 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -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) diff --git a/boot.lua b/boot.lua index c13a76092..45c7f2f7b 100644 --- a/boot.lua +++ b/boot.lua @@ -6,8 +6,8 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 10001 - _detalhes.alpha_build_counter = 10001 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 10008 + _detalhes.alpha_build_counter = 10008 --if this is higher than the regular counter, use it instead _detalhes.bcc_counter = 41 _detalhes.wotlk_counter = 4 _detalhes.dont_open_news = true diff --git a/frames/window_main.lua b/frames/window_main.lua index 8c6aeb241..bdf2ad7d8 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -4143,13 +4143,13 @@ function gump:CreateNewLine (instancia, index) icone_classe:SetTexCoord (.75, 1, .75, 1) newLine.icone_classe = icone_classe - local icon_frame = CreateFrame ("frame", "DetailsBarra_IconFrame_" .. instancia.meu_id .. "_" .. index, newLine.statusbar) - icon_frame:SetPoint ("topleft", icone_classe, "topleft") - icon_frame:SetPoint ("bottomright", icone_classe, "bottomright") - icon_frame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1) - icon_frame.instance_id = instancia.meu_id - icon_frame.row = newLine - newLine.icon_frame = icon_frame + local iconFrame = CreateFrame ("frame", "DetailsBarra_IconFrame_" .. instancia.meu_id .. "_" .. index, newLine.statusbar) + iconFrame:SetPoint ("topleft", icone_classe, "topleft") + iconFrame:SetPoint ("bottomright", icone_classe, "bottomright") + iconFrame:SetFrameLevel (newLine.statusbar:GetFrameLevel()+1) + iconFrame.instance_id = instancia.meu_id + iconFrame.row = newLine + newLine.icon_frame = iconFrame icone_classe:SetPoint ("left", newLine, "left") newLine.statusbar:SetPoint ("topleft", icone_classe, "topright")