mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
Re-anchor tradeskill merge bar to real craft starts
EnterTradeskillMerge sized the merged bar as startMs + single*count, a zero-latency assumption. Each craft boundary actually costs a server round-trip, so the real chain runs ~(N-1)*lag longer than the bar assumed. At the clear the overall fill was clamped to full and looked done, but the fast per-craft spark tracks real time and came up short by the accumulated lag -- freezing partway on the final craft. StartTradeskillCraft now re-pins endTime to each craft's real start (remaining crafts each still take `single`), so on the last craft remaining==1 and endTime lands on its true completion. The spark and the overall progress now reach the right edge together.
This commit is contained in:
@@ -69,6 +69,11 @@ pfUI:RegisterModule("castbar", function ()
|
||||
-- spark to the left edge of the bar.
|
||||
local function StartTradeskillCraft(cb)
|
||||
cb.currentCraftStart = GetTime() * 1000
|
||||
local remaining = cb.tradeskillTotal - (cb.tradeskillCompleted or 0)
|
||||
cb.endTime = cb.currentCraftStart + cb.tradeskillSingleMs * remaining
|
||||
local duration = (cb.endTime - cb.startTime) / 1000
|
||||
cb.bar:SetMinMaxValues(0, duration)
|
||||
cb.lastMax = duration
|
||||
UpdateTradeskillLabel(cb)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user