From b7589566493c86f3d4238110f7dd69ea1c8e8c2a Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 30 Sep 2022 22:07:42 -0300 Subject: [PATCH] Library update --- Libs/DF/fw.lua | 78 +++++++++++++--------------- Libs/LibOpenRaid/Functions.lua | 16 ++++++ Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- Libs/LibOpenRaid/ThingsToMantain.lua | 3 +- frames/window_aura_tracker.lua | 2 +- 5 files changed, 57 insertions(+), 44 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 14003617..c34670ad 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -2929,62 +2929,58 @@ end ----------------------------- --safe copy from blizz api -function DF:Mixin (object, ...) +function DF:Mixin(object, ...) for i = 1, select("#", ...) do - local mixin = select(i, ...); - for k, v in pairs(mixin) do - object[k] = v; + local mixin = select(i, ...) + for key, value in pairs(mixin) do + object[key] = value end end - - return object; + return object end ----------------------------- --> animations -function DF:CreateAnimationHub (parent, onPlay, onFinished) +function DF:CreateAnimationHub(parent, onPlay, onFinished) local newAnimation = parent:CreateAnimationGroup() - newAnimation:SetScript ("OnPlay", onPlay) - newAnimation:SetScript ("OnFinished", onFinished) - newAnimation:SetScript ("OnStop", onFinished) + newAnimation:SetScript("OnPlay", onPlay) + newAnimation:SetScript("OnFinished", onFinished) + newAnimation:SetScript("OnStop", onFinished) newAnimation.NextAnimation = 1 return newAnimation end -function DF:CreateAnimation (animation, type, order, duration, arg1, arg2, arg3, arg4, arg5, arg6, arg7) - local anim = animation:CreateAnimation (type) - - anim:SetOrder (order or animation.NextAnimation) - anim:SetDuration (duration) - - type = string.upper (type) - - if (type == "ALPHA") then - anim:SetFromAlpha (arg1) - anim:SetToAlpha (arg2) - - elseif (type == "SCALE") then - if (DF.IsDragonflight()) then - anim:SetScaleFrom (arg1, arg2) - anim:SetScaleTo (arg3, arg4) - else - anim:SetFromScale (arg1, arg2) - anim:SetToScale (arg3, arg4) - end +function DF:CreateAnimation(animation, animationType, order, duration, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + local anim = animation:CreateAnimation(animationType) + anim:SetOrder(order or animation.NextAnimation) + anim:SetDuration(duration) - anim:SetOrigin (arg5 or "center", arg6 or 0, arg7 or 0) --point, x, y - - elseif (type == "ROTATION") then - anim:SetDegrees (arg1) --degree - anim:SetOrigin (arg2 or "center", arg3 or 0, arg4 or 0) --point, x, y - - elseif (type == "TRANSLATION") then - anim:SetOffset (arg1, arg2) - + animationType = string.upper(animationType) + + if (animationType == "ALPHA") then + anim:SetFromAlpha(arg1) + anim:SetToAlpha(arg2) + + elseif (animationType == "SCALE") then + if (DF.IsDragonflight()) then + anim:SetScaleFrom(arg1, arg2) + anim:SetScaleTo(arg3, arg4) + else + anim:SetFromScale(arg1, arg2) + anim:SetToScale(arg3, arg4) + end + anim:SetOrigin(arg5 or "center", arg6 or 0, arg7 or 0) --point, x, y + + elseif (animationType == "ROTATION") then + anim:SetDegrees(arg1) --degree + anim:SetOrigin(arg2 or "center", arg3 or 0, arg4 or 0) --point, x, y + + elseif (animationType == "TRANSLATION") then + anim:SetOffset(arg1, arg2) end - - animation.NextAnimation = animation.NextAnimation + 1 + + animation.NextAnimation = animation.NextAnimation + 1 return anim end diff --git a/Libs/LibOpenRaid/Functions.lua b/Libs/LibOpenRaid/Functions.lua index c0893b76..5e15a54f 100644 --- a/Libs/LibOpenRaid/Functions.lua +++ b/Libs/LibOpenRaid/Functions.lua @@ -255,4 +255,20 @@ function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters) end return resultFilters +end + +function openRaidLib.FlaskGetBySpellId(spellId) + return LIB_OPEN_RAID_FLASK_BUFF[spellId] +end + +function openRaidLib.FlaskGetTier(auraInfo) + local flaskTable = openRaidLib.FlaskGetBySpellId(auraInfo.spellId) + local points = auraInfo.points + for i = 1, #points do + local flaskTier = flaskTable[points[i]] + if (flaskTier) then + return flaskTier + end + end + return 1 end \ No newline at end of file diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 33b25c6a..87eaabb6 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -58,7 +58,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 57 +local CONST_LIB_VERSION = 58 LIB_OPEN_RAID_CAN_LOAD = false --declae the library within the LibStub diff --git a/Libs/LibOpenRaid/ThingsToMantain.lua b/Libs/LibOpenRaid/ThingsToMantain.lua index 5a2ec95c..1a42b734 100644 --- a/Libs/LibOpenRaid/ThingsToMantain.lua +++ b/Libs/LibOpenRaid/ThingsToMantain.lua @@ -467,7 +467,8 @@ elseif (isExpansion_Dragonflight()) then --spellId of healing from potions LIB_OPEN_RAID_HEALING_POTIONS = { [370511] = 1, --Refreshing Healing Potion - + [371039] = 1, --Potion of Withering Vitality + [6262] = 1, --Warlock's Healthstone } end diff --git a/frames/window_aura_tracker.lua b/frames/window_aura_tracker.lua index 1de62e75..c17d783d 100644 --- a/frames/window_aura_tracker.lua +++ b/frames/window_aura_tracker.lua @@ -271,7 +271,7 @@ function Details.AuraTracker.RefreshScroll(self, data, offset, totalLines) line.Icon.texture = auraInfo.icon line.Name.text = auraInfo.name line.SpellId.text = auraInfo.spellId - line.LuaTableEntry.text = formatToLuaTable.doFormat2NoIndex(auraInfo) + line.LuaTableEntry.text = formatToLuaTable.doFormat5(auraInfo) --doFormat2NoIndex line.Points.text = formatToLuaTable.doFormat2NoIndexFromCache(auraInfo) end end