mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 11:50:49 +00:00
xpbar: add previously added xp to session
This commit is contained in:
+6
-1
@@ -15,11 +15,16 @@ pfUI:RegisterModule("xpbar", function ()
|
|||||||
pfUI.xp:RegisterEvent("PLAYER_ENTERING_WORLD")
|
pfUI.xp:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
|
|
||||||
pfUI.xp:SetScript("OnEvent", function()
|
pfUI.xp:SetScript("OnEvent", function()
|
||||||
if event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_LEVEL_UP" then
|
if event == "PLAYER_ENTERING_WORLD" then
|
||||||
pfUI.xp.starttime = GetTime()
|
pfUI.xp.starttime = GetTime()
|
||||||
pfUI.xp.startxp = UnitXP("player")
|
pfUI.xp.startxp = UnitXP("player")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if event == "PLAYER_LEVEL_UP" then
|
||||||
|
-- add previously gained experience to the session
|
||||||
|
pfUI.xp.startxp = pfUI.xp.startxp - UnitXPMax("player")
|
||||||
|
end
|
||||||
|
|
||||||
if UnitXPMax("player") ~= 0 then
|
if UnitXPMax("player") ~= 0 then
|
||||||
pfUI.xp.bar:SetMinMaxValues(0, UnitXPMax("player"))
|
pfUI.xp.bar:SetMinMaxValues(0, UnitXPMax("player"))
|
||||||
pfUI.xp.bar:SetValue(UnitXP("player"))
|
pfUI.xp.bar:SetValue(UnitXP("player"))
|
||||||
|
|||||||
Reference in New Issue
Block a user