mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd722b0f0f | ||
|
|
e5c51fff48 | ||
|
|
6570afb70a | ||
|
|
0f97e8b0bd | ||
|
|
64c62a2a25 | ||
|
|
4d316ed43a | ||
|
|
db0195f0f7 | ||
|
|
3d2d5f9254 | ||
|
|
dfbeeb454a | ||
|
|
439d5a397a | ||
|
|
5524ad3b91 | ||
|
|
0f59a3a9b5 | ||
|
|
ffdf376ac4 | ||
|
|
9bdde06150 | ||
|
|
8bf6672114 | ||
|
|
29b948e6fa | ||
|
|
5f61f94a24 | ||
|
|
65678da3d2 | ||
|
|
9b7aca8541 | ||
|
|
60525eec3a | ||
|
|
c3829c2bd2 | ||
|
|
28de6fd835 | ||
|
|
fc75e091a4 | ||
|
|
ef478b0552 | ||
|
|
760d8992b6 | ||
|
|
62a99ac410 | ||
|
|
deeec89955 | ||
|
|
cca9771ef0 | ||
|
|
371872bb90 | ||
|
|
591045a606 | ||
|
|
f657a9e7e8 | ||
|
|
0cbd9ecf98 | ||
|
|
6ca482fcaa | ||
|
|
8902d43f40 | ||
|
|
8f006c0643 |
@@ -4,16 +4,18 @@ about: Report a bug or issue with pfUI
|
|||||||
title: "[Bug Description] "
|
title: "[Bug Description] "
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Please fill out ALL fields below. Issues without this info may be closed. -->
|
<!-- Please fill out ALL fields below. Issues without this info may be closed. -->
|
||||||
|
|
||||||
**pfUI Branch:**
|
**pfUI Version:**
|
||||||
- [ ] Master
|
|
||||||
- [ ] experiment
|
**Your ClassicAPI Version:**
|
||||||
|
|
||||||
|
**Your Nampower Version:**
|
||||||
|
|
||||||
|
|
||||||
**Your Nampower Version:** (e.g. latest, or specific commit/date)
|
|
||||||
<!-- Skip if using Compat branch -->
|
|
||||||
|
|
||||||
**Other Addons installed:**
|
**Other Addons installed:**
|
||||||
<!-- List any other addons you are using, or "none" -->
|
<!-- List any other addons you are using, or "none" -->
|
||||||
@@ -45,4 +47,3 @@ Paste error log here
|
|||||||
## Screenshot / Video
|
## Screenshot / Video
|
||||||
<!-- Attach a screenshot or video showing the issue. This is REQUIRED. -->
|
<!-- Attach a screenshot or video showing the issue. This is REQUIRED. -->
|
||||||
<!-- Drag & drop images here or paste a link -->
|
<!-- Drag & drop images here or paste a link -->
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ about: Suggest a new feature or improvement for pfUI
|
|||||||
title: "[Feature] "
|
title: "[Feature] "
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Feature Description
|
## Feature Description
|
||||||
@@ -20,4 +21,3 @@ assignees: ''
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
<!-- If possible, show examples from other addons or screenshots/mockups of how it could look -->
|
<!-- If possible, show examples from other addons or screenshots/mockups of how it could look -->
|
||||||
|
|
||||||
|
|||||||
+14
-14
@@ -28,12 +28,8 @@ function pfUI.api.HasNampower()
|
|||||||
return GetNampowerVersion and true or false
|
return GetNampowerVersion and true or false
|
||||||
end
|
end
|
||||||
|
|
||||||
local isTurtleWoW
|
|
||||||
function pfUI.api.IsTurtleWoW()
|
function pfUI.api.IsTurtleWoW()
|
||||||
if isTurtleWoW == nil then
|
return C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
||||||
isTurtleWoW = C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
|
||||||
end
|
|
||||||
return isTurtleWoW
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- [ GetUnitDistance ]
|
-- [ GetUnitDistance ]
|
||||||
@@ -208,7 +204,7 @@ function pfUI.api.GetUnbuffedRoster(name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if UnitInRaid("player") then
|
if IsInRaid() then
|
||||||
for i=1,40 do check("raid"..i) end
|
for i=1,40 do check("raid"..i) end
|
||||||
else
|
else
|
||||||
check("player")
|
check("player")
|
||||||
@@ -434,13 +430,17 @@ function pfUI.api.GetBagFamily(bag)
|
|||||||
|
|
||||||
local id = GetInventoryItemID("player", ContainerIDToInventoryID(bag))
|
local id = GetInventoryItemID("player", ContainerIDToInventoryID(bag))
|
||||||
if id then
|
if id then
|
||||||
local _, _, _, _, _, itemType, subType = GetItemInfo(id)
|
-- classID 1 = Container (bags), 11 = Quiver
|
||||||
local bagsubtype = L["bagtypes"][subType]
|
-- Container subclasses: 0 = Bag (default), 1 = Soul Bag, 2+ = specialty (herb/enchanting/etc.)
|
||||||
|
-- Quiver subclasses: 2 = Quiver (arrows), 3 = Ammo Pouch (bullets)
|
||||||
if bagsubtype == "DEFAULT" then return "BAG" end
|
local _, _, _, _, _, classID, subClassID = C_Item.GetItemInfoInstant(id)
|
||||||
if bagsubtype == "SOULBAG" then return "SOULBAG" end
|
if classID == 1 then
|
||||||
if bagsubtype == "QUIVER" then return "QUIVER" end
|
if subClassID == 0 then return "BAG" end
|
||||||
if bagsubtype == nil then return "SPECIAL" end
|
if subClassID == 1 then return "SOULBAG" end
|
||||||
|
return "SPECIAL"
|
||||||
|
elseif classID == 11 then
|
||||||
|
return "QUIVER"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -485,7 +485,7 @@ end
|
|||||||
-- 'msg' [string] the message to send
|
-- 'msg' [string] the message to send
|
||||||
function pfUI.api.SendChatMessageWide(msg)
|
function pfUI.api.SendChatMessageWide(msg)
|
||||||
local channel = "SAY"
|
local channel = "SAY"
|
||||||
if UnitInRaid("player") then
|
if IsInRaid() then
|
||||||
if ( IsRaidLeader() or IsRaidOfficer() ) then
|
if ( IsRaidLeader() or IsRaidOfficer() ) then
|
||||||
channel = "RAID_WARNING"
|
channel = "RAID_WARNING"
|
||||||
else
|
else
|
||||||
|
|||||||
+14
-2
@@ -748,6 +748,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("tooltip", nil, "cursoroffset", "20")
|
pfUI:UpdateConfig("tooltip", nil, "cursoroffset", "20")
|
||||||
pfUI:UpdateConfig("tooltip", nil, "extguild", "1")
|
pfUI:UpdateConfig("tooltip", nil, "extguild", "1")
|
||||||
pfUI:UpdateConfig("tooltip", nil, "itemid", "0")
|
pfUI:UpdateConfig("tooltip", nil, "itemid", "0")
|
||||||
|
pfUI:UpdateConfig("tooltip", nil, "movespeed", "0")
|
||||||
pfUI:UpdateConfig("tooltip", nil, "alpha", "0.8")
|
pfUI:UpdateConfig("tooltip", nil, "alpha", "0.8")
|
||||||
pfUI:UpdateConfig("tooltip", nil, "alwaysperc", "0")
|
pfUI:UpdateConfig("tooltip", nil, "alwaysperc", "0")
|
||||||
pfUI:UpdateConfig("tooltip", "compare", "basestats", "1")
|
pfUI:UpdateConfig("tooltip", "compare", "basestats", "1")
|
||||||
@@ -1371,7 +1372,6 @@ function pfUI:MigrateConfig()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Remove "Show only own debuffs" from unitframes and nameplates
|
-- Remove "Show only own debuffs" from unitframes and nameplates
|
||||||
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
|
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
|
||||||
if pfUI_config.nameplates then
|
if pfUI_config.nameplates then
|
||||||
@@ -1387,5 +1387,17 @@ function pfUI:MigrateConfig()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI_config.version = pfUI.version.string
|
-- Stamp the version we've migrated to. Dev / git-cloned builds carry
|
||||||
|
-- "@project-version@" in the toc, which pfUI.lua normalizes to "dev" —
|
||||||
|
-- writing that here would have checkversion() parse it back as 0/0/0 on
|
||||||
|
-- the next /reload and re-fire every migration block, clobbering user
|
||||||
|
-- toggles (notably the >3.6.1 buff migration that rewrites
|
||||||
|
-- buffs.{buffs,debuffs,weapons} from the deprecated global.hide{,w}buff
|
||||||
|
-- knobs). Stamp a far-future sentinel instead so checkversion() can't
|
||||||
|
-- flip true again on subsequent loads.
|
||||||
|
if pfUI.version.string == "dev" then
|
||||||
|
pfUI_config.version = "999.999.999"
|
||||||
|
else
|
||||||
|
pfUI_config.version = pfUI.version.string
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+2
-3
@@ -1172,10 +1172,9 @@ function pfUI.api.CreateQuestionDialog(text, yes, no, editbox, onclose)
|
|||||||
local width = 200
|
local width = 200
|
||||||
|
|
||||||
-- delay the auto sizing, to make sure the font rendering happened
|
-- delay the auto sizing, to make sure the font rendering happened
|
||||||
question:SetScript("OnUpdate", function()
|
RunNextFrame(function()
|
||||||
if question.text:GetStringWidth() > width then width = question.text:GetStringWidth() end
|
if question.text:GetStringWidth() > width then width = question.text:GetStringWidth() end
|
||||||
question:SetWidth( width + 2*padding)
|
question:SetWidth(width + 2*padding)
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+17
-11
@@ -73,8 +73,8 @@ end
|
|||||||
|
|
||||||
local function BuffOnClick()
|
local function BuffOnClick()
|
||||||
if this:GetParent().label == "player" then
|
if this:GetParent().label == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HELPFUL")
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HELPFUL")
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -114,8 +114,8 @@ end
|
|||||||
|
|
||||||
local function DebuffOnClick()
|
local function DebuffOnClick()
|
||||||
if this:GetParent().label == "player" then
|
if this:GetParent().label == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HARMFUL")
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HARMFUL")
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -305,12 +305,12 @@ function pfUI.uf:UpdateVisibility()
|
|||||||
local id = self.cache_raid
|
local id = self.cache_raid
|
||||||
|
|
||||||
-- always show self in raidframes
|
-- always show self in raidframes
|
||||||
if not UnitInRaid("player") and GetNumPartyMembers() == 0 and C.unitframes.selfinraid == "1" and id == 1 then
|
if not IsInRaid() and IsInGroup() and C.unitframes.selfinraid == "1" and id == 1 then
|
||||||
self.id = ""
|
self.id = ""
|
||||||
self.label = "player"
|
self.label = "player"
|
||||||
|
|
||||||
-- use raidframes for groups
|
-- use raidframes for groups
|
||||||
elseif not UnitInRaid("player") and GetNumPartyMembers() > 0 and C.unitframes.raidforgroup == "1" then
|
elseif not IsInRaid() and IsInGroup() and C.unitframes.raidforgroup == "1" then
|
||||||
if id == 1 then
|
if id == 1 then
|
||||||
self.id = ""
|
self.id = ""
|
||||||
self.label = "player"
|
self.label = "player"
|
||||||
@@ -347,12 +347,12 @@ function pfUI.uf:UpdateVisibility()
|
|||||||
-- frame shall not be visible
|
-- frame shall not be visible
|
||||||
visibility = "hide"
|
visibility = "hide"
|
||||||
self.visible = nil
|
self.visible = nil
|
||||||
elseif C["unitframes"]["group"]["hide_in_raid"] == "1" and self.label and strsub(self.label,0,5) == "party" and UnitInRaid("player") then
|
elseif C["unitframes"]["group"]["hide_in_raid"] == "1" and self.label and strsub(self.label,0,5) == "party" and IsInRaid() then
|
||||||
-- hide group while in raid and option is set
|
-- hide group while in raid and option is set
|
||||||
visibility = "hide"
|
visibility = "hide"
|
||||||
self.visible = nil
|
self.visible = nil
|
||||||
elseif ( self.fname == "Group0" or self.fname == "PartyPet0" or self.fname == "Party0Target" )
|
elseif ( self.fname == "Group0" or self.fname == "PartyPet0" or self.fname == "Party0Target" )
|
||||||
and (GetNumPartyMembers() <= 0 or (C["unitframes"]["group"]["hide_in_raid"] == "1" and UnitInRaid("player"))) then
|
and (not IsInGroup() or (C["unitframes"]["group"]["hide_in_raid"] == "1" and IsInRaid())) then
|
||||||
-- hide self in group if solo or hide in raid is set
|
-- hide self in group if solo or hide in raid is set
|
||||||
visibility = "hide"
|
visibility = "hide"
|
||||||
self.visible = nil
|
self.visible = nil
|
||||||
@@ -1773,7 +1773,7 @@ function pfUI.uf:RefreshIndicators(unit)
|
|||||||
local unitstr = unit.label .. unit.id
|
local unitstr = unit.label .. unit.id
|
||||||
|
|
||||||
if unit.leaderIcon then -- Leader Icon
|
if unit.leaderIcon then -- Leader Icon
|
||||||
if unit.config.leadericon == "1" and UnitIsPartyLeader(unitstr) and ( GetNumPartyMembers() > 0 or GetNumRaidMembers() > 0 ) then
|
if unit.config.leadericon == "1" and UnitIsPartyLeader(unitstr) and IsInGroup() then
|
||||||
unit.leaderIcon:Show()
|
unit.leaderIcon:Show()
|
||||||
else
|
else
|
||||||
unit.leaderIcon:Hide()
|
unit.leaderIcon:Hide()
|
||||||
@@ -1902,6 +1902,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
end
|
end
|
||||||
if duration > 0 then
|
if duration > 0 then
|
||||||
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
|
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
elseif aura.duration > 0 then
|
elseif aura.duration > 0 then
|
||||||
local guid = UnitGUID(unitstr)
|
local guid = UnitGUID(unitstr)
|
||||||
@@ -1912,6 +1914,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
else
|
else
|
||||||
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
unit.buffs[i]:Hide()
|
unit.buffs[i]:Hide()
|
||||||
@@ -2005,7 +2009,11 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
end
|
end
|
||||||
if duration > 0 then
|
if duration > 0 then
|
||||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
if stacks > 1 then
|
if stacks > 1 then
|
||||||
@@ -2838,8 +2846,6 @@ function pfUI.uf:GetStatusValue(unit, pos)
|
|||||||
-- Use libhealth for mob health estimation (overrides Nampower/Standard)
|
-- Use libhealth for mob health estimation (overrides Nampower/Standard)
|
||||||
if pfUI.libhealth and pfUI.libhealth.enabled then
|
if pfUI.libhealth and pfUI.libhealth.enabled then
|
||||||
rhp, rhpmax = pfUI.libhealth:GetUnitHealth(unitstr)
|
rhp, rhpmax = pfUI.libhealth:GetUnitHealth(unitstr)
|
||||||
elseif unit.label == "target" and (MobHealth3 or MobHealthFrame) and MobHealth_GetTargetCurHP() then
|
|
||||||
rhp, rhpmax = MobHealth_GetTargetCurHP(), MobHealth_GetTargetMaxHP()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if config == "unit" then
|
if config == "unit" then
|
||||||
|
|||||||
Vendored
-2620
File diff suppressed because it is too large
Load Diff
Vendored
-2634
File diff suppressed because it is too large
Load Diff
Vendored
-2628
File diff suppressed because it is too large
Load Diff
Vendored
-2625
File diff suppressed because it is too large
Load Diff
Vendored
-2591
File diff suppressed because it is too large
Load Diff
Vendored
-2628
File diff suppressed because it is too large
Load Diff
Vendored
-2612
File diff suppressed because it is too large
Load Diff
+18
-20
@@ -44,15 +44,13 @@ if GetNampowerVersion then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Nampower startup check: show version info and ensure CVars are set.
|
-- Nampower startup check: show version info and ensure CVars are set.
|
||||||
-- Runs on first OnUpdate after PLAYER_ENTERING_WORLD to give Nampower time to initialize.
|
-- Runs the frame after PLAYER_ENTERING_WORLD so Nampower has finished initializing.
|
||||||
local nampowerCheckFrame = CreateFrame("Frame")
|
local nampowerCheckFrame = CreateFrame("Frame")
|
||||||
nampowerCheckFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
nampowerCheckFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
nampowerCheckFrame:SetScript("OnEvent", function()
|
nampowerCheckFrame:SetScript("OnEvent", function()
|
||||||
-- Defer to next frame so Nampower is fully initialized
|
this:UnregisterAllEvents()
|
||||||
this:SetScript("OnUpdate", function()
|
this:SetScript("OnEvent", nil)
|
||||||
this:SetScript("OnUpdate", nil)
|
RunNextFrame(function()
|
||||||
this:UnregisterAllEvents()
|
|
||||||
this:SetScript("OnEvent", nil)
|
|
||||||
|
|
||||||
if GetNampowerVersion then
|
if GetNampowerVersion then
|
||||||
local major, minor, patch = GetNampowerVersion()
|
local major, minor, patch = GetNampowerVersion()
|
||||||
@@ -427,7 +425,7 @@ local function GetDebuffSlotMap(guid)
|
|||||||
local spellId = auras[auraSlot]
|
local spellId = auras[auraSlot]
|
||||||
if spellId and spellId > 0 then
|
if spellId and spellId > 0 then
|
||||||
displaySlot = displaySlot + 1
|
displaySlot = displaySlot + 1
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
local texture = libdebuff:GetSpellIcon(spellId)
|
local texture = libdebuff:GetSpellIcon(spellId)
|
||||||
local stacks = (auraApps and auraApps[auraSlot] or 0) + 1
|
local stacks = (auraApps and auraApps[auraSlot] or 0) + 1
|
||||||
local dtype = nil
|
local dtype = nil
|
||||||
@@ -967,7 +965,7 @@ if hasNampower then
|
|||||||
-- Channel interrupted by player - clear ownDebuffs for the channeled spell
|
-- Channel interrupted by player - clear ownDebuffs for the channeled spell
|
||||||
-- via C_Spell.ChannelInfo. DEBUFF_REMOVED fires later (0.5-1s server lag),
|
-- via C_Spell.ChannelInfo. DEBUFF_REMOVED fires later (0.5-1s server lag),
|
||||||
-- causing phantom debuff display without this pre-clear.
|
-- causing phantom debuff display without this pre-clear.
|
||||||
local spellName = select(1, C_Spell.ChannelInfo())
|
local spellName = C_Spell.ChannelInfo()
|
||||||
if spellName then
|
if spellName then
|
||||||
local targetGuid = UnitGUID and UnitGUID("target")
|
local targetGuid = UnitGUID and UnitGUID("target")
|
||||||
if targetGuid and ownDebuffs[targetGuid] and ownDebuffs[targetGuid][spellName] then
|
if targetGuid and ownDebuffs[targetGuid] and ownDebuffs[targetGuid][spellName] then
|
||||||
@@ -1024,7 +1022,7 @@ if hasNampower then
|
|||||||
local targetGuid = arg4
|
local targetGuid = arg4
|
||||||
local numHit = arg6 or 0
|
local numHit = arg6 or 0
|
||||||
local numMissed = arg7 or 0
|
local numMissed = arg7 or 0
|
||||||
|
|
||||||
-- Fire registered SPELL_GO_SELF hooks BEFORE miss guard
|
-- Fire registered SPELL_GO_SELF hooks BEFORE miss guard
|
||||||
-- (Swingtimer needs to see ALL casts, even misses, for swing reset)
|
-- (Swingtimer needs to see ALL casts, even misses, for swing reset)
|
||||||
if event == "SPELL_GO_SELF" and pfUI.libdebuff_spell_go_hooks then
|
if event == "SPELL_GO_SELF" and pfUI.libdebuff_spell_go_hooks then
|
||||||
@@ -1035,15 +1033,15 @@ if hasNampower then
|
|||||||
|
|
||||||
if numMissed > 0 or numHit == 0 then return end
|
if numMissed > 0 or numHit == 0 then return end
|
||||||
|
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
local spellRankString = GetSpellRecField and GetSpellRecField(spellId, "rank")
|
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
|
local spellRankString = C_Spell.GetSpellSubtext(spellId)
|
||||||
|
|
||||||
local castRank = 0
|
local castRank = 0
|
||||||
if spellRankString and spellRankString ~= "" then
|
if spellRankString and spellRankString ~= "" then
|
||||||
castRank = tonumber((string.gsub(spellRankString, "Rank ", ""))) or 0
|
castRank = tonumber((string.gsub(spellRankString, "Rank ", ""))) or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Store in pendingCasts for DEBUFF_ADDED correlation.
|
-- Store in pendingCasts for DEBUFF_ADDED correlation.
|
||||||
-- If this cast is a downrank of an already active debuff, fire the downrank blocked hook
|
-- If this cast is a downrank of an already active debuff, fire the downrank blocked hook
|
||||||
-- so external addons (e.g. SuperCleveRoidMacros) don't need to re-implement this check.
|
-- so external addons (e.g. SuperCleveRoidMacros) don't need to re-implement this check.
|
||||||
@@ -1209,7 +1207,7 @@ if hasNampower then
|
|||||||
if not spellId then return end
|
if not spellId then return end
|
||||||
if not targetGuid or targetGuid == "" or targetGuid == "0x0000000000000000" then return end
|
if not targetGuid or targetGuid == "" or targetGuid == "0x0000000000000000" then return end
|
||||||
|
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
|
|
||||||
-- Deduplicate: Ignore if we processed this exact cast recently (within 100ms)
|
-- Deduplicate: Ignore if we processed this exact cast recently (within 100ms)
|
||||||
@@ -1469,7 +1467,7 @@ if hasNampower then
|
|||||||
|
|
||||||
-- Invalidate slot map cache for this GUID
|
-- Invalidate slot map cache for this GUID
|
||||||
|
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
|
|
||||||
if debugStats.enabled then
|
if debugStats.enabled then
|
||||||
@@ -1599,9 +1597,9 @@ if hasNampower then
|
|||||||
local auraSlot = auraSlot_0based and (auraSlot_0based + 1) or nil
|
local auraSlot = auraSlot_0based and (auraSlot_0based + 1) or nil
|
||||||
|
|
||||||
-- Invalidate slot map cache for this GUID
|
-- Invalidate slot map cache for this GUID
|
||||||
|
|
||||||
local spellName = (GetSpellRecField and GetSpellRecField(spellId, "name")) or "?"
|
local spellName = C_Spell.GetSpellName(spellId) or "?"
|
||||||
|
|
||||||
if debugStats.enabled then
|
if debugStats.enabled then
|
||||||
debugStats.debuff_removed = debugStats.debuff_removed + 1
|
debugStats.debuff_removed = debugStats.debuff_removed + 1
|
||||||
if IsCurrentTarget(guid) then
|
if IsCurrentTarget(guid) then
|
||||||
@@ -1609,13 +1607,13 @@ if hasNampower then
|
|||||||
GetDebugTimestamp(), displaySlot, auraSlot or -1, auraSlot_0based or -1, spellName))
|
GetDebugTimestamp(), displaySlot, auraSlot or -1, auraSlot_0based or -1, spellName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If unit is dead, cleanup all
|
-- If unit is dead, cleanup all
|
||||||
if UnitIsDead and UnitIsDead(guid) then
|
if UnitIsDead and UnitIsDead(guid) then
|
||||||
CleanupUnit(guid)
|
CleanupUnit(guid)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get auraSlot from event parameter (Nampower 2.29+)
|
-- Get auraSlot from event parameter (Nampower 2.29+)
|
||||||
-- Fallback to displayToAura mapping if not available
|
-- Fallback to displayToAura mapping if not available
|
||||||
local foundAuraSlot = auraSlot
|
local foundAuraSlot = auraSlot
|
||||||
|
|||||||
+32
-94
@@ -44,78 +44,13 @@ local healGuidToName = {} -- [casterGuid] = casterName, for SPELL_FAILED_OTHER c
|
|||||||
local ress_timers = {} -- [target][sender] = expiry_timestamp (60s rez window)
|
local ress_timers = {} -- [target][sender] = expiry_timestamp (60s rez window)
|
||||||
local RESS_TIMEOUT = 60 -- Vanilla: rez offer expires after 60s
|
local RESS_TIMEOUT = 60 -- Vanilla: rez offer expires after 60s
|
||||||
|
|
||||||
local PRAYER_OF_HEALING
|
-- Localized spell names resolved once from canonical rank-1 spellIDs.
|
||||||
do -- Prayer of Healing
|
-- Every rank shares the same name, so per-rank comparisons elsewhere can
|
||||||
local locales = {
|
-- be done against these constants without per-locale or per-rank tables.
|
||||||
["deDE"] = "Gebet der Heilung",
|
local PRAYER_OF_HEALING = C_Spell.GetSpellName(596) -- Prayer of Healing (Rank 1)
|
||||||
["enUS"] = "Prayer of Healing",
|
local REJUVENATION = C_Spell.GetSpellName(774) -- Rejuvenation (Rank 1)
|
||||||
["esES"] = "Rezo de curación",
|
local RENEW = C_Spell.GetSpellName(139) -- Renew (Rank 1)
|
||||||
["frFR"] = "Prière de soins",
|
local REGROWTH = C_Spell.GetSpellName(8936) -- Regrowth (Rank 1)
|
||||||
["koKR"] = "치유의 기원",
|
|
||||||
["ruRU"] = "Молитва исцеления",
|
|
||||||
["zhCN"] = "治疗祷言",
|
|
||||||
}
|
|
||||||
|
|
||||||
PRAYER_OF_HEALING = locales[GetLocale()] or locales["enUS"]
|
|
||||||
end
|
|
||||||
|
|
||||||
local REJUVENATION
|
|
||||||
do -- Rejuvenation
|
|
||||||
local locales = {
|
|
||||||
["deDE"] = "Verjüngung",
|
|
||||||
["enUS"] = "Rejuvenation",
|
|
||||||
["esES"] = "Rejuvenecimiento",
|
|
||||||
["frFR"] = "Récupération",
|
|
||||||
["koKR"] = "회복",
|
|
||||||
["ruRU"] = "Омоложение",
|
|
||||||
["zhCN"] = "回春术",
|
|
||||||
}
|
|
||||||
|
|
||||||
REJUVENATION = locales[GetLocale()] or locales["enUS"]
|
|
||||||
end
|
|
||||||
|
|
||||||
local RENEW
|
|
||||||
do -- Renew
|
|
||||||
local locales = {
|
|
||||||
["deDE"] = "Erneuerung",
|
|
||||||
["enUS"] = "Renew",
|
|
||||||
["esES"] = "Renovar",
|
|
||||||
["frFR"] = "Rénovation",
|
|
||||||
["koKR"] = "소생",
|
|
||||||
["ruRU"] = "Обновление",
|
|
||||||
["zhCN"] = "恢复",
|
|
||||||
}
|
|
||||||
|
|
||||||
RENEW = locales[GetLocale()] or locales["enUS"]
|
|
||||||
end
|
|
||||||
|
|
||||||
local REGROWTH
|
|
||||||
do -- Regrowth
|
|
||||||
local locales = {
|
|
||||||
["deDE"] = "Nachwachsen",
|
|
||||||
["enUS"] = "Regrowth",
|
|
||||||
["esES"] = "Recrecimiento",
|
|
||||||
["frFR"] = "Rétablissement",
|
|
||||||
["koKR"] = "재생",
|
|
||||||
["ruRU"] = "Восстановление",
|
|
||||||
["zhCN"] = "愈合",
|
|
||||||
}
|
|
||||||
|
|
||||||
REGROWTH = locales[GetLocale()] or locales["enUS"]
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- Spell IDs for SPELL_GO_SELF callback (Nampower) - Instant HoT detection
|
|
||||||
local SPELL_IDS = {
|
|
||||||
-- Rejuvenation (all ranks)
|
|
||||||
[774] = "Reju", [1058] = "Reju", [1430] = "Reju", [2090] = "Reju", [2091] = "Reju",
|
|
||||||
[3627] = "Reju", [8910] = "Reju", [9839] = "Reju", [9840] = "Reju", [9841] = "Reju",
|
|
||||||
[25299] = "Reju", [26981] = "Reju", [26982] = "Reju",
|
|
||||||
-- Renew (all ranks)
|
|
||||||
[139] = "Renew", [6074] = "Renew", [6075] = "Renew", [6076] = "Renew", [6077] = "Renew",
|
|
||||||
[6078] = "Renew", [10927] = "Renew", [10928] = "Renew", [10929] = "Renew", [25315] = "Renew",
|
|
||||||
[25221] = "Renew", [25222] = "Renew",
|
|
||||||
}
|
|
||||||
|
|
||||||
local libpredict = CreateFrame("Frame")
|
local libpredict = CreateFrame("Frame")
|
||||||
libpredict:RegisterEvent("UNIT_HEALTH")
|
libpredict:RegisterEvent("UNIT_HEALTH")
|
||||||
@@ -173,7 +108,7 @@ end
|
|||||||
|
|
||||||
local function isRezSpell(spellId)
|
local function isRezSpell(spellId)
|
||||||
if not L["resurrections"] then return false end
|
if not L["resurrections"] then return false end
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
return spellName and L["resurrections"][spellName]
|
return spellName and L["resurrections"][spellName]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -192,7 +127,7 @@ end)
|
|||||||
-- SPELL_START_SELF: own cast started (heals + rez)
|
-- SPELL_START_SELF: own cast started (heals + rez)
|
||||||
pfUI.libdebuff_spell_start_self_hooks = pfUI.libdebuff_spell_start_self_hooks or {}
|
pfUI.libdebuff_spell_start_self_hooks = pfUI.libdebuff_spell_start_self_hooks or {}
|
||||||
pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
|
pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
|
|
||||||
local pendingTarget = nil
|
local pendingTarget = nil
|
||||||
@@ -255,7 +190,7 @@ pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGu
|
|||||||
-- selfcast (ALT) = player, otherwise = current target
|
-- selfcast (ALT) = player, otherwise = current target
|
||||||
-- Use this to find the correct group to heal
|
-- Use this to find the correct group to heal
|
||||||
local pohTarget = target or player
|
local pohTarget = target or player
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
-- Raid: find pohTarget's subgroup and heal only those members
|
-- Raid: find pohTarget's subgroup and heal only those members
|
||||||
-- (Turtle WoW changed PoH to heal the target's group, not the caster's group)
|
-- (Turtle WoW changed PoH to heal the target's group, not the caster's group)
|
||||||
local targetGroup
|
local targetGroup
|
||||||
@@ -319,7 +254,7 @@ end
|
|||||||
-- SPELL_GO_SELF: own cast landed (HealStop + Regrowth timer)
|
-- SPELL_GO_SELF: own cast landed (HealStop + Regrowth timer)
|
||||||
pfUI.libdebuff_spell_go_hooks["libpredict_sender"] = function(spellId)
|
pfUI.libdebuff_spell_go_hooks["libpredict_sender"] = function(spellId)
|
||||||
libpredict:HealStop(player)
|
libpredict:HealStop(player)
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if spellName == REGROWTH then
|
if spellName == REGROWTH then
|
||||||
local now = pfUI.uf.now or GetTime()
|
local now = pfUI.uf.now or GetTime()
|
||||||
if libpredict.sender.regrowth_timer then
|
if libpredict.sender.regrowth_timer then
|
||||||
@@ -337,7 +272,7 @@ end
|
|||||||
-- Signature: fn(spellId, casterGuid, targetGuid, castTime)
|
-- Signature: fn(spellId, casterGuid, targetGuid, castTime)
|
||||||
pfUI.libdebuff_spell_start_other_hooks = pfUI.libdebuff_spell_start_other_hooks or {}
|
pfUI.libdebuff_spell_start_other_hooks = pfUI.libdebuff_spell_start_other_hooks or {}
|
||||||
pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
|
pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
|
|
||||||
local casterName = resolveNameFromGuid(casterGuid)
|
local casterName = resolveNameFromGuid(casterGuid)
|
||||||
@@ -364,7 +299,7 @@ pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterG
|
|||||||
|
|
||||||
-- Prayer of Healing: heal entire subgroup of the target
|
-- Prayer of Healing: heal entire subgroup of the target
|
||||||
if spellName == PRAYER_OF_HEALING then
|
if spellName == PRAYER_OF_HEALING then
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
local targetGroup
|
local targetGroup
|
||||||
for i = 1, GetNumRaidMembers() do
|
for i = 1, GetNumRaidMembers() do
|
||||||
local rname, _, subgroup = GetRaidRosterInfo(i)
|
local rname, _, subgroup = GetRaidRosterInfo(i)
|
||||||
@@ -404,8 +339,13 @@ end
|
|||||||
-- Signature: fn(spellId, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
-- Signature: fn(spellId, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||||
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
|
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
|
||||||
pfUI.libdebuff_spell_go_hooks["libpredict"] = function(spellId, a1, a2, a3, a4, a5, a6, a7)
|
pfUI.libdebuff_spell_go_hooks["libpredict"] = function(spellId, a1, a2, a3, a4, a5, a6, a7)
|
||||||
-- Instant HoTs
|
-- Instant HoTs — classify by name (rank-independent) instead of a
|
||||||
local hotType = SPELL_IDS[spellId]
|
-- hardcoded per-rank ID table.
|
||||||
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
|
local hotType
|
||||||
|
if spellName == REJUVENATION then hotType = "Reju"
|
||||||
|
elseif spellName == RENEW then hotType = "Renew"
|
||||||
|
end
|
||||||
if hotType then
|
if hotType then
|
||||||
local targetGuid = a4
|
local targetGuid = a4
|
||||||
local targetName = resolveNameFromGuid(targetGuid)
|
local targetName = resolveNameFromGuid(targetGuid)
|
||||||
@@ -426,9 +366,9 @@ pfUI.libdebuff_spell_go_hooks["libpredict"] = function(spellId, a1, a2, a3, a4,
|
|||||||
local rankStr = tostring(rank)
|
local rankStr = tostring(rank)
|
||||||
if libpredict.sender and libpredict.sender.SendHealCommMsg then
|
if libpredict.sender and libpredict.sender.SendHealCommMsg then
|
||||||
libpredict.sender:SendHealCommMsg(hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/")
|
libpredict.sender:SendHealCommMsg(hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/")
|
||||||
elseif GetNumRaidMembers() > 0 then
|
elseif IsInRaid() then
|
||||||
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "RAID")
|
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "RAID")
|
||||||
elseif GetNumPartyMembers() > 0 then
|
elseif IsInGroup() then
|
||||||
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "PARTY")
|
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "PARTY")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1019,8 +959,6 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
|||||||
if not libpredict.sender.enabled then return end
|
if not libpredict.sender.enabled then return end
|
||||||
local effect, rank = libspell.GetSpellInfo(effect)
|
local effect, rank = libspell.GetSpellInfo(effect)
|
||||||
if not effect then return end
|
if not effect then return end
|
||||||
local mouseover = pfUI and pfUI.uf and pfUI.uf.mouseover and pfUI.uf.mouseover.unit
|
|
||||||
mouseover = mouseover and UnitCanAssist("player", mouseover) and UnitName(mouseover)
|
|
||||||
|
|
||||||
local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
local default = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
||||||
|
|
||||||
@@ -1039,13 +977,13 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
|||||||
if not libpredict.sender.current_cast then
|
if not libpredict.sender.current_cast then
|
||||||
spell_queue[1] = effect
|
spell_queue[1] = effect
|
||||||
spell_queue[2] = effect.. ( rank or "" )
|
spell_queue[2] = effect.. ( rank or "" )
|
||||||
spell_queue[3] = target or mouseover or default
|
spell_queue[3] = target or default
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback
|
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback
|
||||||
|
|
||||||
if effect == REJUVENATION then
|
if effect == REJUVENATION then
|
||||||
local hotTarget = target or mouseover or default
|
local hotTarget = target or default
|
||||||
local now = pfUI.uf.now or GetTime()
|
local now = pfUI.uf.now or GetTime()
|
||||||
local key = "Reju" .. hotTarget
|
local key = "Reju" .. hotTarget
|
||||||
|
|
||||||
@@ -1062,7 +1000,7 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
|||||||
local rankStr = rankNum and tostring(rankNum) or "0"
|
local rankStr = rankNum and tostring(rankNum) or "0"
|
||||||
libpredict.sender:SendHealCommMsg("Reju/"..hotTarget.."/"..rejuvDuration.."/"..rankStr.."/")
|
libpredict.sender:SendHealCommMsg("Reju/"..hotTarget.."/"..rejuvDuration.."/"..rankStr.."/")
|
||||||
elseif effect == RENEW then
|
elseif effect == RENEW then
|
||||||
local hotTarget = target or mouseover or default
|
local hotTarget = target or default
|
||||||
local now = pfUI.uf.now or GetTime()
|
local now = pfUI.uf.now or GetTime()
|
||||||
local key = "Renew" .. hotTarget
|
local key = "Renew" .. hotTarget
|
||||||
|
|
||||||
@@ -1145,10 +1083,10 @@ libpredict.sender = CreateFrame("Frame", "pfPredictionSender", UIParent)
|
|||||||
libpredict.sender.enabled = true
|
libpredict.sender.enabled = true
|
||||||
libpredict.sender.SendHealCommMsg = function(self, msg)
|
libpredict.sender.SendHealCommMsg = function(self, msg)
|
||||||
-- Smart channel selection: Only send to relevant channel to avoid duplicates
|
-- Smart channel selection: Only send to relevant channel to avoid duplicates
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
-- In raid: Only send to RAID (includes all raid members)
|
-- In raid: Only send to RAID (includes all raid members)
|
||||||
SendAddonMessage("HealComm", msg, "RAID")
|
SendAddonMessage("HealComm", msg, "RAID")
|
||||||
elseif GetNumPartyMembers() > 0 then
|
elseif IsInGroup() then
|
||||||
-- In party: Only send to PARTY
|
-- In party: Only send to PARTY
|
||||||
SendAddonMessage("HealComm", msg, "PARTY")
|
SendAddonMessage("HealComm", msg, "PARTY")
|
||||||
end
|
end
|
||||||
@@ -1157,10 +1095,10 @@ libpredict.sender.SendHealCommMsg = function(self, msg)
|
|||||||
end
|
end
|
||||||
libpredict.sender.SendResCommMsg = function(self, msg)
|
libpredict.sender.SendResCommMsg = function(self, msg)
|
||||||
-- Smart channel selection: Only send to relevant channel to avoid duplicates
|
-- Smart channel selection: Only send to relevant channel to avoid duplicates
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
-- In raid: Only send to RAID (includes all raid members)
|
-- In raid: Only send to RAID (includes all raid members)
|
||||||
SendAddonMessage("CTRA", msg, "RAID")
|
SendAddonMessage("CTRA", msg, "RAID")
|
||||||
elseif GetNumPartyMembers() > 0 then
|
elseif IsInGroup() then
|
||||||
-- In party: Only send to PARTY
|
-- In party: Only send to PARTY
|
||||||
SendAddonMessage("CTRA", msg, "PARTY")
|
SendAddonMessage("CTRA", msg, "PARTY")
|
||||||
end
|
end
|
||||||
@@ -1236,7 +1174,7 @@ libpredict.sender:SetScript("OnEvent", function()
|
|||||||
local amount = arg4
|
local amount = arg4
|
||||||
local isCrit = arg5 == 1
|
local isCrit = arg5 == 1
|
||||||
local isPeriodic = arg6 == 1
|
local isPeriodic = arg6 == 1
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if spellName and spell_queue[1] == spellName then
|
if spellName and spell_queue[1] == spellName then
|
||||||
UpdateCache(spell_queue[2], amount, isCrit)
|
UpdateCache(spell_queue[2], amount, isCrit)
|
||||||
end
|
end
|
||||||
@@ -1256,9 +1194,9 @@ libpredict.sender:SetScript("OnEvent", function()
|
|||||||
local casterName = resolveNameFromGuid(casterGuid)
|
local casterName = resolveNameFromGuid(casterGuid)
|
||||||
if not casterName or casterName == player then return end -- own heals handled by SPELL_HEAL_BY_SELF
|
if not casterName or casterName == player then return end -- own heals handled by SPELL_HEAL_BY_SELF
|
||||||
|
|
||||||
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
|
local spellName = C_Spell.GetSpellName(spellId)
|
||||||
if not spellName then return end
|
if not spellName then return end
|
||||||
local rankStr = GetSpellRecField and GetSpellRecField(spellId, "rank") or ""
|
local rankStr = C_Spell.GetSpellSubtext(spellId)
|
||||||
local spellKey = spellName .. (rankStr or "")
|
local spellKey = spellName .. (rankStr or "")
|
||||||
|
|
||||||
foreignCache[casterName] = foreignCache[casterName] or {}
|
foreignCache[casterName] = foreignCache[casterName] or {}
|
||||||
|
|||||||
+4
-14
@@ -134,19 +134,9 @@ pfUI:RegisterModule("addoncompat", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- run the addonconflict queue when firstrun is ready
|
-- run the addonconflict queue when firstrun is ready
|
||||||
local delay = CreateFrame("Frame")
|
if pfUI.firstrun and pfUI.firstrun.completed then
|
||||||
delay:SetScript("OnUpdate", function()
|
|
||||||
-- throttle to to one query per .1 second
|
|
||||||
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end
|
|
||||||
|
|
||||||
-- make sure the firstrun dialog has finished
|
|
||||||
if pfUI.firstrun and pfUI.firstrun.steps then
|
|
||||||
for _, step in pairs(pfUI.firstrun.steps) do
|
|
||||||
if not pfUI_init[step.name] then return end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
RunQueue()
|
RunQueue()
|
||||||
this:SetScript("OnUpdate", nil)
|
else
|
||||||
end)
|
pfUI.events:RegisterCallback("firstrun:complete", RunQueue, "addoncompat")
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -19,12 +19,7 @@ pfUI:RegisterModule("autovendor", function ()
|
|||||||
local startGold = GetMoney()
|
local startGold = GetMoney()
|
||||||
C_MerchantFrame.SellAllJunkItems()
|
C_MerchantFrame.SellAllJunkItems()
|
||||||
|
|
||||||
local reporter = CreateFrame("Frame")
|
C_Timer.After(0.3, function()
|
||||||
reporter.deadline = GetTime() + 0.3
|
|
||||||
reporter:SetScript("OnUpdate", function()
|
|
||||||
if GetTime() < this.deadline then return end
|
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
this:Hide()
|
|
||||||
local income = GetMoney() - startGold
|
local income = GetMoney() - startGold
|
||||||
if income > 0 then
|
if income > 0 then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(income))
|
DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(income))
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,9 @@ pfUI:RegisterModule("bubbles", function ()
|
|||||||
pfUI.bubbles:RegisterEvent("CHAT_MSG_MONSTER_PARTY")
|
pfUI.bubbles:RegisterEvent("CHAT_MSG_MONSTER_PARTY")
|
||||||
|
|
||||||
pfUI.bubbles:SetScript("OnEvent", function()
|
pfUI.bubbles:SetScript("OnEvent", function()
|
||||||
pfUI.bubbles:SetScript("OnUpdate", pfUI.bubbles.ScanBubbles)
|
-- Bubble frames are attached to WorldFrame after the chat event fires,
|
||||||
|
-- so wait one tick before scanning.
|
||||||
|
RunNextFrame(function() pfUI.bubbles:ScanBubbles() end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function pfUI.bubbles:IsBubble(f)
|
function pfUI.bubbles:IsBubble(f)
|
||||||
@@ -66,7 +68,5 @@ pfUI:RegisterModule("bubbles", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.bubbles:SetScript("OnUpdate", nil)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
+3
-3
@@ -60,6 +60,7 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
buff.mode = buff.btype
|
buff.mode = buff.btype
|
||||||
buff.expirationTime = aura.expirationTime
|
buff.expirationTime = aura.expirationTime
|
||||||
buff.stackCount = aura.applications
|
buff.stackCount = aura.applications
|
||||||
|
buff.spellId = aura.spellId
|
||||||
buff.texture:SetTexture(aura.icon)
|
buff.texture:SetTexture(aura.icon)
|
||||||
|
|
||||||
if buff.btype == "HARMFUL" then
|
if buff.btype == "HARMFUL" then
|
||||||
@@ -146,9 +147,8 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
CancelItemTempEnchantment(1)
|
CancelItemTempEnchantment(1)
|
||||||
elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then
|
elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then
|
||||||
CancelItemTempEnchantment(2)
|
CancelItemTempEnchantment(2)
|
||||||
else
|
elseif this.spellId then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.btype)
|
C_Spell.CancelSpellByID(this.spellId)
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ pfUI:RegisterModule("buffwatch", function ()
|
|||||||
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."])
|
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."])
|
||||||
end
|
end
|
||||||
elseif this.parent.unit == "player" then
|
elseif this.parent.unit == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.type)
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, this.type)
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+125
-219
@@ -1,243 +1,149 @@
|
|||||||
pfUI:RegisterModule("eqcompare", function ()
|
pfUI:RegisterModule("eqcompare", function ()
|
||||||
local sides = { "Left", "Right" }
|
pfUI.eqcompare = {}
|
||||||
local loc = pfUI.cache["locale"]
|
|
||||||
for key, value in pairs(L["itemtypes"]) do setglobal(key, value) end
|
|
||||||
INVTYPE_WEAPON_OTHER = INVTYPE_WEAPON.."_other"
|
|
||||||
INVTYPE_FINGER_OTHER = INVTYPE_FINGER.."_other"
|
|
||||||
INVTYPE_TRINKET_OTHER = INVTYPE_TRINKET.."_other"
|
|
||||||
|
|
||||||
local function AddHeader(tooltip)
|
local function ShowCompareItem(self, link, shift)
|
||||||
local name = tooltip:GetName()
|
self = self or GameTooltip
|
||||||
|
|
||||||
-- shift all entries one line down
|
if not link or (not IsShiftKeyDown() and (C.tooltip.compare.showalways ~= "1" or C_Item.IsEquippedItem(link))) then
|
||||||
for i=tooltip:NumLines(), 1, -1 do
|
return
|
||||||
for _, side in pairs(sides) do
|
end
|
||||||
local current = _G[name.."Text"..side..i]
|
|
||||||
local below = _G[name.."Text"..side..i+1]
|
|
||||||
|
|
||||||
if current and current:IsShown() then
|
local shoppingTooltip1, shoppingTooltip2 = unpack(self.shoppingTooltips or { ShoppingTooltip1, ShoppingTooltip2 });
|
||||||
local text = current:GetText()
|
|
||||||
local r, g, b = current:GetTextColor()
|
|
||||||
|
|
||||||
if text and text ~= "" then
|
local SEPARATION = 6;
|
||||||
if tooltip:NumLines() < i+1 then
|
local backdrop = shoppingTooltip1.GetBackdrop and shoppingTooltip1:GetBackdrop();
|
||||||
-- add new line if required
|
local GAP = SEPARATION + ((type(backdrop) == "table" and backdrop.edgeSize) or 0);
|
||||||
tooltip:AddLine(text, r, g, b, true)
|
|
||||||
else
|
|
||||||
-- update existing lines
|
|
||||||
below:SetText(text)
|
|
||||||
below:SetTextColor(r, g, b)
|
|
||||||
below:Show()
|
|
||||||
|
|
||||||
-- hide processed line
|
local item1 = nil;
|
||||||
current:Hide()
|
local item2 = nil;
|
||||||
end
|
local side = "left";
|
||||||
end
|
if ( shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) ) then
|
||||||
end
|
item1 = true;
|
||||||
|
end
|
||||||
|
if ( shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self) ) then
|
||||||
|
item2 = true;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- find correct side
|
||||||
|
local rightDist = 0;
|
||||||
|
local leftPos = self:GetLeft();
|
||||||
|
local rightPos = self:GetRight();
|
||||||
|
if ( not rightPos ) then
|
||||||
|
rightPos = 0;
|
||||||
|
end
|
||||||
|
if ( not leftPos ) then
|
||||||
|
leftPos = 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
rightDist = GetScreenWidth() - rightPos;
|
||||||
|
|
||||||
|
if (leftPos and (rightDist < leftPos)) then
|
||||||
|
side = "left";
|
||||||
|
else
|
||||||
|
side = "right";
|
||||||
|
end
|
||||||
|
|
||||||
|
-- see if we should slide the tooltip
|
||||||
|
if ( self:GetAnchorType() and self:GetAnchorType() ~= "ANCHOR_PRESERVE" ) then
|
||||||
|
local totalWidth = 0;
|
||||||
|
if ( item1 ) then
|
||||||
|
totalWidth = totalWidth + shoppingTooltip1:GetWidth();
|
||||||
|
end
|
||||||
|
if ( item2 ) then
|
||||||
|
totalWidth = totalWidth + shoppingTooltip2:GetWidth();
|
||||||
|
end
|
||||||
|
|
||||||
|
if ( (side == "left") and (totalWidth > leftPos) ) then
|
||||||
|
self:SetAnchorType(self:GetAnchorType(), (totalWidth - leftPos), 0);
|
||||||
|
elseif ( (side == "right") and (rightPos + totalWidth) > GetScreenWidth() ) then
|
||||||
|
self:SetAnchorType(self:GetAnchorType(), -((rightPos + totalWidth) - GetScreenWidth()), 0);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add label to first line
|
if ( item1 ) then
|
||||||
_G[name.."TextLeft1"]:SetTextColor(.5, .5, .5, 1)
|
shoppingTooltip1:SetOwner(self, "ANCHOR_NONE");
|
||||||
_G[name.."TextLeft1"]:SetText(CURRENTLY_EQUIPPED)
|
shoppingTooltip1:ClearAllPoints();
|
||||||
_G[name.."TextLeft1"]:Show()
|
if ( side and side == "left" ) then
|
||||||
|
shoppingTooltip1:SetPoint("TOPRIGHT", self, "TOPLEFT", -GAP, -10);
|
||||||
|
else
|
||||||
|
shoppingTooltip1:SetPoint("TOPLEFT", self, "TOPRIGHT", GAP, -10);
|
||||||
|
end
|
||||||
|
shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self);
|
||||||
|
shoppingTooltip1:Show();
|
||||||
|
|
||||||
-- update tooltip sizes
|
if ( item2 ) then
|
||||||
tooltip:Show()
|
shoppingTooltip2:SetOwner(shoppingTooltip1, "ANCHOR_NONE");
|
||||||
|
shoppingTooltip2:ClearAllPoints();
|
||||||
|
if ( side and side == "left" ) then
|
||||||
|
shoppingTooltip2:SetPoint("TOPRIGHT", shoppingTooltip1, "TOPLEFT", -GAP, 0);
|
||||||
|
else
|
||||||
|
shoppingTooltip2:SetPoint("TOPLEFT", shoppingTooltip1, "TOPRIGHT", GAP, 0);
|
||||||
|
end
|
||||||
|
shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self);
|
||||||
|
shoppingTooltip2:Show();
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local slotTable = {
|
local prevMerchant = ShoppingTooltip1.SetMerchantCompareItem
|
||||||
[INVTYPE_2HWEAPON] = "MainHandSlot",
|
local function SetMerchantCompareItem(self, index, compareItem)
|
||||||
[INVTYPE_BODY] = "ShirtSlot",
|
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||||
[INVTYPE_CHEST] = "ChestSlot",
|
ShowCompareItem(nil, GetMerchantItemLink(index))
|
||||||
[INVTYPE_CLOAK] = "BackSlot",
|
return false
|
||||||
[INVTYPE_FEET] = "FeetSlot",
|
end
|
||||||
[INVTYPE_FINGER] = "Finger0Slot",
|
return prevMerchant and prevMerchant(self, index, compareItem)
|
||||||
[INVTYPE_FINGER_OTHER] = "Finger1Slot",
|
end
|
||||||
[INVTYPE_HAND] = "HandsSlot",
|
|
||||||
[INVTYPE_HEAD] = "HeadSlot",
|
|
||||||
[INVTYPE_HOLDABLE] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_LEGS] = "LegsSlot",
|
|
||||||
[INVTYPE_NECK] = "NeckSlot",
|
|
||||||
[INVTYPE_RANGED] = "RangedSlot",
|
|
||||||
[INVTYPE_RELIC] = "RangedSlot",
|
|
||||||
[INVTYPE_ROBE] = "ChestSlot",
|
|
||||||
[INVTYPE_SHIELD] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_SHOULDER] = "ShoulderSlot",
|
|
||||||
[INVTYPE_TABARD] = "TabardSlot",
|
|
||||||
[INVTYPE_TRINKET] = "Trinket0Slot",
|
|
||||||
[INVTYPE_TRINKET_OTHER] = "Trinket1Slot",
|
|
||||||
[INVTYPE_WAIST] = "WaistSlot",
|
|
||||||
[INVTYPE_WEAPON] = "MainHandSlot",
|
|
||||||
[INVTYPE_WEAPON_OTHER] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_WEAPONMAINHAND] = "MainHandSlot",
|
|
||||||
[INVTYPE_WEAPONOFFHAND] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_WRIST] = "WristSlot",
|
|
||||||
|
|
||||||
[INVTYPE_WAND] = "RangedSlot",
|
local prevAuction = ShoppingTooltip1.SetAuctionCompareItem
|
||||||
[INVTYPE_GUN] = "RangedSlot",
|
local function SetAuctionCompareItem(self, type, index, compareItem)
|
||||||
[INVTYPE_PROJECTILE] = "AmmoSlot",
|
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||||
[INVTYPE_CROSSBOW] = "RangedSlot",
|
ShowCompareItem(nil, GetAuctionItemLink(type, index))
|
||||||
[INVTYPE_THROWN] = "RangedSlot",
|
return false
|
||||||
|
end
|
||||||
|
return prevAuction and prevAuction(self, type, index, compareItem)
|
||||||
|
end
|
||||||
|
|
||||||
|
ShoppingTooltip1.SetMerchantCompareItem = SetMerchantCompareItem
|
||||||
|
ShoppingTooltip2.SetMerchantCompareItem = SetMerchantCompareItem
|
||||||
|
ShoppingTooltip1.SetAuctionCompareItem = SetAuctionCompareItem
|
||||||
|
ShoppingTooltip2.SetAuctionCompareItem = SetAuctionCompareItem
|
||||||
|
|
||||||
|
local TooltipHooks = {
|
||||||
|
SetLootRollItem = GetLootRollItemLink,
|
||||||
|
SetLootItem = GetLootSlotItemLink,
|
||||||
|
SetQuestLogItem = GetQuestLogItemLink,
|
||||||
|
SetQuestItem = GetQuestItemLink,
|
||||||
|
SetHyperlink = function(link) return link end,
|
||||||
|
SetBagItem = GetContainerItemLink,
|
||||||
|
SetInboxItem = GetInboxItemLink,
|
||||||
|
SetInventoryItem = GetInventoryItemLink,
|
||||||
|
SetTradeSkillItem = function(skillIndex, reagentIndex)
|
||||||
|
if reagentIndex then
|
||||||
|
return GetTradeSkillReagentItemLink(skillIndex, reagentIndex)
|
||||||
|
else
|
||||||
|
return GetTradeSkillItemLink(skillIndex)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
SetAuctionSellItem = GetAuctionSellItemLink,
|
||||||
|
SetTradePlayerItem = GetTradePlayerItemLink,
|
||||||
|
SetTradeTargetItem = GetTradeTargetItemLink
|
||||||
}
|
}
|
||||||
|
|
||||||
local function startsWith(str, start)
|
local function makeHook(getter)
|
||||||
return string.sub(str, 1, string.len(start)) == start
|
return function(tooltip, arg1, arg2, arg3)
|
||||||
end
|
if C.tooltip.compare.basestats == "1" then
|
||||||
|
ShowCompareItem(tooltip, getter(arg1, arg2, arg3))
|
||||||
local function ExtractAttributes(tooltip)
|
|
||||||
local name = tooltip:GetName()
|
|
||||||
|
|
||||||
-- get the name/header of the last set comparison tooltip
|
|
||||||
local comparetooltip = pfUI.eqcompare.tooltip:GetName()
|
|
||||||
local iname = _G[comparetooltip .. "TextLeft1"] and _G[comparetooltip .. "TextLeft1"]:GetText()
|
|
||||||
|
|
||||||
-- only run once per item
|
|
||||||
if tooltip.pfCompLastName == iname then return end
|
|
||||||
|
|
||||||
tooltip.pfCompData = {}
|
|
||||||
tooltip.pfCompLastName = iname
|
|
||||||
|
|
||||||
for i=1,30 do
|
|
||||||
local widget = _G[name.."TextLeft"..i]
|
|
||||||
if widget and widget:GetObjectType() == "FontString" then
|
|
||||||
local text = widget:GetText()
|
|
||||||
if text and not string.find(text, "-", 1, true) then
|
|
||||||
local start = 1
|
|
||||||
if startsWith(text, "\+") or startsWith(text, "\(") then start = 2 end
|
|
||||||
|
|
||||||
local space = string.find(text, " ", 1, true)
|
|
||||||
if space then
|
|
||||||
local value = tonumber(string.sub(text, start, space-1))
|
|
||||||
if value and text then
|
|
||||||
-- we've found an attr
|
|
||||||
local attr = string.sub(text, space, string.len(text))
|
|
||||||
tooltip.pfCompData[attr] = { value = tonumber(value), widget = widget }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function CompareAttributes(data, targetData)
|
local function HookTooltip(tooltip)
|
||||||
if not data then return end
|
for setter, getter in pairs(TooltipHooks) do
|
||||||
|
_G['hooksecurefunc'](tooltip, setter, makeHook(getter))
|
||||||
for attr,v in pairs(data) do
|
|
||||||
if targetData then
|
|
||||||
local target = targetData[attr]
|
|
||||||
if target then
|
|
||||||
if v.value ~= target.value and v.widget:GetText() then
|
|
||||||
if v.value > target.value then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cff88ff88 (+" .. round(v.value - target.value, 1) .. ")")
|
|
||||||
end
|
|
||||||
elseif not v.widget.compSet then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cffff8888 (-" .. round(target.value - v.value, 1) .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
target.processed = true
|
|
||||||
else
|
|
||||||
target.processed = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- this attribute doesnt exist in target
|
|
||||||
if v.widget and v.widget:GetText() then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cff88ff88 (+" .. v.value .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,target in pairs(targetData) do
|
|
||||||
if target and not target.processed then
|
|
||||||
-- we are an extra value
|
|
||||||
local text = target.widget:GetText()
|
|
||||||
if text and not strfind(text, "|cff88ff88") and not strfind(text, "|cffff8888") then
|
|
||||||
target.widget:SetText(text .. "|cff88ff88 (+" .. target.value .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.eqcompare = {}
|
HookTooltip(GameTooltip)
|
||||||
pfUI.eqcompare.GameTooltipShow = function()
|
|
||||||
-- use this tooltip for the next comparison
|
|
||||||
pfUI.eqcompare.tooltip = this
|
|
||||||
|
|
||||||
if not IsShiftKeyDown() and C.tooltip.compare.showalways ~= "1" then return end
|
pfUI.eqcompare.HookTooltip = HookTooltip
|
||||||
local rawborder, border = GetBorderSize()
|
|
||||||
|
|
||||||
for i=1,this:NumLines() do
|
|
||||||
local tmpText = _G[this:GetName() .. "TextLeft"..i]
|
|
||||||
for slotType, slotName in pairs(slotTable) do
|
|
||||||
if tmpText:GetText() == slotType then
|
|
||||||
local slotID = GetInventorySlotInfo(slotTable[slotType])
|
|
||||||
|
|
||||||
-- determine screen part
|
|
||||||
local ltrigger = GetScreenWidth() / 2
|
|
||||||
local x = GetCursorPosition()
|
|
||||||
x = x / UIParent:GetEffectiveScale()
|
|
||||||
if x > ltrigger then ltrigger = nil end
|
|
||||||
|
|
||||||
-- first tooltip
|
|
||||||
ShoppingTooltip1:SetOwner(this, "ANCHOR_NONE")
|
|
||||||
ShoppingTooltip1:ClearAllPoints()
|
|
||||||
|
|
||||||
if ltrigger then
|
|
||||||
ShoppingTooltip1:SetPoint("BOTTOMLEFT", this, "BOTTOMRIGHT", 0, 0)
|
|
||||||
else
|
|
||||||
ShoppingTooltip1:SetPoint("BOTTOMRIGHT", this, "BOTTOMLEFT", -border*2-1, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
ShoppingTooltip1:SetInventoryItem("player", slotID)
|
|
||||||
ShoppingTooltip1:Show()
|
|
||||||
AddHeader(ShoppingTooltip1)
|
|
||||||
|
|
||||||
-- second tooltip
|
|
||||||
if slotTable[slotType .. "_other"] then
|
|
||||||
local slotID_other = GetInventorySlotInfo(slotTable[slotType .. "_other"])
|
|
||||||
|
|
||||||
ShoppingTooltip2:SetOwner(this, "ANCHOR_NONE")
|
|
||||||
ShoppingTooltip2:ClearAllPoints()
|
|
||||||
|
|
||||||
if ltrigger then
|
|
||||||
ShoppingTooltip2:SetPoint("BOTTOMLEFT", ShoppingTooltip1, "BOTTOMRIGHT", 0, 0)
|
|
||||||
else
|
|
||||||
ShoppingTooltip2:SetPoint("BOTTOMRIGHT", ShoppingTooltip1, "BOTTOMLEFT", -border*2-1, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
ShoppingTooltip2:SetInventoryItem("player", slotID_other)
|
|
||||||
ShoppingTooltip2:Show()
|
|
||||||
AddHeader(ShoppingTooltip2)
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- add HookScript method if not already existing
|
|
||||||
GameTooltip.HookScript = GameTooltip.HookScript or HookScript
|
|
||||||
ShoppingTooltip1.HookScript = ShoppingTooltip1.HookScript or HookScript
|
|
||||||
ShoppingTooltip2.HookScript = ShoppingTooltip2.HookScript or HookScript
|
|
||||||
|
|
||||||
pfUI.eqcompare.ShoppingTooltipShow = function()
|
|
||||||
-- abort if no comparison tooltip has been set
|
|
||||||
if not pfUI.eqcompare.tooltip then return end
|
|
||||||
|
|
||||||
ExtractAttributes(this)
|
|
||||||
ExtractAttributes(pfUI.eqcompare.tooltip)
|
|
||||||
CompareAttributes(pfUI.eqcompare.tooltip.pfCompData, this.pfCompData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add Gametooltip Hooks
|
|
||||||
GameTooltip:HookScript("OnShow", pfUI.eqcompare.GameTooltipShow)
|
|
||||||
if C.tooltip.compare.basestats == "1" then
|
|
||||||
ShoppingTooltip1:HookScript("OnShow", pfUI.eqcompare.ShoppingTooltipShow)
|
|
||||||
ShoppingTooltip2:HookScript("OnShow", pfUI.eqcompare.ShoppingTooltipShow)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ pfUI:RegisterModule("firstrun", function ()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.completed then
|
||||||
|
self.completed = true
|
||||||
|
pfUI.events:TriggerEvent("firstrun:complete")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- main function to create wizard windows
|
-- main function to create wizard windows
|
||||||
|
|||||||
+1
-3
@@ -50,10 +50,8 @@ function SlashCmdList.PFFOCUSNAME(msg)
|
|||||||
FocusUnit("target")
|
FocusUnit("target")
|
||||||
end
|
end
|
||||||
|
|
||||||
local restore = CreateFrame("Frame")
|
RunNextFrame(function()
|
||||||
restore:SetScript("OnUpdate", function()
|
|
||||||
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
||||||
restore:SetScript("OnUpdate", nil)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if prevGUID and prevGUID ~= "0x0000000000000000" then
|
if prevGUID and prevGUID ~= "0x0000000000000000" then
|
||||||
|
|||||||
+23
-6
@@ -212,6 +212,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if not this:GetParent():IsShown() then
|
if not this:GetParent():IsShown() then
|
||||||
category[config] = r .. "," .. g .. "," .. b .. "," .. a
|
category[config] = r .. "," .. g .. "," .. b .. "," .. a
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -278,6 +279,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if this:GetText() ~= this:GetParent().category[this:GetParent().config] then
|
if this:GetText() ~= this:GetParent().category[this:GetParent().config] then
|
||||||
this:GetParent().category[this:GetParent().config] = this:GetText()
|
this:GetParent().category[this:GetParent().config] = this:GetText()
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
this:SetTextColor(.2,1,.8,1)
|
this:SetTextColor(.2,1,.8,1)
|
||||||
else
|
else
|
||||||
@@ -328,6 +330,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if category[config] == "1" then frame.input:SetChecked() end
|
if category[config] == "1" then frame.input:SetChecked() end
|
||||||
@@ -360,6 +363,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if category and category[config] ~= value then
|
if category and category[config] ~= value then
|
||||||
category[config] = value
|
category[config] = value
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -394,6 +398,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
end
|
end
|
||||||
category[config] = newconf
|
category[config] = newconf
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
frame.input:UpdateMenu()
|
frame.input:UpdateMenu()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -409,6 +414,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateQuestionDialog(T["New entry:"], function()
|
CreateQuestionDialog(T["New entry:"], function()
|
||||||
category[config] = category[config] .. "#" .. this:GetParent().input:GetText()
|
category[config] = category[config] .. "#" .. this:GetParent().input:GetText()
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
frame.input:UpdateMenu()
|
frame.input:UpdateMenu()
|
||||||
end, false, true)
|
end, false, true)
|
||||||
end)
|
end)
|
||||||
@@ -2380,11 +2386,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
|
|
||||||
if c == "player" then
|
if c == "player" then
|
||||||
CreateConfig(nil, T["Player SP/Haste Display"], nil, nil, "header")
|
CreateConfig(nil, T["Player SP/Haste Display"], nil, nil, "header")
|
||||||
CreateConfig(nil, T["Haste Display"], C.unitframes[c], "display_haste", "dropdown", {
|
CreateConfig(nil, T["Haste Display"], C.unitframes[c], "display_haste", "checkbox")
|
||||||
"0:"..T["None"],
|
|
||||||
"1:"..T["Haste (cast speed increase)"],
|
|
||||||
"2:"..T["Effective Haste (Haste * cast time reduction)"], -- Only affects mages/warlocks I believe
|
|
||||||
})
|
|
||||||
CreateConfig(nil, T["Haste Display Color"], C.unitframes[c], "display_haste_color", "color")
|
CreateConfig(nil, T["Haste Display Color"], C.unitframes[c], "display_haste_color", "color")
|
||||||
CreateConfig(nil, T["Display Spell Power"], C.unitframes[c], "display_spellpower", "checkbox")
|
CreateConfig(nil, T["Display Spell Power"], C.unitframes[c], "display_spellpower", "checkbox")
|
||||||
CreateConfig(nil, T["Use Custom Spell Power Color (unchecked = biggest school color)"], C.unitframes[c], "display_sp_color_override", "checkbox")
|
CreateConfig(nil, T["Use Custom Spell Power Color (unchecked = biggest school color)"], C.unitframes[c], "display_sp_color_override", "checkbox")
|
||||||
@@ -2749,10 +2751,25 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateConfig(nil, T["Enable Extended Guild Information"], C.tooltip, "extguild", "checkbox")
|
CreateConfig(nil, T["Enable Extended Guild Information"], C.tooltip, "extguild", "checkbox")
|
||||||
CreateConfig(nil, T["Always Show Health In Percent"], C.tooltip, "alwaysperc", "checkbox")
|
CreateConfig(nil, T["Always Show Health In Percent"], C.tooltip, "alwaysperc", "checkbox")
|
||||||
CreateConfig(nil, T["Show Item IDs"], C.tooltip, "itemid", "checkbox")
|
CreateConfig(nil, T["Show Item IDs"], C.tooltip, "itemid", "checkbox")
|
||||||
|
CreateConfig(nil, T["Show Movement Speed"], C.tooltip, "movespeed", "checkbox")
|
||||||
CreateConfig(nil, T["Custom Transparency"], C.tooltip, "alpha")
|
CreateConfig(nil, T["Custom Transparency"], C.tooltip, "alpha")
|
||||||
CreateConfig(nil, T["Status Bar Texture"], C.tooltip.statusbar, "texture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
CreateConfig(nil, T["Status Bar Texture"], C.tooltip.statusbar, "texture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
||||||
CreateConfig(nil, T["Compare Item Base Stats"], C.tooltip.compare, "basestats", "checkbox")
|
CreateConfig(nil, T["Compare Item Base Stats"], C.tooltip.compare, "basestats", "checkbox")
|
||||||
CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "showalways", "checkbox")
|
local showAlways = CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "showalways", "checkbox")
|
||||||
|
local function gate()
|
||||||
|
local on = C.tooltip.compare.basestats == "1"
|
||||||
|
if on then
|
||||||
|
showAlways.input:Enable()
|
||||||
|
showAlways.caption:SetTextColor(1, 1, 1)
|
||||||
|
else
|
||||||
|
showAlways.input:Disable()
|
||||||
|
showAlways.caption:SetTextColor(0.5, 0.5, 0.5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
gate()
|
||||||
|
pfUI.events:RegisterCallback("config:changed", function(_, cat, key)
|
||||||
|
if cat == C.tooltip.compare and key == "basestats" then gate() end
|
||||||
|
end, "eqcompare-showalways-gate")
|
||||||
CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "showalways", "checkbox")
|
CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "showalways", "checkbox")
|
||||||
CreateConfig(U["questitem"], T["Show Related Quest On Questitems"], C.tooltip.questitem, "showquest", "checkbox")
|
CreateConfig(U["questitem"], T["Show Related Quest On Questitems"], C.tooltip.questitem, "showquest", "checkbox")
|
||||||
CreateConfig(U["questitem"], T["Show Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox")
|
CreateConfig(U["questitem"], T["Show Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox")
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ pfUI:RegisterModule("innervatecall", function ()
|
|||||||
return "BATTLEGROUND"
|
return "BATTLEGROUND"
|
||||||
end
|
end
|
||||||
|
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
return "RAID"
|
return "RAID"
|
||||||
end
|
end
|
||||||
|
|
||||||
if GetNumPartyMembers() > 0 then
|
if IsInGroup() then
|
||||||
return "PARTY"
|
return "PARTY"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -96,14 +96,10 @@ pfUI:RegisterModule("innervatecall", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local readyAt = GetTime() + cdRemaining
|
C_Timer.After(cdRemaining, function()
|
||||||
frame:SetScript("OnUpdate", function()
|
local ch = GetAnnounceChannel()
|
||||||
if GetTime() >= readyAt then
|
if ch then
|
||||||
frame:SetScript("OnUpdate", nil)
|
SendChatMessage(">> Innervate is ready <<", ch)
|
||||||
local ch = GetAnnounceChannel()
|
|
||||||
if ch then
|
|
||||||
SendChatMessage(">> Innervate is ready <<", ch)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
+1
-1
@@ -323,7 +323,7 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pfUI.loot:InitGroupDropDown()
|
function pfUI.loot:InitGroupDropDown()
|
||||||
local inRaid = UnitInRaid("player")
|
local inRaid = IsInRaid()
|
||||||
if UIDROPDOWNMENU_MENU_LEVEL == 1 then
|
if UIDROPDOWNMENU_MENU_LEVEL == 1 then
|
||||||
if ( inRaid ) then
|
if ( inRaid ) then
|
||||||
pfUI.loot:BuildRaidMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
pfUI.loot:BuildRaidMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
||||||
|
|||||||
@@ -66,9 +66,5 @@ pfUI:RegisterModule("macrotweak", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- Check conflicts after one tick so all addons have finished loading
|
-- Check conflicts after one tick so all addons have finished loading
|
||||||
local watcher = CreateFrame("Frame")
|
RunNextFrame(CheckConflicts)
|
||||||
watcher:SetScript("OnUpdate", function()
|
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
CheckConflicts()
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
@@ -50,7 +50,7 @@ pfUI:RegisterModule("mapcolors", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateUnitFrames(unit_button_name)
|
local function UpdateUnitFrames(unit_button_name)
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
for i=1, MAX_RAID_MEMBERS do
|
for i=1, MAX_RAID_MEMBERS do
|
||||||
local frame_name = unit_button_name.."Raid"..i
|
local frame_name = unit_button_name.."Raid"..i
|
||||||
local frame = _G[frame_name]
|
local frame = _G[frame_name]
|
||||||
@@ -68,7 +68,7 @@ pfUI:RegisterModule("mapcolors", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif GetNumPartyMembers() > 0 then
|
elseif IsInGroup() then
|
||||||
for i=1, MAX_PARTY_MEMBERS do
|
for i=1, MAX_PARTY_MEMBERS do
|
||||||
local frame_name = unit_button_name.."Party"..i
|
local frame_name = unit_button_name.."Party"..i
|
||||||
local frame = _G[frame_name]
|
local frame = _G[frame_name]
|
||||||
|
|||||||
+9
-75
@@ -1,39 +1,6 @@
|
|||||||
pfUI:RegisterModule("mouseover", function ()
|
pfUI:RegisterModule("mouseover", function ()
|
||||||
pfUI.uf.mouseover = CreateFrame("Frame", "pfMouseOver", UIParent)
|
|
||||||
|
|
||||||
-- Prepare a list of units that can be used via SpellTargetUnit
|
|
||||||
local st_units = { [1] = "player", [2] = "target", [3] = "mouseover" }
|
|
||||||
for i=1, MAX_PARTY_MEMBERS do table.insert(st_units, "party"..i) end
|
|
||||||
for i=1, MAX_RAID_MEMBERS do table.insert(st_units, "raid"..i) end
|
|
||||||
|
|
||||||
-- Try to find a valid (friendly) unitstring that can be used for
|
|
||||||
-- SpellTargetUnit(unit) to avoid another target switch
|
|
||||||
local function GetUnitString(unit)
|
|
||||||
for index, unitstr in pairs(st_units) do
|
|
||||||
if UnitIsUnit(unit, unitstr) then
|
|
||||||
return unitstr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Same as CastSpellByName but with disabled AutoSelfCast
|
|
||||||
local function NoSelfCast(spell, onself)
|
|
||||||
local cvar_selfcast = GetCVar("AutoSelfCast")
|
|
||||||
|
|
||||||
if cvar_selfcast ~= "0" then
|
|
||||||
SetCVar("AutoSelfCast", "0")
|
|
||||||
pcall(CastSpellByName, spell, onself)
|
|
||||||
SetCVar("AutoSelfCast", cvar_selfcast)
|
|
||||||
else
|
|
||||||
CastSpellByName(spell, onself)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
_G.SLASH_PFCAST1, _G.SLASH_PFCAST2 = "/pfcast", "/pfmouse"
|
_G.SLASH_PFCAST1, _G.SLASH_PFCAST2 = "/pfcast", "/pfmouse"
|
||||||
function SlashCmdList.PFCAST(msg)
|
function SlashCmdList.PFCAST(msg)
|
||||||
local restore_target = true
|
|
||||||
local func = pfUI.api.TryMemoizedFuncLoadstringForSpellCasts(msg)
|
local func = pfUI.api.TryMemoizedFuncLoadstringForSpellCasts(msg)
|
||||||
local unit = "mouseover"
|
local unit = "mouseover"
|
||||||
|
|
||||||
@@ -50,51 +17,18 @@ pfUI:RegisterModule("mouseover", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Nampower: CastSpellByName supports a second unit parameter directly.
|
-- Spell-name path: Nampower's CastSpellByName takes a second unit
|
||||||
-- unit is already resolved to "mouseover", "target" or "player" at this point.
|
-- parameter directly, no target swap dance required.
|
||||||
if not func and GetNampowerVersion then
|
if not func then
|
||||||
CastSpellByName(msg, unit)
|
CastSpellByName(msg, unit)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If target and mouseover are friendly units, we can't use spell target as it
|
-- Macro path: switch target so the macro's spell calls land on `unit`,
|
||||||
-- would cast on the target instead of the mouseover. However, if the mouseover
|
-- then restore.
|
||||||
-- is friendly and the target is not, we can try to obtain the best unitstring
|
local restore_target = not UnitIsUnit("target", unit)
|
||||||
-- for the later SpellTargetUnit() call.
|
if restore_target then TargetUnit(unit) end
|
||||||
local unitstr = not UnitCanAssist("player", "target") and UnitCanAssist("player", unit) and GetUnitString(unit)
|
func()
|
||||||
|
if restore_target then TargetLastTarget() end
|
||||||
if UnitIsUnit("target", unit) or (not func and unitstr) then
|
|
||||||
-- no target change required, we can either use spell target
|
|
||||||
-- or the unit is already our current target.
|
|
||||||
restore_target = false
|
|
||||||
else
|
|
||||||
-- The spelltarget can't be used here, we need to switch
|
|
||||||
-- and restore the target during spell cast
|
|
||||||
TargetUnit(unit)
|
|
||||||
end
|
|
||||||
|
|
||||||
if func then
|
|
||||||
func()
|
|
||||||
else
|
|
||||||
-- write temporary unit name
|
|
||||||
pfUI.uf.mouseover.unit = unit
|
|
||||||
|
|
||||||
-- cast without self cast cvar setting
|
|
||||||
-- to allow spells to use spelltarget
|
|
||||||
NoSelfCast(msg)
|
|
||||||
|
|
||||||
-- set spell target to unitstring (or selfcast)
|
|
||||||
if SpellIsTargeting() then SpellTargetUnit(unitstr or "player") end
|
|
||||||
|
|
||||||
-- clean up spell target in error case
|
|
||||||
if SpellIsTargeting() then SpellStopTargeting() end
|
|
||||||
|
|
||||||
-- remove temporary mouseover unit
|
|
||||||
pfUI.uf.mouseover.unit = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if restore_target then
|
|
||||||
TargetLastTarget()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -937,10 +937,15 @@ end
|
|||||||
-- name — name alone misses pool reuse between same-named units (e.g. plate
|
-- name — name alone misses pool reuse between same-named units (e.g. plate
|
||||||
-- held a player "Ironforge Guard" and is now reassigned to the NPC by the
|
-- held a player "Ironforge Guard" and is now reassigned to the NPC by the
|
||||||
-- same name), which would leak a stale "PLAYER" hint into GetUnitInfo.
|
-- same name), which would leak a stale "PLAYER" hint into GetUnitInfo.
|
||||||
|
-- Wipe the whole cache table: the PERF gates below ("only update X when
|
||||||
|
-- X changed") would otherwise skip bar/color/text updates when the new
|
||||||
|
-- unit happens to share a cached value with the previous occupant
|
||||||
|
-- (e.g., both at 60% HP percentage on plate pool reuse → bar stays at
|
||||||
|
-- the old fill until the new mob actually changes HP).
|
||||||
if plate.cache.name ~= name or plate.cache.guid ~= plate.cachedGuid then
|
if plate.cache.name ~= name or plate.cache.guid ~= plate.cachedGuid then
|
||||||
|
table.wipe(plate.cache)
|
||||||
plate.cache.name = name
|
plate.cache.name = name
|
||||||
plate.cache.guid = plate.cachedGuid
|
plate.cache.guid = plate.cachedGuid
|
||||||
plate.cache.player = nil
|
|
||||||
plate.cdCache = nil -- new unit, reset spell-keyed timer cache
|
plate.cdCache = nil -- new unit, reset spell-keyed timer cache
|
||||||
plate.name:SetText(GetNameString(name))
|
plate.name:SetText(GetNameString(name))
|
||||||
end
|
end
|
||||||
@@ -987,12 +992,6 @@ end
|
|||||||
-- remove unitstr on unit name mismatch
|
-- remove unitstr on unit name mismatch
|
||||||
if unitstr and UnitName(unitstr) ~= name then unitstr = nil end
|
if unitstr and UnitName(unitstr) ~= name then unitstr = nil end
|
||||||
|
|
||||||
-- use mobhealth values if addon is running
|
|
||||||
if (MobHealth3 or MobHealthFrame) and target and name == UnitName('target') and MobHealth_GetTargetCurHP() then
|
|
||||||
hp = MobHealth_GetTargetCurHP() > 0 and MobHealth_GetTargetCurHP() or hp
|
|
||||||
hpmax = MobHealth_GetTargetMaxHP() > 0 and MobHealth_GetTargetMaxHP() or hpmax
|
|
||||||
end
|
|
||||||
|
|
||||||
-- always make sure to keep plate visible
|
-- always make sure to keep plate visible
|
||||||
plate:Show()
|
plate:Show()
|
||||||
|
|
||||||
|
|||||||
+16
-49
@@ -38,38 +38,6 @@ pfUI:RegisterModule("player", function ()
|
|||||||
playerFrame.myclass = myclass
|
playerFrame.myclass = myclass
|
||||||
playerFrame.isSpellCaster = myclass ~= "WARRIOR" and myclass ~= "ROGUE" and myclass ~= "HUNTER"
|
playerFrame.isSpellCaster = myclass ~= "WARRIOR" and myclass ~= "ROGUE" and myclass ~= "HUNTER"
|
||||||
|
|
||||||
-- Compute class-based casting speed modifier and cache on the frame.
|
|
||||||
-- This is re-evaluated on LEARNED_SPELL_IN_TAB (with 1s delay) so talent changes are handled.
|
|
||||||
-- Not sure if there are any other effects that give % cast reduction time
|
|
||||||
local function UpdatePlayerModCastingTime()
|
|
||||||
playerFrame.modCastingTime = 1
|
|
||||||
if myclass == "MAGE" then
|
|
||||||
local _, _, _, _, acceleratedArcana = GetTalentInfo(1, 16)
|
|
||||||
if acceleratedArcana and acceleratedArcana > 0 then
|
|
||||||
playerFrame.modCastingTime = 0.95
|
|
||||||
end
|
|
||||||
elseif myclass == "WARLOCK" then
|
|
||||||
local _, _, _, _, rapidDeter = GetTalentInfo(1, 14)
|
|
||||||
if rapidDeter and rapidDeter > 0 then
|
|
||||||
playerFrame.modCastingTime = 1 - (rapidDeter * 0.03)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local talentFrame = CreateFrame("Frame")
|
|
||||||
talentFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
|
||||||
talentFrame:RegisterEvent("LEARNED_SPELL_IN_TAB")
|
|
||||||
talentFrame:SetScript("OnEvent", function()
|
|
||||||
-- Delay 1s for both PLAYER_ENTERING_WORLD and LEARNED_SPELL_IN_TAB
|
|
||||||
local checkAt = GetTime() + 1
|
|
||||||
talentFrame:SetScript("OnUpdate", function()
|
|
||||||
if GetTime() >= checkAt then
|
|
||||||
talentFrame:SetScript("OnUpdate", nil)
|
|
||||||
UpdatePlayerModCastingTime()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Convert "r,g,b,a" config color string to a 6-char hex string, or nil if unset
|
-- Convert "r,g,b,a" config color string to a 6-char hex string, or nil if unset
|
||||||
local function cfgColorToHex(colorStr)
|
local function cfgColorToHex(colorStr)
|
||||||
if not colorStr or colorStr == "" then return nil end
|
if not colorStr or colorStr == "" then return nil end
|
||||||
@@ -98,26 +66,25 @@ pfUI:RegisterModule("player", function ()
|
|||||||
if not cfg then
|
if not cfg then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local hasteMode = cfg.display_haste -- "0"=none, "1"=modCastSpeed, "2"=modCastSpeed*modCastingTime
|
-- display_haste: "0"=hidden, "1"=show modCastSpeed (gear haste). Talent-
|
||||||
|
-- side cast-time reductions show up in the actual cast bar via
|
||||||
|
-- C_Spell.UnitCastingInfo; double-folding them into this overlay was
|
||||||
|
-- mixing two different concepts into one number.
|
||||||
|
local showHaste = cfg.display_haste == "1"
|
||||||
local showSP = cfg.display_spellpower == "1"
|
local showSP = cfg.display_spellpower == "1"
|
||||||
|
|
||||||
local isSpellCaster = playerFrame.isSpellCaster
|
local isSpellCaster = playerFrame.isSpellCaster
|
||||||
if (hasteMode == "0" or not isSpellCaster) and not showSP then
|
if (not showHaste or not isSpellCaster) and not showSP then
|
||||||
playerFrame.infoTopCenterText:SetText("")
|
playerFrame.infoTopCenterText:SetText("")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local haste = GetUnitField("player", "modCastSpeed")
|
local haste = GetUnitField("player", "modCastSpeed")
|
||||||
local modCastingTime = playerFrame.modCastingTime or 1
|
|
||||||
local text = ""
|
local text = ""
|
||||||
|
|
||||||
if isSpellCaster and haste then
|
if showHaste and isSpellCaster and haste then
|
||||||
local hasteHex = cfgColorToHex(cfg.display_haste_color) or "FFFFFF"
|
local hasteHex = cfgColorToHex(cfg.display_haste_color) or "FFFFFF"
|
||||||
if hasteMode == "1" then
|
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / haste - 1) * 100)
|
||||||
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / haste - 1) * 100)
|
|
||||||
elseif hasteMode == "2" then
|
|
||||||
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / (haste * modCastingTime) - 1) * 100)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if showSP and isSpellCaster then
|
if showSP and isSpellCaster then
|
||||||
@@ -151,21 +118,21 @@ pfUI:RegisterModule("player", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Add throttle to player frame OnUpdate
|
-- Add throttle to player frame OnUpdate
|
||||||
|
-- Throttle the unit frame's existing OnUpdate to ~20 FPS so the per-frame
|
||||||
|
-- work stays cheap.
|
||||||
if pfUI.uf.player:GetScript("OnUpdate") then
|
if pfUI.uf.player:GetScript("OnUpdate") then
|
||||||
local originalOnUpdate = pfUI.uf.player:GetScript("OnUpdate")
|
local originalOnUpdate = pfUI.uf.player:GetScript("OnUpdate")
|
||||||
pfUI.uf.player:SetScript("OnUpdate", function()
|
pfUI.uf.player:SetScript("OnUpdate", function()
|
||||||
if (this.throttleTick or 0) > GetTime() then
|
if (this.throttleTick or 0) > GetTime() then return end
|
||||||
return
|
this.throttleTick = GetTime() + 0.05
|
||||||
end
|
|
||||||
this.throttleTick = GetTime() + 0.05 -- Default: 20 FPS
|
|
||||||
originalOnUpdate()
|
originalOnUpdate()
|
||||||
if (this.infoTextTick or 0) <= GetTime() then
|
|
||||||
this.infoTextTick = GetTime() + 0.25 -- Don't need to update haste/SP text as often
|
|
||||||
UpdateInfoText()
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Haste / spell-power overlay text — refreshes 4×/sec on its own ticker,
|
||||||
|
-- independent of the unit frame's OnUpdate cadence.
|
||||||
|
C_Timer.NewTicker(0.25, UpdateInfoText)
|
||||||
|
|
||||||
-- Replace default's RESET_INSTANCES button with an always working one
|
-- Replace default's RESET_INSTANCES button with an always working one
|
||||||
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 }
|
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 }
|
||||||
for id, text in pairs(UnitPopupMenus["SELF"]) do
|
for id, text in pairs(UnitPopupMenus["SELF"]) do
|
||||||
|
|||||||
+1
-1
@@ -106,7 +106,7 @@ pfUI:RegisterModule("raid", function ()
|
|||||||
this.pendingUpdate = nil
|
this.pendingUpdate = nil
|
||||||
|
|
||||||
-- don't proceed without raid
|
-- don't proceed without raid
|
||||||
if not UnitInRaid("player") then return end
|
if not IsInRaid() then return end
|
||||||
|
|
||||||
-- clear all existing frames
|
-- clear all existing frames
|
||||||
for i=1, maxraid do SetRaidIndex(pfUI.uf.raid[i], 0) end
|
for i=1, maxraid do SetRaidIndex(pfUI.uf.raid[i], 0) end
|
||||||
|
|||||||
@@ -23,6 +23,13 @@ SlashCmdList["PFDLLSTATUS"] = function()
|
|||||||
chat:AddMessage(" |cffff0000Nampower|r: Not detected")
|
chat:AddMessage(" |cffff0000Nampower|r: Not detected")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ClassicAPI
|
||||||
|
if CLASSIC_API_VERSION then
|
||||||
|
chat:AddMessage(" |cff00ff00ClassicAPI|r: v" .. CLASSIC_API_VERSION)
|
||||||
|
else
|
||||||
|
chat:AddMessage(" |cffff0000ClassicAPI|r: Not detected")
|
||||||
|
end
|
||||||
|
|
||||||
-- Check if castbar exists for indicator positioning
|
-- Check if castbar exists for indicator positioning
|
||||||
if pfUI.castbar and pfUI.castbar.player then
|
if pfUI.castbar and pfUI.castbar.player then
|
||||||
chat:AddMessage(" |cff00ff00Castbar|r: Available for indicator anchoring")
|
chat:AddMessage(" |cff00ff00Castbar|r: Available for indicator anchoring")
|
||||||
|
|||||||
+101
-89
@@ -10,6 +10,11 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
local ON_SWING_QUEUED = 0
|
local ON_SWING_QUEUED = 0
|
||||||
local ON_SWING_QUEUE_POPPED = 1
|
local ON_SWING_QUEUE_POPPED = 1
|
||||||
|
|
||||||
|
-- Spell.dbc bits used to mirror server-side swing-reset rules.
|
||||||
|
local FLAG_AUTOATTACK = tonumber("0x08", 16) -- SPELL_INTERRUPT_FLAG_AUTOATTACK
|
||||||
|
local ATTR_KEEP_SWINGS = tonumber("0x20000", 16) -- SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS
|
||||||
|
local ATTR_ON_NEXT_SWING = tonumber("0x04", 16) -- SPELL_ATTR_ON_NEXT_SWING
|
||||||
|
|
||||||
-- Consolidate state into a table to avoid Lua 5.0 upvalue limit (32 max)
|
-- Consolidate state into a table to avoid Lua 5.0 upvalue limit (32 max)
|
||||||
local S = {
|
local S = {
|
||||||
mhTimer = 0, mhTimerMax = 1,
|
mhTimer = 0, mhTimerMax = 1,
|
||||||
@@ -32,51 +37,26 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
onSwingCache = {},
|
onSwingCache = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ranged spell IDs
|
-- Wand "Shoot" runs on the ranged bar but is INDEPENDENT of the melee
|
||||||
local RANGED_SPELLIDS = {
|
-- swing clock — casters melee-weave between mainhand swings and wand
|
||||||
[75] = true, -- Auto Shot (Hunter)
|
-- fires, both timers tick concurrently. Every other ranged-auto-attack
|
||||||
[2764] = true, -- Throw (Warrior/Rogue)
|
-- (Hunter Auto Shot, any future auto-repeat ranged spell) replaces MH.
|
||||||
}
|
local WAND_SHOOT_SPELLID = 5019
|
||||||
|
local THROW_SPELLID = 2764 -- one-shot ranged, not auto-repeat
|
||||||
|
|
||||||
-- Spells that DELAY the swing timer by their cast duration but do NOT reset it.
|
-- ATTR_ON_NEXT_SWING: spell replaces next auto-attack swing.
|
||||||
-- Slam: vanilla behavior on Turtle WoW - delays swing, does not reset.
|
|
||||||
-- Hammer of Wrath: Turtle WoW changed behavior - does not reset swing timer.
|
|
||||||
local swingDelaySpells = {
|
|
||||||
[1464] = true, [8820] = true, [11604] = true, [11605] = true, -- Slam R1-R4
|
|
||||||
[24275] = true, [24274] = true, [24239] = true, -- Hammer of Wrath R1-R3
|
|
||||||
}
|
|
||||||
|
|
||||||
-- SPELL_ATTR_ON_NEXT_SWING (bit 2, value 4): spell replaces next auto-attack swing.
|
|
||||||
-- Covers Raptor Strike, Maul, Mongoose Bite, Holy Strike, etc. automatically.
|
-- Covers Raptor Strike, Maul, Mongoose Bite, Holy Strike, etc. automatically.
|
||||||
local ATTR_ON_NEXT_SWING = 4
|
|
||||||
local function IsOnSwingSpell(spellId)
|
local function IsOnSwingSpell(spellId)
|
||||||
if S.onSwingCache[spellId] ~= nil then return S.onSwingCache[spellId] end
|
if S.onSwingCache[spellId] ~= nil then return S.onSwingCache[spellId] end
|
||||||
local rec = GetSpellRec(spellId)
|
local attr = GetSpellRecField(spellId, "attributes") or 0
|
||||||
local result = rec and bit.band(rec.attributes, ATTR_ON_NEXT_SWING) ~= 0 or false
|
local result = bit.band(attr, ATTR_ON_NEXT_SWING) ~= 0
|
||||||
S.onSwingCache[spellId] = result
|
S.onSwingCache[spellId] = result
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Heroic Strike spell IDs (all ranks)
|
-- HS / Cleave / Maul are detected dynamically via IsOnSwingSpell (the
|
||||||
local hsSpellIDs = {
|
-- SPELL_ATTR_ON_NEXT_SWING bit) + name comparison against the rank-1
|
||||||
[78] = true, [284] = true, [285] = true, [1608] = true,
|
-- canonical names cached below — no per-rank ID maintenance.
|
||||||
[11564] = true, [11565] = true, [11566] = true, [11567] = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Cleave spell IDs (all ranks)
|
|
||||||
local cleaveSpellIDs = {
|
|
||||||
[845] = true, [7369] = true, [11608] = true, [11609] = true,
|
|
||||||
[20569] = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Maul spell IDs (all ranks 1 to 7)
|
|
||||||
local maulSpellIDs = {
|
|
||||||
[6807] = true,
|
|
||||||
[6808] = true,
|
|
||||||
[6809] = true,
|
|
||||||
[8972] = true,
|
|
||||||
[9745] = true, [9880] = true, [9881] = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Read config
|
-- Read config
|
||||||
local sw_width = tonumber(C.unitframes.swingtimerwidth) or 200
|
local sw_width = tonumber(C.unitframes.swingtimerwidth) or 200
|
||||||
@@ -355,14 +335,17 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
pfUI.swingtimer:Show()
|
pfUI.swingtimer:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reset ranged countdown
|
-- Reset ranged countdown. replaceMH=true (Hunter Auto Shot, Throw) stops
|
||||||
local function ResetRanged()
|
-- the melee swing clock while ranged ticks; replaceMH=false (wand Shoot)
|
||||||
|
-- leaves it running for melee weaving.
|
||||||
|
local function ResetRanged(replaceMH)
|
||||||
if not sw_showranged then return end
|
if not sw_showranged then return end
|
||||||
UpdateWeaponSpeeds()
|
UpdateWeaponSpeeds()
|
||||||
if S.raSpeed <= 0 then return end
|
if S.raSpeed <= 0 then return end
|
||||||
-- Ranged replaces MH bar
|
if replaceMH then
|
||||||
S.mhActive = false
|
S.mhActive = false
|
||||||
pfUI.swingtimer.mainhand:Hide()
|
pfUI.swingtimer.mainhand:Hide()
|
||||||
|
end
|
||||||
S.raTimerMax = S.raSpeed
|
S.raTimerMax = S.raSpeed
|
||||||
S.raTimer = S.raSpeed
|
S.raTimer = S.raSpeed
|
||||||
S.raActive = true
|
S.raActive = true
|
||||||
@@ -406,11 +389,35 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
pfUI.swingtimer:Hide()
|
pfUI.swingtimer:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- HS/Cleave helpers. Canonical rank-1 spellIDs resolve to the localized
|
-- HS/Cleave/Maul helpers. Canonical rank-1 spellIDs resolve to the
|
||||||
-- spell name once, so the per-slot comparison is locale-independent without
|
-- localized spell name once, so per-spell classification is rank- and
|
||||||
-- per-rank hardcoding (every rank of Heroic Strike returns the same name).
|
-- locale-independent without per-rank ID hardcoding (every rank of
|
||||||
local HS_NAME = C_Spell.GetSpellName(78) -- Heroic Strike (Rank 1)
|
-- Heroic Strike etc. returns the same name).
|
||||||
local CLEAVE_NAME = C_Spell.GetSpellName(845) -- Cleave (Rank 1)
|
local HS_NAME = C_Spell.GetSpellName(78) -- Heroic Strike (Rank 1)
|
||||||
|
local CLEAVE_NAME = C_Spell.GetSpellName(845) -- Cleave (Rank 1)
|
||||||
|
local MAUL_NAME = C_Spell.GetSpellName(6807) -- Maul (Rank 1)
|
||||||
|
|
||||||
|
-- Classify an on-next-swing spell as "hs" / "cleave" / "maul" / nil.
|
||||||
|
-- IsOnSwingSpell gates the family (ATTR_ON_NEXT_SWING bit 0x04) so
|
||||||
|
-- unrelated spells return nil cheaply.
|
||||||
|
local function ClassifyOnSwingSpell(spellId)
|
||||||
|
if not IsOnSwingSpell(spellId) then return nil end
|
||||||
|
local name = C_Spell.GetSpellName(spellId)
|
||||||
|
if name == HS_NAME then return "hs"
|
||||||
|
elseif name == CLEAVE_NAME then return "cleave"
|
||||||
|
elseif name == MAUL_NAME then return "maul"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set the queue flags from a ClassifyOnSwingSpell result. nil = no-op
|
||||||
|
-- (preserves prior flag state when the queued spell isn't one we
|
||||||
|
-- color-code, matching the legacy table-lookup behavior).
|
||||||
|
local function SetQueuedKind(kind)
|
||||||
|
if not kind then return end
|
||||||
|
S.hsQueued = (kind == "hs")
|
||||||
|
S.cleaveQueued = (kind == "cleave")
|
||||||
|
S.maulQueued = (kind == "maul")
|
||||||
|
end
|
||||||
|
|
||||||
local function RebuildQueueSlotCache()
|
local function RebuildQueueSlotCache()
|
||||||
if not S.isWarrior or not sw_hsqueue or S.useSpellQueueEvent then return end
|
if not S.isWarrior or not sw_hsqueue or S.useSpellQueueEvent then return end
|
||||||
@@ -694,11 +701,17 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
local spellStartFrame = CreateFrame("Frame")
|
local spellStartFrame = CreateFrame("Frame")
|
||||||
spellStartFrame:RegisterEvent("SPELL_START_SELF")
|
spellStartFrame:RegisterEvent("SPELL_START_SELF")
|
||||||
spellStartFrame:SetScript("OnEvent", function()
|
spellStartFrame:SetScript("OnEvent", function()
|
||||||
if arg1 and arg1 > 0 then
|
if not (arg1 and arg1 > 0) then return end
|
||||||
S.pendingCastSpellId = arg1
|
S.pendingCastSpellId = arg1
|
||||||
-- Slam (and other delay-only spells): freeze the swing timer during cast
|
-- Freeze the swing timer for cast-time spells that DON'T reset auto-
|
||||||
-- so it pauses instead of ticking down and expiring mid-cast
|
-- attack on completion (Slam, Hammer of Wrath on Turtle, etc.) — those
|
||||||
if swingDelaySpells[arg1] and S.mhActive then
|
-- let the swing resume from where it paused. Detect dynamically via the
|
||||||
|
-- absent AUTOATTACK interrupt flag (8); spells with that bit reset on
|
||||||
|
-- SPELL_GO_SELF so freezing isn't necessary. Subsumes the old hardcoded
|
||||||
|
-- swingDelaySpells list (no list maintenance for new Slam-style spells).
|
||||||
|
if S.mhActive then
|
||||||
|
local iflags = GetSpellRecField(arg1, "interruptFlags") or 0
|
||||||
|
if bit.band(iflags, FLAG_AUTOATTACK) == 0 then
|
||||||
S.mhFrozenAt = GetTime()
|
S.mhFrozenAt = GetTime()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -718,52 +731,57 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
-- SPELL_GO hook via libdebuff
|
-- SPELL_GO hook via libdebuff
|
||||||
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
|
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
|
||||||
pfUI.libdebuff_spell_go_hooks["swingtimer"] = function(spellId)
|
pfUI.libdebuff_spell_go_hooks["swingtimer"] = function(spellId)
|
||||||
if RANGED_SPELLIDS[spellId] then
|
-- C_Spell.IsRangedAutoAttackSpell catches both Auto Shot (75) and
|
||||||
ResetRanged()
|
-- wand Shoot (5019) via Spell.dbc's AUTO_REPEAT attribute (covers
|
||||||
|
-- any future auto-repeat ranged spell automatically). Wand is the
|
||||||
|
-- one independent of the MH swing — everything else replaces it.
|
||||||
|
-- Throw isn't auto-repeat (single-shot) so it's handled explicitly.
|
||||||
|
if C_Spell.IsRangedAutoAttackSpell(spellId) then
|
||||||
|
ResetRanged(spellId ~= WAND_SHOOT_SPELLID)
|
||||||
return
|
return
|
||||||
elseif swingDelaySpells[spellId] then
|
elseif spellId == THROW_SPELLID then
|
||||||
-- Swing-delay spells (Slam, Hammer of Wrath on Turtle WoW):
|
ResetRanged(true)
|
||||||
-- Delay the swing timer by cast duration, do NOT reset it.
|
|
||||||
if S.mhFrozenAt then
|
|
||||||
local castDuration = GetTime() - S.mhFrozenAt
|
|
||||||
S.mhTimer = S.mhTimer + castDuration
|
|
||||||
S.mhTimerMax = S.mhTimerMax + castDuration
|
|
||||||
S.mhFrozenAt = nil
|
|
||||||
end
|
|
||||||
S.pendingCastSpellId = nil
|
|
||||||
return
|
return
|
||||||
elseif hsSpellIDs[spellId] or cleaveSpellIDs[spellId] or maulSpellIDs[spellId] or IsOnSwingSpell(spellId) then
|
elseif IsOnSwingSpell(spellId) then
|
||||||
S.hsQueued = false; S.cleaveQueued = false
|
-- On-next-swing ability (HS / Cleave / Maul / Raptor Strike / etc.)
|
||||||
S.maulQueued = false
|
-- — the swing fires as the spell consumes it. Drop the queued color.
|
||||||
ResetMH()
|
S.hsQueued = false; S.cleaveQueued = false; S.maulQueued = false
|
||||||
elseif cleaveSpellIDs[spellId] then
|
|
||||||
S.hsQueued = false; S.cleaveQueued = false
|
|
||||||
ResetMH()
|
ResetMH()
|
||||||
else
|
else
|
||||||
-- Any spell with interruptFlags > 0 resets the swing timer
|
-- Mirror the server rule for "does this spell reset the auto-attack
|
||||||
-- (Moonfire, Faerie Fire, Wrath, Starfire etc. - NOT Insect Swarm which has flags=0)
|
-- swing" (Spell::IsMeleeAttackResetSpell in Turtle's core):
|
||||||
local _rec = GetSpellRec(spellId)
|
-- InterruptFlags has SPELL_INTERRUPT_FLAG_AUTOATTACK (0x08)
|
||||||
if _rec and _rec.interruptFlags and _rec.interruptFlags > 0 then
|
-- AND AttributesEx2 lacks NOT_RESET_AUTO_ACTIONS (0x20000).
|
||||||
|
-- If neither path resets and we're holding a frozen-swing-during-cast
|
||||||
|
-- (mhFrozenAt set by SPELL_START_SELF for non-AUTOATTACK spells), this
|
||||||
|
-- is a Slam-style cast — push the timer forward by the cast duration
|
||||||
|
-- so the bar resumes from where it paused.
|
||||||
|
local iflags = GetSpellRecField(spellId, "interruptFlags") or 0
|
||||||
|
if bit.band(iflags, FLAG_AUTOATTACK) ~= 0
|
||||||
|
and bit.band(GetSpellRecField(spellId, "attributesEx2") or 0, ATTR_KEEP_SWINGS) == 0 then
|
||||||
if S.mhActive and S.mhSpeed > 0 then
|
if S.mhActive and S.mhSpeed > 0 then
|
||||||
UpdateWeaponSpeeds()
|
UpdateWeaponSpeeds()
|
||||||
S.mhTimerMax = S.mhSpeed
|
S.mhTimerMax = S.mhSpeed
|
||||||
S.mhTimer = S.mhSpeed
|
S.mhTimer = S.mhSpeed
|
||||||
end
|
end
|
||||||
|
if S.ohActive and S.ohSpeed > 0 then
|
||||||
|
S.ohTimerMax = S.ohSpeed
|
||||||
|
S.ohTimer = S.ohSpeed
|
||||||
|
end
|
||||||
|
elseif S.mhFrozenAt then
|
||||||
|
local castDuration = GetTime() - S.mhFrozenAt
|
||||||
|
S.mhTimer = S.mhTimer + castDuration
|
||||||
|
S.mhTimerMax = S.mhTimerMax + castDuration
|
||||||
|
S.mhFrozenAt = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
S.pendingCastSpellId = nil
|
S.pendingCastSpellId = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- SPELL_CAST_EVENT hook: HS/Cleave queue tracking
|
-- SPELL_CAST_EVENT hook: HS/Cleave/Maul queue tracking
|
||||||
pfUI.libdebuff_spell_cast_hooks = pfUI.libdebuff_spell_cast_hooks or {}
|
pfUI.libdebuff_spell_cast_hooks = pfUI.libdebuff_spell_cast_hooks or {}
|
||||||
pfUI.libdebuff_spell_cast_hooks["swingtimer"] = function(success, spellId)
|
pfUI.libdebuff_spell_cast_hooks["swingtimer"] = function(success, spellId)
|
||||||
if hsSpellIDs[spellId] then
|
SetQueuedKind(ClassifyOnSwingSpell(spellId))
|
||||||
S.hsQueued = true; S.cleaveQueued = false; S.maulQueued = false
|
|
||||||
elseif cleaveSpellIDs[spellId] then
|
|
||||||
S.cleaveQueued = true; S.hsQueued = false; S.maulQueued = false
|
|
||||||
elseif maulSpellIDs[spellId] then
|
|
||||||
S.maulQueued = true; S.hsQueued = false; S.cleaveQueued = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -847,13 +865,7 @@ pfUI:RegisterModule("swingtimer", function ()
|
|||||||
local spellId = arg2 or 0
|
local spellId = arg2 or 0
|
||||||
if eventCode == ON_SWING_QUEUED then
|
if eventCode == ON_SWING_QUEUED then
|
||||||
S.useSpellQueueEvent = true
|
S.useSpellQueueEvent = true
|
||||||
if hsSpellIDs[spellId] then
|
SetQueuedKind(ClassifyOnSwingSpell(spellId))
|
||||||
S.hsQueued = true; S.cleaveQueued = false; S.maulQueued = false
|
|
||||||
elseif cleaveSpellIDs[spellId] then
|
|
||||||
S.cleaveQueued = true; S.hsQueued = false; S.maulQueued = false
|
|
||||||
elseif maulSpellIDs[spellId] then
|
|
||||||
S.maulQueued = true; S.hsQueued = false; S.cleaveQueued = false
|
|
||||||
end
|
|
||||||
elseif eventCode == ON_SWING_QUEUE_POPPED then
|
elseif eventCode == ON_SWING_QUEUE_POPPED then
|
||||||
S.hsQueued = false; S.cleaveQueued = false; S.maulQueued = false
|
S.hsQueued = false; S.cleaveQueued = false; S.maulQueued = false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -943,7 +943,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
|
|||||||
CreateBackdropShadow(AtlasLootTooltip)
|
CreateBackdropShadow(AtlasLootTooltip)
|
||||||
|
|
||||||
if pfUI.eqcompare then
|
if pfUI.eqcompare then
|
||||||
HookScript(AtlasLootTooltip, "OnShow", pfUI.eqcompare.GameTooltipShow)
|
pfUI.eqcompare.HookTooltip(AtlasLootTooltip)
|
||||||
HookScript(AtlasLootTooltip, "OnHide", function()
|
HookScript(AtlasLootTooltip, "OnHide", function()
|
||||||
ShoppingTooltip1:Hide()
|
ShoppingTooltip1:Hide()
|
||||||
ShoppingTooltip2:Hide()
|
ShoppingTooltip2:Hide()
|
||||||
@@ -1182,7 +1182,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
|
|||||||
-- use pfUI frames to draw healComm predictions
|
-- use pfUI frames to draw healComm predictions
|
||||||
local pfHookHealCommSendAddonMessage = HealComm.SendAddonMessage
|
local pfHookHealCommSendAddonMessage = HealComm.SendAddonMessage
|
||||||
function HealComm.SendAddonMessage(this, msg)
|
function HealComm.SendAddonMessage(this, msg)
|
||||||
if not UnitInRaid("player") and GetNumPartyMembers() < 1 then
|
if not IsInGroup() then
|
||||||
libpredict:ParseChatMessage(UnitName("player"), msg, "HealComm")
|
libpredict:ParseChatMessage(UnitName("player"), msg, "HealComm")
|
||||||
end
|
end
|
||||||
pfHookHealCommSendAddonMessage(this, msg)
|
pfHookHealCommSendAddonMessage(this, msg)
|
||||||
|
|||||||
+8
-8
@@ -146,14 +146,6 @@ pfUI:RegisterModule("tooltip", function ()
|
|||||||
rhp, rhpmax = hp, hpmax
|
rhp, rhpmax = hp, hpmax
|
||||||
elseif pfUI.libhealth and pfUI.libhealth.enabled then
|
elseif pfUI.libhealth and pfUI.libhealth.enabled then
|
||||||
rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(this.name, this.level, tonumber(hp), tonumber(hpmax))
|
rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(this.name, this.level, tonumber(hp), tonumber(hpmax))
|
||||||
elseif MobHealthFrame then
|
|
||||||
local index = (this.name or "") .. ":" .. (this.level or "")
|
|
||||||
local ppp = MobHealth_PPP(index)
|
|
||||||
if perc and ppp and ppp > 0 and not UnitIsUnit("mouseover", "pet") then
|
|
||||||
rhp = round(hp * ppp)
|
|
||||||
rhpmax = round(100 * ppp)
|
|
||||||
estimated = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or round(hpmax/100*hp) ~= hp ) then
|
if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or round(hpmax/100*hp) ~= hp ) then
|
||||||
@@ -241,6 +233,14 @@ pfUI:RegisterModule("tooltip", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if C.tooltip.movespeed == "1" then
|
||||||
|
local currentSpeed = GetUnitSpeed(unit)
|
||||||
|
if currentSpeed and currentSpeed > 0 then
|
||||||
|
local pct = floor(currentSpeed / 7 * 100 + 0.5)
|
||||||
|
GameTooltip:AddLine(T["Speed"] .. ": " .. pct .. "%", 0.7, 0.7, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if hp and hpm then
|
if hp and hpm then
|
||||||
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
|
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
|
||||||
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
|
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ pfUI:RegisterModule("turtle-wow", function ()
|
|||||||
-- Check if pfUI is handling group or raid for the current situation
|
-- Check if pfUI is handling group or raid for the current situation
|
||||||
local function pfUIHandlesGroupOrRaid()
|
local function pfUIHandlesGroupOrRaid()
|
||||||
local disabled = C["disabled"] or {}
|
local disabled = C["disabled"] or {}
|
||||||
if GetNumRaidMembers() > 0 then
|
if IsInRaid() then
|
||||||
if not C.unitframes.raid then return false end
|
if not C.unitframes.raid then return false end
|
||||||
-- Hide Turtle frames if: pfUI raid module is active, OR player disabled visibility
|
-- Hide Turtle frames if: pfUI raid module is active, OR player disabled visibility
|
||||||
if disabled["raid"] == "1" then
|
if disabled["raid"] == "1" then
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ do
|
|||||||
-- ClassicAPI dependency check.
|
-- ClassicAPI dependency check.
|
||||||
-- pfUI relies pervasively on the modern C_* / SuperWoW / nameplate / focus
|
-- pfUI relies pervasively on the modern C_* / SuperWoW / nameplate / focus
|
||||||
-- API surface that ClassicAPI polyfills, so presence is required.
|
-- API surface that ClassicAPI polyfills, so presence is required.
|
||||||
local PFUI_CLASSIC_API_MIN = 10503 -- (X*10000 + Y*100 + Z)
|
local PFUI_CLASSIC_API_MIN = 10507 -- (X*10000 + Y*100 + Z)
|
||||||
local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN
|
local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN
|
||||||
local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
|
local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
|
||||||
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
|
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
|
||||||
@@ -102,6 +102,10 @@ pfUI.version = {}
|
|||||||
pfUI.hooks = {}
|
pfUI.hooks = {}
|
||||||
pfUI.env = {}
|
pfUI.env = {}
|
||||||
|
|
||||||
|
pfUI.events = Mixin({}, CallbackRegistryMixin)
|
||||||
|
pfUI.events:OnLoad()
|
||||||
|
pfUI.events:SetUndefinedEventsAllowed(true)
|
||||||
|
|
||||||
-- check if macro addons are loaded (disables macrotweak/macroscan)
|
-- check if macro addons are loaded (disables macrotweak/macroscan)
|
||||||
function pfUI:MacroAddonsLoaded()
|
function pfUI:MacroAddonsLoaded()
|
||||||
return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")
|
return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")
|
||||||
|
|||||||
@@ -2,25 +2,13 @@ pfUI:RegisterSkin("Character", function ()
|
|||||||
local rawborder, border = GetBorderSize()
|
local rawborder, border = GetBorderSize()
|
||||||
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
||||||
|
|
||||||
-- Compatibility
|
-- Honor Tab
|
||||||
if PlayerTitleDropDown then -- tbc, wotlk
|
StripTextures(HonorFrame)
|
||||||
-- Character Tab
|
StripTextures(ArenaFrame)
|
||||||
SkinDropDown(PlayerTitleDropDown)
|
|
||||||
PlayerTitleDropDown:SetPoint("TOP", CharacterLevelText, "BOTTOM", 0, -2)
|
|
||||||
PlayerTitleDropDownText:SetPoint("LEFT", PlayerTitleDropDown.backdrop, "LEFT", 6, 2)
|
|
||||||
SkinDropDown(PlayerStatFrameLeftDropDown)
|
|
||||||
SkinDropDown(PlayerStatFrameRightDropDown)
|
|
||||||
|
|
||||||
-- Honor Tab
|
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
|
||||||
StripTextures(PVPFrame)
|
CreateBackdrop(HonorFrameProgressBar)
|
||||||
else -- vanilla
|
HonorFrameProgressBar:SetHeight(24)
|
||||||
-- Honor Tab
|
|
||||||
StripTextures(HonorFrame)
|
|
||||||
|
|
||||||
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
|
|
||||||
CreateBackdrop(HonorFrameProgressBar)
|
|
||||||
HonorFrameProgressBar:SetHeight(24)
|
|
||||||
end
|
|
||||||
|
|
||||||
local magicResTextureCords = {
|
local magicResTextureCords = {
|
||||||
{0.21875, 0.78125, 0.25, 0.3203125},
|
{0.21875, 0.78125, 0.25, 0.3203125},
|
||||||
@@ -148,22 +136,19 @@ pfUI:RegisterSkin("Character", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
HookScript(CharacterFrame, "OnShow", function()
|
hooksecurefunc("CharacterFrame_OnShow", function()
|
||||||
RefreshCharacterSlots()
|
RefreshCharacterSlots()
|
||||||
RefreshPetPosition()
|
RefreshPetPosition()
|
||||||
|
end)
|
||||||
|
|
||||||
if not this.hooked then
|
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
||||||
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
if this:GetParent() == PaperDollFrame then
|
||||||
-- update only character slots!
|
RefreshCharacterSlot(this)
|
||||||
if string.find(this:GetName(), "^Character.-Slot$") then
|
|
||||||
RefreshCharacterSlot(this)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
|
||||||
this.hooked = true
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
||||||
|
|
||||||
StripTextures(PaperDollFrame)
|
StripTextures(PaperDollFrame)
|
||||||
StripTextures(CharacterAttributesFrame)
|
StripTextures(CharacterAttributesFrame)
|
||||||
StripTextures(CharacterResistanceFrame)
|
StripTextures(CharacterResistanceFrame)
|
||||||
|
|||||||
Reference in New Issue
Block a user