SNT Info

1 - Rested indication in xp bar

I don't know if you will consider adding this in your mod, but i often check if i'm rested or not, and your addon was too good to keep the vanilla xp bar just for that.
It's probably highly unoptimized code but it works (i don't know what the tooltip would do for a lvl 40 character though).

In the text of the bar, adds " R" if rested :
function snt_bar.xp_upd()
   if (GameData.Player.level == 40) then snt_bar["xp"] = "LEVELCAP" return end
   local xp= GameData.Player.Experience.curXpEarned
   local xp_need = GameData.Player.Experience.curXpNeeded
   local xp_string = string.format("%d : %02d%% [%0.1fk]",GameData.Player.level,xp/xp_need*100,(xp_need-xp)/1000)
   if (GameData.Player.Experience.restXp == 0) then snt_bar["xp"] = xp_string return end
   snt_bar["xp"] = string.format("%s R", xp_string)
end

In the tooltip, adds a line with remaining rested xp :
function snt_bar.xp_tooltip()
   local xp= GameData.Player.Experience.curXpEarned
   local xp_need = GameData.Player.Experience.curXpNeeded
   local xp_rested = GameData.Player.Experience.restXp
   Tooltips.CreateTextOnlyTooltip("snt_xp",nil)
   Tooltips.AnchorTooltip(Tooltips.ANCHOR_WINDOW_BOTTOM)
   Tooltips.SetTooltipColor(1,1,unpack(SNTBAR.colors.xp))
   Tooltips.SetTooltipText(1,1,L"EXP INFO")
   Tooltips.SetTooltipText(2,1,L"XP")
   Tooltips.SetTooltipText(3,1,L"NEEDED")
   Tooltips.SetTooltipText(4,1,L"REMAINING")
   Tooltips.SetTooltipText(5,1,L"RESTED")
   Tooltips.SetTooltipText(2,2,towstring(tostring(xp)))
   Tooltips.SetTooltipText(3,2,towstring(tostring(xp_need)))
   Tooltips.SetTooltipText(4,2,towstring(tostring(xp_need-xp)))
   Tooltips.SetTooltipText(5,2,towstring(tostring(xp_rested)))
   Tooltips.Finalize()
end

User When Change
Scaythe Mon, 27 Oct 2008 01:53:49 Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of DonKaban DonKaban Mon, 27 Oct 2008 08:58:56

    Thanks for ticket. Im add rested XP in next version. I think not only in tooltip, im add color indicaton rested/normal on main XP panel (green - rested, blue - normal for example )

  • 1 comment

Facts

Last updated on
02 Nov 2008
Reported on
27 Oct 2008
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.

Reported by

Possible assignees

Votes (Total: +3, Average: +3.0)