diff --git a/Libs/DF/math.lua b/Libs/DF/math.lua index 99ebeff9..5b279803 100644 --- a/Libs/DF/math.lua +++ b/Libs/DF/math.lua @@ -289,6 +289,14 @@ end function DF:GetBezierPoint(value, point1, point2, point3) return DF.Math.GetBezierPoint(value, point1, point2, point3) end + +function DF:GetVectorLength(vectorX, vectorY, vectorZ) + if (not vectorZ) then + return (vectorX * vectorX + vectorY * vectorY) ^ 0.5 + end + return (vectorX * vectorX + vectorY * vectorY + vectorZ * vectorZ) ^ 0.5 +end + --normalized value 0-1 result in the value on the range given, e.g 200-400 range with a value of .5 result in 300 function DF:LerpNorm(minValue, maxValue, value) return (minValue + value * (maxValue - minValue)) diff --git a/Libs/DF/schedules.lua b/Libs/DF/schedules.lua index 20cc8e11..67e2a8a3 100644 --- a/Libs/DF/schedules.lua +++ b/Libs/DF/schedules.lua @@ -220,10 +220,12 @@ end ---execute each frame a small portion of a big task ---the callback function receives a payload, the current iteration index and the max iterations ---if the callback function return true, the task is finished +---callback function signature: fun(payload: table, iterationCount:number, maxIterations:number):boolean return true if the task is finished +---payload table is the same table passed as argument to LazyExecute() ---@param callback function ---@param payload table? ---@param maxIterations number? ----@param onEndCallback function? +---@param onEndCallback function? execute when the task is finished or when maxIterations is reached function detailsFramework.Schedules.LazyExecute(callback, payload, maxIterations, onEndCallback) assert(type(callback) == "function", "DetailsFramework.Schedules.LazyExecute() param #1 'callback' must be a function.") maxIterations = maxIterations or 100000 @@ -235,12 +237,16 @@ function detailsFramework.Schedules.LazyExecute(callback, payload, maxIterations if (not bIsFinished) then iterationIndex = iterationIndex + 1 if (iterationIndex > maxIterations) then - detailsFramework:QuickDispatch(onEndCallback, payload) + if (onEndCallback) then + detailsFramework:QuickDispatch(onEndCallback, payload) + end return end C_Timer.After(0, function() wrapFunc() end) else - detailsFramework:QuickDispatch(onEndCallback, payload) + if (onEndCallback) then + detailsFramework:QuickDispatch(onEndCallback, payload) + end return end end diff --git a/boot.lua b/boot.lua index 33e5881f..87527801 100644 --- a/boot.lua +++ b/boot.lua @@ -19,8 +19,8 @@ local addonName, Details222 = ... local version = GetBuildInfo() - Details.build_counter = 12827 - Details.alpha_build_counter = 12827 --if this is higher than the regular counter, use it instead + Details.build_counter = 12828 + Details.alpha_build_counter = 12828 --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 diff --git a/functions/profiles.lua b/functions/profiles.lua index f26cfa91..3c3a0c99 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1722,7 +1722,7 @@ function Details:ExportCurrentProfile() local playerData = {} --data saved for the account local defaultGlobalData = Details.default_global_data - local globaData = {} + local globaData = {} --typo: 'globalData' was intended, cannot be fixed due to export strings compatibility --fill player and global data tables for key, _ in pairs(defaultPlayerData) do