mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 14:10:01 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f61f94a24 | ||
|
|
65678da3d2 | ||
|
|
9b7aca8541 | ||
|
|
60525eec3a | ||
|
|
c3829c2bd2 | ||
|
|
28de6fd835 | ||
|
|
fc75e091a4 | ||
|
|
ef478b0552 | ||
|
|
760d8992b6 | ||
|
|
62a99ac410 |
+2
-2
@@ -208,7 +208,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")
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
+5
-5
@@ -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()
|
||||||
|
|||||||
+11
-13
@@ -190,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
|
||||||
@@ -299,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)
|
||||||
@@ -366,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
|
||||||
@@ -959,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")
|
||||||
|
|
||||||
@@ -979,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
|
||||||
|
|
||||||
@@ -1002,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
|
||||||
|
|
||||||
@@ -1085,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
|
||||||
@@ -1097,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
|
||||||
|
|||||||
+2
-5
@@ -2380,11 +2380,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,6 +2745,7 @@ 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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
+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)
|
||||||
|
|||||||
@@ -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)
|
||||||
+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")
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -233,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
|
||||||
|
|||||||
@@ -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},
|
||||||
|
|||||||
Reference in New Issue
Block a user