Fiurs-Hearth / WIIIUI

A Warcraft III UI addon for vanilla WoW
57 stars 9 forks source link

Hello, RestEXP% info #16

Open Azuldraken opened 1 year ago

Azuldraken commented 1 year ago

Is it posible add RestEXP% info in the WIII UI Addon? adn where or how i can use the button of tickt's with the addon?

Vilberg commented 1 year ago

@Azuldraken In the WIIIUI.xml file you can add the following lines to add rested XP % to the xp hover window. If you're unfamiliar with how best to show line numbers in an xml file, use Notepad++.

Add this after line 2208:

local xpRestedPercentage = string.format("%.2f %%", GetXPExhaustion() / UnitXPMax('player') * 100)

Change line 2212 (now 2213 after adding the previous line) to:

.."|cffffd100Rested Experience:|r "..(GetXPExhaustion() or 0).." ("..xpRestedPercentage..")".."\n" )

image

The codeblock should look like this when finished

<OnEnter>
WIIIUI_xpCurrLevel:SetText("XP "..UnitXP("player").." / "..UnitXPMax("player"))
local xpPercentage =  string.format("%.2f %%", UnitXP('player') / UnitXPMax('player') * 100)
local xpPercentageLeft = string.format("%.2f %%", 100 - (UnitXP('player') / UnitXPMax('player') * 100))
local xpRestedPercentage = string.format("%.2f %%", GetXPExhaustion() / UnitXPMax('player') * 100)
WIIIUI_infoBox_Text:SetText("|cffffd100Experience required to level up:|r "..UnitXPMax("player").."\n"
                        .."|cffffd100Experience until next level:|r "..(UnitXPMax("player") - UnitXP("player")).." ("..xpPercentageLeft..")".."\n"
                        .."|cffffd100Current Experience:|r "..UnitXP("player").." ("..xpPercentage..")".."\n"
                        .."|cffffd100Rested Experience:|r "..(GetXPExhaustion() or 0).." ("..xpRestedPercentage..")".."\n" )
WIIIUI_infoBox:SetPoint("CENTER", WIIIUI_xpHoverFrame, 0, WIIIUI_xpHoverFrame:GetHeight() + 30)
WIIIUI_infoBox:Show()
</OnEnter>