Merge pull request #4 from me0wg4ming/master

Merging from official
This commit is contained in:
florian-gustin
2026-03-27 18:49:40 +01:00
committed by GitHub
3 changed files with 719 additions and 668 deletions
+5 -3
View File
@@ -107,6 +107,8 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
local focusGuid = nil
if this.unitstr and string.find(this.unitstr, "^0x") then
focusGuid = this.unitstr
elseif this.unitstr and this.unitstr == "player" and GetUnitGUID then
focusGuid = GetUnitGUID("player")
elseif this.unitstr and this.unitstr ~= "player" then
local guid = GetUnitGUID(this.unitstr)
if guid then focusGuid = guid end
@@ -139,12 +141,12 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
query = UnitName("player")
end
-- Fallback: pfGetCastInfo only when no focusGuid (Nampower not available for this unit)
if not cast and not castBlocked and not focusGuid and pfGetCastInfo then
-- Fallback: pfGetCastInfo only when no focusGuid or no cast found via libdebuff
if not cast and not castBlocked and pfGetCastInfo then
cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill = pfGetCastInfo(query)
end
if not cast and not castBlocked and not focusGuid and pfGetChannelInfo then
if not cast and not castBlocked and pfGetChannelInfo then
channel, nameSubtext, text, texture, startTime, endTime, isTradeSkill = pfGetChannelInfo(this.unitstr or this.unitname)
cast = channel
end
+708 -663
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -45,7 +45,7 @@ local function OnEnter(self)
local xp_perc = round(xp / xpmax * 100)
local remaining = xpmax - xp
local remaining_perc = round(remaining / xpmax * 100)
local exh_perc = GetXPExhaustion() and round(GetXPExhaustion() / xpmax / 0.75 * 100) or 0
local exh_perc = GetXPExhaustion() and round(GetXPExhaustion() / xpmax * 100) or 0
local xp_persec = ((xp - data.startxp)/(GetTime() - data.starttime))
local session = UnitXP("player") - data.startxp
local avg_hour = floor(((UnitXP("player") - data.startxp) / (GetTime() - data.starttime)) * 60 * 60)
@@ -60,6 +60,10 @@ local function OnEnter(self)
end
if GetXPExhaustion() then
table.insert(lines, { T["Rested"], "|cff5555ff+" .. exh .. " (" .. exh_perc .. "%)" })
if exh_perc >= 112 then
table.insert(lines, { "|cffff8800" .. exh_perc .. "% is the current max cap." })
table.insert(lines, { "|cffff8800Report to TWoW if you want a proper display." })
end
end
table.insert(lines, { "" })
table.insert(lines, { T["This Session"], "|cffffffff" .. session })
@@ -171,7 +175,7 @@ end
local text = "%s: %s%%"
local xp, xpmax, ex = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion()
local xpperc = round(xp / xpmax * 100)
local experc = ex and round(ex / xpmax / 0.75 * 100) or 0
local experc = ex and round(ex / xpmax * 100) or 0
if ex then text = "%s: %s%% (%s%% %s)" end
self.bar.text:SetText(string.format(text, T["Experience"], xpperc, experc, T["Rested"]))