From 95b7acbe8efdf24cbca9ea7a2d9d7933f26be59f Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 8 Jul 2018 00:55:08 +0200 Subject: [PATCH] xpbar: show remaining time to levelup --- modules/xpbar.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/xpbar.lua b/modules/xpbar.lua index 2b0403fe..7a039029 100644 --- a/modules/xpbar.lua +++ b/modules/xpbar.lua @@ -65,6 +65,7 @@ pfUI:RegisterModule("xpbar", function () local remaining = xpmax - xp local remaining_perc = round(remaining / xpmax * 100) local exh_perc = 0 + local xp_persec = ((xp - pfUI.xp.startxp)/(GetTime() - pfUI.xp.starttime)) if GetXPExhaustion() then exh_perc = round(GetXPExhaustion() / xpmax * 100) end @@ -85,6 +86,7 @@ pfUI:RegisterModule("xpbar", function () GameTooltip:AddLine(" ") GameTooltip:AddDoubleLine(T["This Session"], "|cffffffff" .. UnitXP("player") - pfUI.xp.startxp) GameTooltip:AddDoubleLine(T["Average Per Hour"], "|cffffffff" .. floor(((UnitXP("player") - pfUI.xp.startxp) / (GetTime() - pfUI.xp.starttime)) * 60 * 60)) + GameTooltip:AddDoubleLine(T["Time Remaining"], "|cffffffff" .. (xp_persec > 0 and SecondsToTime(remaining/xp_persec) or 0)) GameTooltip:Show() end)