mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
xpbar: rested gain rate in per-minute instead of per-hour
Per-hour numbers are too coarse to feel actionable while watching a tent fill — switching to /min so the displayed rate updates in a more useful range for the actual sampling cadence.
This commit is contained in:
+7
-7
@@ -86,24 +86,24 @@ local function OnEnter(self)
|
|||||||
end
|
end
|
||||||
if GetXPExhaustion() then
|
if GetXPExhaustion() then
|
||||||
table.insert(lines, { T["Rested"], "|cff5555ff+" .. exh .. " (" .. exh_perc .. "%)" })
|
table.insert(lines, { T["Rested"], "|cff5555ff+" .. exh .. " (" .. exh_perc .. "%)" })
|
||||||
if exh_perc >= 112 then
|
-- if exh_perc >= 112 then
|
||||||
table.insert(lines, { "|cffff8800" .. exh_perc .. "% is the current max cap." })
|
-- table.insert(lines, { "|cffff8800" .. exh_perc .. "% is the current max cap." })
|
||||||
table.insert(lines, { "|cffff8800Report to TWoW if you want a proper display." })
|
-- table.insert(lines, { "|cffff8800Report to TWoW if you want a proper display." })
|
||||||
end
|
-- end
|
||||||
|
|
||||||
-- Rested gain rate + time to UnitXPMax * REST_CAP_MUL, when sampled
|
-- Rested gain rate + time to UnitXPMax * REST_CAP_MUL, when sampled
|
||||||
-- UPDATE_EXHAUSTION events span a meaningful interval (e.g., resting
|
-- UPDATE_EXHAUSTION events span a meaningful interval (e.g., resting
|
||||||
-- under a Turtle WoW tent generates a fast continuous stream).
|
-- under a Turtle WoW tent generates a fast continuous stream).
|
||||||
local samples = data.rest_samples
|
local samples = data.rest_samples
|
||||||
local n = table.getn(samples)
|
local n = table.getn(samples)/ca
|
||||||
if n >= 2 then
|
if n >= 2 then
|
||||||
local first, last = samples[1], samples[n]
|
local first, last = samples[1], samples[n]
|
||||||
local span = last[1] - first[1]
|
local span = last[1] - first[1]
|
||||||
local gain = last[2] - first[2]
|
local gain = last[2] - first[2]
|
||||||
if span > 0 and gain > 0 then
|
if span > 0 and gain > 0 then
|
||||||
local rate_per_sec = gain / span
|
local rate_per_sec = gain / span
|
||||||
local rate_per_hour = floor(rate_per_sec * 3600)
|
local rate_per_min = floor(rate_per_sec * 60)
|
||||||
table.insert(lines, { T["Rested Gain"], "|cff5555ff+" .. rate_per_hour .. " / h" })
|
table.insert(lines, { T["Rested Gain"], "|cff5555ff+" .. rate_per_min .. " / min" })
|
||||||
|
|
||||||
local cap = xpmax * REST_CAP_MUL
|
local cap = xpmax * REST_CAP_MUL
|
||||||
if exh < cap then
|
if exh < cap then
|
||||||
|
|||||||
Reference in New Issue
Block a user