mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 20:20:01 +00:00
tooltip: optional movement-speed line via GetUnitSpeed
New tooltip.movespeed config knob (default off, checkbox in the GUI's tooltip page). When on, the unit tooltip gains a "Speed: N%" line where N is the unit's run speed normalized to vanilla's 7.0 yd/s base — 100 unmounted, 160 on a 60% mount, 200 on epic, less under snares. Uses runSpeed (return 2 of GetUnitSpeed), not currentSpeed, so the number reflects what the unit *would* be running at — visible even while they're standing still. runSpeed is 0 for out-of-range units, so the line is skipped in that case.
This commit is contained in:
@@ -233,6 +233,14 @@ pfUI:RegisterModule("tooltip", function ()
|
||||
end
|
||||
end
|
||||
|
||||
if C.tooltip.movespeed == "1" then
|
||||
local currentSpeed = GetUnitSpeed(unit)
|
||||
if currentSpeed and currentSpeed > 0 then
|
||||
local pct = floor(currentSpeed / 7 * 100 + 0.5)
|
||||
GameTooltip:AddLine(T["Speed"] .. ": " .. pct .. "%", 0.7, 0.7, 1)
|
||||
end
|
||||
end
|
||||
|
||||
if hp and hpm then
|
||||
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
|
||||
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
|
||||
|
||||
Reference in New Issue
Block a user