22 lines
1.1 KiB
Lua
Executable File
22 lines
1.1 KiB
Lua
Executable File
-- Octo parity port of interface/framexml/octorestedtooltip/octorestedtooltip.lua (/rested part only).
|
|
-- The 175% tooltip lives in the native ExpBar child (FDID 7431876), NOT here: wrapping the global GetRestState
|
|
-- would taint native status-bar code. v2: Octo's hardcoded "The cap is 150% (1.5 levels)" sentence removed
|
|
-- (unproven vs observed ~113% stored pool; Codex review 2026-11-20). Computed percent and XP unchanged.
|
|
-- v1 with Octo-exact text is kept in ..\OctoRested.
|
|
OCTO_UI_RESTED_NONE = OCTO_UI_RESTED_NONE
|
|
or "|cff66ccffRested XP:|r you are not currently rested (0% of a level)."
|
|
OCTO_UI_RESTED_STATUS = OCTO_UI_RESTED_STATUS
|
|
or "|cff66ccffRested XP:|r %d%% of a level (%d XP)."
|
|
|
|
SLASH_OCTORESTED1 = "/rested"
|
|
SlashCmdList["OCTORESTED"] = function()
|
|
local rested = GetXPExhaustion()
|
|
local levelXP = UnitXPMax("player")
|
|
if not rested or rested <= 0 or not levelXP or levelXP <= 0 then
|
|
DEFAULT_CHAT_FRAME:AddMessage(OCTO_UI_RESTED_NONE)
|
|
return
|
|
end
|
|
local pct = math.floor((rested / levelXP) * 100 + 0.5)
|
|
DEFAULT_CHAT_FRAME:AddMessage(string.format(OCTO_UI_RESTED_STATUS, pct, rested))
|
|
end
|