Merge pull request #5 from me0wg4ming/master

mfo
This commit is contained in:
florian-gustin
2026-03-29 00:42:28 +01:00
committed by GitHub
6 changed files with 87 additions and 17 deletions
+12 -5
View File
@@ -127,7 +127,12 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
texture = castData.icon
startTime = castData.startTime * 1000
endTime = castData.endTime * 1000
nameSubtext = ""
-- Try to get rank from spell DB via spellID (nameSubtext is not stored in libdebuff_casts)
if castData.spellID and GetSpellRecField then
nameSubtext = GetSpellRecField(castData.spellID, "rank") or ""
else
nameSubtext = ""
end
if castData.event == "CHANNEL" then
channel = cast
end
@@ -141,12 +146,14 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
query = UnitName("player")
end
-- Fallback: pfGetCastInfo only when no focusGuid or no cast found via libdebuff
if not cast and not castBlocked and pfGetCastInfo then
-- Fallback: pfGetCastInfo only when no focusGuid (Nampower not available for this unit).
-- If we have a focusGuid, libdebuff is authoritative - don't fall back to libcast
-- even if no cast is active (prevents false positives e.g. spellbook clicks on CD spells).
if not cast and not castBlocked and not focusGuid and pfGetCastInfo then
cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill = pfGetCastInfo(query)
end
if not cast and not castBlocked and pfGetChannelInfo then
if not cast and not castBlocked and not focusGuid and pfGetChannelInfo then
channel, nameSubtext, text, texture, startTime, endTime, isTradeSkill = pfGetChannelInfo(this.unitstr or this.unitname)
cast = channel
end
@@ -390,4 +397,4 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
UpdateMovable(pfUI.castbar.focus)
end
end)
end)
+16 -7
View File
@@ -5,17 +5,26 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function ()
local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" }
local groupchannels = { "BATTLEGROUND", "RAID" }
-- Determine branch from toc version string.
-- experiment toc has "9.x.x (experiment version)", master does not.
-- Only notify players on the same branch about updates.
local tocversion = GetAddOnMetadata(pfUI.name, "Version") or ""
local localbranch = strfind(tocversion, "experiment") and "exp" or "master"
local versionmsg = "VERSION:" .. localversion .. ":" .. localbranch
pfUI.updater = CreateFrame("Frame")
pfUI.updater:RegisterEvent("CHAT_MSG_ADDON")
pfUI.updater:RegisterEvent("PLAYER_ENTERING_WORLD")
pfUI.updater:RegisterEvent("PARTY_MEMBERS_CHANGED")
pfUI.updater:SetScript("OnEvent", function()
if event == "CHAT_MSG_ADDON" and arg1 == "pfUI" then
local v, remoteversion = pfUI.api.strsplit(":", arg2)
local remoteversion = tonumber(remoteversion)
if v == "VERSION" and remoteversion then
if remoteversion > localversion then
pfUI_init.updateavailable = remoteversion
local v, rv, branch = pfUI.api.strsplit(":", arg2)
local rv = tonumber(rv)
-- only process VERSION messages from the same branch
-- messages without a branch tag (old versions) are ignored
if v == "VERSION" and rv and branch == localbranch then
if rv > localversion then
pfUI_init.updateavailable = rv
end
end
end
@@ -24,7 +33,7 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function ()
local groupsize = GetNumRaidMembers() > 0 and GetNumRaidMembers() or GetNumPartyMembers() > 0 and GetNumPartyMembers() or 0
if ( this.group or 0 ) < groupsize then
for _, chan in pairs(groupchannels) do
SendAddonMessage("pfUI", "VERSION:" .. localversion, chan)
SendAddonMessage("pfUI", versionmsg, chan)
end
end
this.group = groupsize
@@ -39,7 +48,7 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function ()
end
for _, chan in pairs(loginchannels) do
SendAddonMessage("pfUI", "VERSION:" .. localversion, chan)
SendAddonMessage("pfUI", versionmsg, chan)
end
end
end)