Skip to content

Commit

Permalink
Framework and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 5, 2024
1 parent 3a726e6 commit 91c6be8
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Libs/DF/LibDFramework-1.0.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Lib: LibDFramework-1.0
## Notes: Base Framework for many Addons

Expand Down
12 changes: 6 additions & 6 deletions Libs/DF/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)

if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftPadding or 0), -1)

elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 3, -1)
Expand All @@ -668,7 +668,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
end
else
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftPadding or 0), -1)
else
button.text:SetPoint("center", button,"center", 1, -1)
end
Expand Down Expand Up @@ -729,7 +729,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)

if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftPadding or 0), 0)

elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 2, 0)
Expand All @@ -742,7 +742,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
end
else
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftPadding or 0), 0)
else
button.text:SetPoint("center", button,"center", 0, 0)
end
Expand Down Expand Up @@ -828,7 +828,7 @@ function ButtonMetaFunctions:SetTemplate(template)

if (template.icon) then
local iconInfo = template.icon
self:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftpadding)
self:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftPadding)
end

if (template.textsize) then
Expand Down Expand Up @@ -1543,4 +1543,4 @@ end
local closeButton = detailsFramework:CreateCloseButton(frame, "$parentCloseButton")
closeButton:SetPoint("topright", frame, "topright", 0, 0)
--]=]
--]=]
6 changes: 3 additions & 3 deletions Libs/DF/charts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,8 @@ detailsFramework.MultiChartFrameMixin = {
biggestAverage[i] = {average = chartFrame.average, chartIndex = i}
end

--sort the averages by the biggest average placing the biggest average in the first position
table.sort(biggestAverage, function(a, b) return a.average > b.average end)
-- sort the averages by the biggest average placing the biggest average in the first position
table.sort(biggestAverage, function(a, b) if not (a.average and b.average) then return a.average ~= nil end return a.average > b.average end)

local minValue, multiChartMaxValue = multiChartFrame:GetMinMaxValues()
local plotAreaWidth = multiChartFrame.plotFrame:GetWidth() --if there's no axis, the plotFrame has no width
Expand Down Expand Up @@ -1518,4 +1518,4 @@ function detailsFramework:CreateGraphicMultiLineFrame(parent, name)

createPlotFrame(chartFrame) --creates chartFrame.plotFrame
return chartFrame
end
end
3 changes: 3 additions & 0 deletions Libs/DF/definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
---@field unpackhash fun(tbl:table) : table unpack a table packed with packhash()
---@field packhashsubtable fun(tbl:table) : string pack a hash table where the value of the key is a numerical table, example: {key1 = {1, 2, 3}, key2 = {4, 6}, key3 = {7}}, result: "key1,3,1,2,3,key2,2,4,6,key3,1,7"
---@field unpackhashsubtable fun(tbl:table) : table unpack a table packed with packhashsubtable()
---@field inserts fun(tbl:table, ...) : table receives an indexed table and N arguments, add all arguments passed into the table


---@class df_language : table
---@field Register fun(addonId:any, languageId:string, gameLanguageOnly:boolean?) : table
Expand Down Expand Up @@ -241,6 +243,7 @@
---@field CreateFrameContainer fun(self:table, parent:frame, options:table?, frameName:string?) : df_framecontainer create a frame container, which is a frame that envelops another frame, and can be moved, resized, etc.
---@field CreateAnimationHub fun(self:table, parent:uiobject, onPlay:function?, onFinished:function?) : animationgroup
---@field CreateAnimation fun(self:table, animationGroup:animationgroup, animationType:animationtype, order:number, duration:number, arg1:any, arg2:any, arg3:any, arg4:any, arg5:any, arg6:any, arg7:any, arg8:any) : animation
---@field CreatePunchAnimation fun(self:table, frame:uiobject, scale:number?):animationgroup
---@field CreateTexture fun(self:table, parent:frame, texture:atlasname|texturepath|textureid|nil, width:number?, height:number?, layer:drawlayer?, coords:table?, member:string?, name:string?) : df_image
---@field CreateImage fun(self:table, parent:frame, texture:atlasname|texturepath|textureid|nil, width:number?, height:number?, layer:drawlayer?, coords:table?, member:string?, name:string?) : df_image
---@field CreateFrameShake fun(self:table, parent:uiobject, duration:number?, amplitude:number?, frequency:number?, absoluteSineX:boolean?, absoluteSineY:boolean?, scaleX:number?, scaleY:number?, fadeInTime:number?, fadeOutTime:number?, anchorPoints:table?) : df_frameshake
Expand Down
33 changes: 32 additions & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 578
local dversion = 579
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -937,6 +937,16 @@ function DF.table.append(t1, t2)
return t1
end

---receive a table and N arguments, add each argument to the table
---@param t1 table
---@vararg any
function DF.table.inserts(t1, ...)
for i = 1, select("#", ...) do
t1[#t1+1] = select(i, ...)
end
return t1
end

---copy values that does exist on table2 but not on table1
---@param t1 table
---@param t2 table
Expand Down Expand Up @@ -2101,6 +2111,27 @@ function DF:CreateFlashAnimation(frame, onFinishFunc, onLoopFunc)
return flashAnimation
end

local onStartPunchAnimation = function(animationGroup)
local parent = animationGroup:GetParent()
animationGroup.parentWidth = parent:GetWidth()
animationGroup.parentHeight = parent:GetHeight()
end

local onStopPunchAnimation = function(animationGroup)
local parent = animationGroup:GetParent()
parent:SetWidth(animationGroup.parentWidth)
parent:SetHeight(animationGroup.parentHeight)
end

function DF:CreatePunchAnimation(frame, scale)
scale = scale or 1.1
scale = math.min(scale, 1.9)
local animationHub = DF:CreateAnimationHub(frame, onStartPunchAnimation, onStopPunchAnimation)
local scaleUp = DF:CreateAnimation(animationHub, "scale", 1, 0.05, 1, 1, scale, scale, "center", 0, 0)
local scaleDown = DF:CreateAnimation(animationHub, "scale", 2, 0.05, 1, 1, 1-(scale - 1), 1-(scale - 1), "center", 0, 0)
return animationHub
end

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--anchoring

Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
local addonName, Details222 = ...
local version, build, date, tvs = GetBuildInfo()

Details.build_counter = 13132
Details.alpha_build_counter = 13132 --if this is higher than the regular counter, use it instead
Details.build_counter = 13166
Details.alpha_build_counter = 13166 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_Compare2/Details_Compare2.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Compare 2.0
## Notes: Replace the Compare tab in the player breakdown window.
## RequiredDeps: Details
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_DataStorage/Details_DataStorage.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Storage
## Notes: Stores information for Details! Damage Meter
## DefaultState: Enabled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Encounter Breakdown (plugin)
## Notes: Show detailed information about a boss encounter. Also provide damage per phase, graphic charts, easy weakauras creation.
## RequiredDeps: Details
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_RaidCheck/Details_RaidCheck.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Raid Check (plugin)
## Notes: Show talents and item level for all members in your group, also shows food and flask state.
## RequiredDeps: Details
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_Streamer/Details_Streamer.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Streamer (plugin)
## Notes: Show which spells you are casting, viewers can see what are you doing and follow your steps.
## RequiredDeps: Details
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_TinyThreat/Details_TinyThreat.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Tiny Threat (plugin)
## Notes: Threat meter plugin, show threat for group members in the window. Select it from the Plugin menu in the Orange Cogwheel.
## RequiredDeps: Details
Expand Down
2 changes: 1 addition & 1 deletion plugins/Details_Vanguard/Details_Vanguard.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110005
## Title: Details!: Vanguard (plugin)
## Notes: Show the health and debuffs for tanks in your group.
## SavedVariablesPerCharacter: _detalhes_databaseVanguard
Expand Down

0 comments on commit 91c6be8

Please sign in to comment.