mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 07:36:56 +00:00
Compare commits
26 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 |
+14
-14
@@ -28,12 +28,8 @@ function pfUI.api.HasNampower()
|
||||
return GetNampowerVersion and true or false
|
||||
end
|
||||
|
||||
local isTurtleWoW
|
||||
function pfUI.api.IsTurtleWoW()
|
||||
if isTurtleWoW == nil then
|
||||
isTurtleWoW = C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
||||
end
|
||||
return isTurtleWoW
|
||||
return C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
||||
end
|
||||
|
||||
-- [ GetUnitDistance ]
|
||||
@@ -208,7 +204,7 @@ function pfUI.api.GetUnbuffedRoster(name)
|
||||
end
|
||||
end
|
||||
|
||||
if UnitInRaid("player") then
|
||||
if IsInRaid() then
|
||||
for i=1,40 do check("raid"..i) end
|
||||
else
|
||||
check("player")
|
||||
@@ -434,13 +430,17 @@ function pfUI.api.GetBagFamily(bag)
|
||||
|
||||
local id = GetInventoryItemID("player", ContainerIDToInventoryID(bag))
|
||||
if id then
|
||||
local _, _, _, _, _, itemType, subType = GetItemInfo(id)
|
||||
local bagsubtype = L["bagtypes"][subType]
|
||||
|
||||
if bagsubtype == "DEFAULT" then return "BAG" end
|
||||
if bagsubtype == "SOULBAG" then return "SOULBAG" end
|
||||
if bagsubtype == "QUIVER" then return "QUIVER" end
|
||||
if bagsubtype == nil then return "SPECIAL" end
|
||||
-- classID 1 = Container (bags), 11 = Quiver
|
||||
-- Container subclasses: 0 = Bag (default), 1 = Soul Bag, 2+ = specialty (herb/enchanting/etc.)
|
||||
-- Quiver subclasses: 2 = Quiver (arrows), 3 = Ammo Pouch (bullets)
|
||||
local _, _, _, _, _, classID, subClassID = C_Item.GetItemInfoInstant(id)
|
||||
if classID == 1 then
|
||||
if subClassID == 0 then return "BAG" end
|
||||
if subClassID == 1 then return "SOULBAG" end
|
||||
return "SPECIAL"
|
||||
elseif classID == 11 then
|
||||
return "QUIVER"
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -485,7 +485,7 @@ end
|
||||
-- 'msg' [string] the message to send
|
||||
function pfUI.api.SendChatMessageWide(msg)
|
||||
local channel = "SAY"
|
||||
if UnitInRaid("player") then
|
||||
if IsInRaid() then
|
||||
if ( IsRaidLeader() or IsRaidOfficer() ) then
|
||||
channel = "RAID_WARNING"
|
||||
else
|
||||
|
||||
+1
-1
@@ -748,6 +748,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("tooltip", nil, "cursoroffset", "20")
|
||||
pfUI:UpdateConfig("tooltip", nil, "extguild", "1")
|
||||
pfUI:UpdateConfig("tooltip", nil, "itemid", "0")
|
||||
pfUI:UpdateConfig("tooltip", nil, "movespeed", "0")
|
||||
pfUI:UpdateConfig("tooltip", nil, "alpha", "0.8")
|
||||
pfUI:UpdateConfig("tooltip", nil, "alwaysperc", "0")
|
||||
pfUI:UpdateConfig("tooltip", "compare", "basestats", "1")
|
||||
@@ -1371,7 +1372,6 @@ function pfUI:MigrateConfig()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Remove "Show only own debuffs" from unitframes and nameplates
|
||||
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
|
||||
if pfUI_config.nameplates then
|
||||
|
||||
+2
-3
@@ -1172,10 +1172,9 @@ function pfUI.api.CreateQuestionDialog(text, yes, no, editbox, onclose)
|
||||
local width = 200
|
||||
|
||||
-- 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
|
||||
question:SetWidth( width + 2*padding)
|
||||
this:SetScript("OnUpdate", nil)
|
||||
question:SetWidth(width + 2*padding)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
+17
-9
@@ -73,8 +73,8 @@ end
|
||||
|
||||
local function BuffOnClick()
|
||||
if this:GetParent().label == "player" then
|
||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HELPFUL")
|
||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
||||
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HELPFUL")
|
||||
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,8 +114,8 @@ end
|
||||
|
||||
local function DebuffOnClick()
|
||||
if this:GetParent().label == "player" then
|
||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HARMFUL")
|
||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
||||
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HARMFUL")
|
||||
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -305,12 +305,12 @@ function pfUI.uf:UpdateVisibility()
|
||||
local id = self.cache_raid
|
||||
|
||||
-- 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.label = "player"
|
||||
|
||||
-- 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
|
||||
self.id = ""
|
||||
self.label = "player"
|
||||
@@ -347,12 +347,12 @@ function pfUI.uf:UpdateVisibility()
|
||||
-- frame shall not be visible
|
||||
visibility = "hide"
|
||||
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
|
||||
visibility = "hide"
|
||||
self.visible = nil
|
||||
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
|
||||
visibility = "hide"
|
||||
self.visible = nil
|
||||
@@ -1773,7 +1773,7 @@ function pfUI.uf:RefreshIndicators(unit)
|
||||
local unitstr = unit.label .. unit.id
|
||||
|
||||
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()
|
||||
else
|
||||
unit.leaderIcon:Hide()
|
||||
@@ -1902,6 +1902,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
end
|
||||
if duration > 0 then
|
||||
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
|
||||
else
|
||||
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||
end
|
||||
elseif aura.duration > 0 then
|
||||
local guid = UnitGUID(unitstr)
|
||||
@@ -1912,6 +1914,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
else
|
||||
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||
end
|
||||
else
|
||||
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||
end
|
||||
else
|
||||
unit.buffs[i]:Hide()
|
||||
@@ -2005,7 +2009,11 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
end
|
||||
if duration > 0 then
|
||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
||||
else
|
||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||
end
|
||||
else
|
||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||
end
|
||||
|
||||
if stacks > 1 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
+5
-7
@@ -44,15 +44,13 @@ if GetNampowerVersion then
|
||||
end
|
||||
|
||||
-- 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")
|
||||
nampowerCheckFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
nampowerCheckFrame:SetScript("OnEvent", function()
|
||||
-- Defer to next frame so Nampower is fully initialized
|
||||
this:SetScript("OnUpdate", function()
|
||||
this:SetScript("OnUpdate", nil)
|
||||
this:UnregisterAllEvents()
|
||||
this:SetScript("OnEvent", nil)
|
||||
this:UnregisterAllEvents()
|
||||
this:SetScript("OnEvent", nil)
|
||||
RunNextFrame(function()
|
||||
|
||||
if GetNampowerVersion then
|
||||
local major, minor, patch = GetNampowerVersion()
|
||||
@@ -967,7 +965,7 @@ if hasNampower then
|
||||
-- Channel interrupted by player - clear ownDebuffs for the channeled spell
|
||||
-- via C_Spell.ChannelInfo. DEBUFF_REMOVED fires later (0.5-1s server lag),
|
||||
-- causing phantom debuff display without this pre-clear.
|
||||
local spellName = select(1, C_Spell.ChannelInfo())
|
||||
local spellName = C_Spell.ChannelInfo()
|
||||
if spellName then
|
||||
local targetGuid = UnitGUID and UnitGUID("target")
|
||||
if targetGuid and ownDebuffs[targetGuid] and ownDebuffs[targetGuid][spellName] then
|
||||
|
||||
+11
-13
@@ -190,7 +190,7 @@ pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGu
|
||||
-- selfcast (ALT) = player, otherwise = current target
|
||||
-- Use this to find the correct group to heal
|
||||
local pohTarget = target or player
|
||||
if GetNumRaidMembers() > 0 then
|
||||
if IsInRaid() then
|
||||
-- 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)
|
||||
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
|
||||
if spellName == PRAYER_OF_HEALING then
|
||||
if GetNumRaidMembers() > 0 then
|
||||
if IsInRaid() then
|
||||
local targetGroup
|
||||
for i = 1, GetNumRaidMembers() do
|
||||
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)
|
||||
if libpredict.sender and libpredict.sender.SendHealCommMsg then
|
||||
libpredict.sender:SendHealCommMsg(hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/")
|
||||
elseif GetNumRaidMembers() > 0 then
|
||||
elseif IsInRaid() then
|
||||
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "RAID")
|
||||
elseif GetNumPartyMembers() > 0 then
|
||||
elseif IsInGroup() then
|
||||
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "PARTY")
|
||||
end
|
||||
end
|
||||
@@ -959,8 +959,6 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
if not libpredict.sender.enabled then return end
|
||||
local effect, rank = libspell.GetSpellInfo(effect)
|
||||
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")
|
||||
|
||||
@@ -979,13 +977,13 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
if not libpredict.sender.current_cast then
|
||||
spell_queue[1] = effect
|
||||
spell_queue[2] = effect.. ( rank or "" )
|
||||
spell_queue[3] = target or mouseover or default
|
||||
spell_queue[3] = target or default
|
||||
end
|
||||
|
||||
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback
|
||||
|
||||
if effect == REJUVENATION then
|
||||
local hotTarget = target or mouseover or default
|
||||
local hotTarget = target or default
|
||||
local now = pfUI.uf.now or GetTime()
|
||||
local key = "Reju" .. hotTarget
|
||||
|
||||
@@ -1002,7 +1000,7 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
local rankStr = rankNum and tostring(rankNum) or "0"
|
||||
libpredict.sender:SendHealCommMsg("Reju/"..hotTarget.."/"..rejuvDuration.."/"..rankStr.."/")
|
||||
elseif effect == RENEW then
|
||||
local hotTarget = target or mouseover or default
|
||||
local hotTarget = target or default
|
||||
local now = pfUI.uf.now or GetTime()
|
||||
local key = "Renew" .. hotTarget
|
||||
|
||||
@@ -1085,10 +1083,10 @@ libpredict.sender = CreateFrame("Frame", "pfPredictionSender", UIParent)
|
||||
libpredict.sender.enabled = true
|
||||
libpredict.sender.SendHealCommMsg = function(self, msg)
|
||||
-- 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)
|
||||
SendAddonMessage("HealComm", msg, "RAID")
|
||||
elseif GetNumPartyMembers() > 0 then
|
||||
elseif IsInGroup() then
|
||||
-- In party: Only send to PARTY
|
||||
SendAddonMessage("HealComm", msg, "PARTY")
|
||||
end
|
||||
@@ -1097,10 +1095,10 @@ libpredict.sender.SendHealCommMsg = function(self, msg)
|
||||
end
|
||||
libpredict.sender.SendResCommMsg = function(self, msg)
|
||||
-- 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)
|
||||
SendAddonMessage("CTRA", msg, "RAID")
|
||||
elseif GetNumPartyMembers() > 0 then
|
||||
elseif IsInGroup() then
|
||||
-- In party: Only send to PARTY
|
||||
SendAddonMessage("CTRA", msg, "PARTY")
|
||||
end
|
||||
|
||||
+4
-14
@@ -134,19 +134,9 @@ pfUI:RegisterModule("addoncompat", function ()
|
||||
end
|
||||
|
||||
-- run the addonconflict queue when firstrun is ready
|
||||
local delay = CreateFrame("Frame")
|
||||
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
|
||||
|
||||
if pfUI.firstrun and pfUI.firstrun.completed then
|
||||
RunQueue()
|
||||
this:SetScript("OnUpdate", nil)
|
||||
end)
|
||||
else
|
||||
pfUI.events:RegisterCallback("firstrun:complete", RunQueue, "addoncompat")
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -19,12 +19,7 @@ pfUI:RegisterModule("autovendor", function ()
|
||||
local startGold = GetMoney()
|
||||
C_MerchantFrame.SellAllJunkItems()
|
||||
|
||||
local reporter = CreateFrame("Frame")
|
||||
reporter.deadline = GetTime() + 0.3
|
||||
reporter:SetScript("OnUpdate", function()
|
||||
if GetTime() < this.deadline then return end
|
||||
this:SetScript("OnUpdate", nil)
|
||||
this:Hide()
|
||||
C_Timer.After(0.3, function()
|
||||
local income = GetMoney() - startGold
|
||||
if income > 0 then
|
||||
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: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)
|
||||
|
||||
function pfUI.bubbles:IsBubble(f)
|
||||
@@ -66,7 +68,5 @@ pfUI:RegisterModule("bubbles", function ()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.bubbles:SetScript("OnUpdate", nil)
|
||||
end
|
||||
end)
|
||||
|
||||
+3
-3
@@ -60,6 +60,7 @@ pfUI:RegisterModule("buff", function ()
|
||||
buff.mode = buff.btype
|
||||
buff.expirationTime = aura.expirationTime
|
||||
buff.stackCount = aura.applications
|
||||
buff.spellId = aura.spellId
|
||||
buff.texture:SetTexture(aura.icon)
|
||||
|
||||
if buff.btype == "HARMFUL" then
|
||||
@@ -146,9 +147,8 @@ pfUI:RegisterModule("buff", function ()
|
||||
CancelItemTempEnchantment(1)
|
||||
elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then
|
||||
CancelItemTempEnchantment(2)
|
||||
else
|
||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.btype)
|
||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
||||
elseif this.spellId then
|
||||
C_Spell.CancelSpellByID(this.spellId)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -99,8 +99,8 @@ pfUI:RegisterModule("buffwatch", function ()
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."])
|
||||
end
|
||||
elseif this.parent.unit == "player" then
|
||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.type)
|
||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
||||
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, this.type)
|
||||
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+125
-219
@@ -1,243 +1,149 @@
|
||||
pfUI:RegisterModule("eqcompare", function ()
|
||||
local sides = { "Left", "Right" }
|
||||
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"
|
||||
pfUI.eqcompare = {}
|
||||
|
||||
local function AddHeader(tooltip)
|
||||
local name = tooltip:GetName()
|
||||
local function ShowCompareItem(self, link, shift)
|
||||
self = self or GameTooltip
|
||||
|
||||
-- shift all entries one line down
|
||||
for i=tooltip:NumLines(), 1, -1 do
|
||||
for _, side in pairs(sides) do
|
||||
local current = _G[name.."Text"..side..i]
|
||||
local below = _G[name.."Text"..side..i+1]
|
||||
if not link or (not IsShiftKeyDown() and (C.tooltip.compare.showalways ~= "1" or C_Item.IsEquippedItem(link))) then
|
||||
return
|
||||
end
|
||||
|
||||
if current and current:IsShown() then
|
||||
local text = current:GetText()
|
||||
local r, g, b = current:GetTextColor()
|
||||
local shoppingTooltip1, shoppingTooltip2 = unpack(self.shoppingTooltips or { ShoppingTooltip1, ShoppingTooltip2 });
|
||||
|
||||
if text and text ~= "" then
|
||||
if tooltip:NumLines() < i+1 then
|
||||
-- add new line if required
|
||||
tooltip:AddLine(text, r, g, b, true)
|
||||
else
|
||||
-- update existing lines
|
||||
below:SetText(text)
|
||||
below:SetTextColor(r, g, b)
|
||||
below:Show()
|
||||
local SEPARATION = 6;
|
||||
local backdrop = shoppingTooltip1.GetBackdrop and shoppingTooltip1:GetBackdrop();
|
||||
local GAP = SEPARATION + ((type(backdrop) == "table" and backdrop.edgeSize) or 0);
|
||||
|
||||
-- hide processed line
|
||||
current:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
local item1 = nil;
|
||||
local item2 = nil;
|
||||
local side = "left";
|
||||
if ( shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) ) then
|
||||
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
|
||||
|
||||
-- add label to first line
|
||||
_G[name.."TextLeft1"]:SetTextColor(.5, .5, .5, 1)
|
||||
_G[name.."TextLeft1"]:SetText(CURRENTLY_EQUIPPED)
|
||||
_G[name.."TextLeft1"]:Show()
|
||||
if ( item1 ) then
|
||||
shoppingTooltip1:SetOwner(self, "ANCHOR_NONE");
|
||||
shoppingTooltip1:ClearAllPoints();
|
||||
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
|
||||
tooltip:Show()
|
||||
if ( item2 ) then
|
||||
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
|
||||
|
||||
local slotTable = {
|
||||
[INVTYPE_2HWEAPON] = "MainHandSlot",
|
||||
[INVTYPE_BODY] = "ShirtSlot",
|
||||
[INVTYPE_CHEST] = "ChestSlot",
|
||||
[INVTYPE_CLOAK] = "BackSlot",
|
||||
[INVTYPE_FEET] = "FeetSlot",
|
||||
[INVTYPE_FINGER] = "Finger0Slot",
|
||||
[INVTYPE_FINGER_OTHER] = "Finger1Slot",
|
||||
[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",
|
||||
local prevMerchant = ShoppingTooltip1.SetMerchantCompareItem
|
||||
local function SetMerchantCompareItem(self, index, compareItem)
|
||||
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||
ShowCompareItem(nil, GetMerchantItemLink(index))
|
||||
return false
|
||||
end
|
||||
return prevMerchant and prevMerchant(self, index, compareItem)
|
||||
end
|
||||
|
||||
[INVTYPE_WAND] = "RangedSlot",
|
||||
[INVTYPE_GUN] = "RangedSlot",
|
||||
[INVTYPE_PROJECTILE] = "AmmoSlot",
|
||||
[INVTYPE_CROSSBOW] = "RangedSlot",
|
||||
[INVTYPE_THROWN] = "RangedSlot",
|
||||
local prevAuction = ShoppingTooltip1.SetAuctionCompareItem
|
||||
local function SetAuctionCompareItem(self, type, index, compareItem)
|
||||
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||
ShowCompareItem(nil, GetAuctionItemLink(type, index))
|
||||
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)
|
||||
return string.sub(str, 1, string.len(start)) == start
|
||||
end
|
||||
|
||||
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
|
||||
local function makeHook(getter)
|
||||
return function(tooltip, arg1, arg2, arg3)
|
||||
if C.tooltip.compare.basestats == "1" then
|
||||
ShowCompareItem(tooltip, getter(arg1, arg2, arg3))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function CompareAttributes(data, targetData)
|
||||
if not data then return end
|
||||
|
||||
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
|
||||
local function HookTooltip(tooltip)
|
||||
for setter, getter in pairs(TooltipHooks) do
|
||||
_G['hooksecurefunc'](tooltip, setter, makeHook(getter))
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.eqcompare = {}
|
||||
pfUI.eqcompare.GameTooltipShow = function()
|
||||
-- use this tooltip for the next comparison
|
||||
pfUI.eqcompare.tooltip = this
|
||||
HookTooltip(GameTooltip)
|
||||
|
||||
if not IsShiftKeyDown() and C.tooltip.compare.showalways ~= "1" then return end
|
||||
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
|
||||
pfUI.eqcompare.HookTooltip = HookTooltip
|
||||
end)
|
||||
|
||||
@@ -46,6 +46,11 @@ pfUI:RegisterModule("firstrun", function ()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not self.completed then
|
||||
self.completed = true
|
||||
pfUI.events:TriggerEvent("firstrun:complete")
|
||||
end
|
||||
end
|
||||
|
||||
-- main function to create wizard windows
|
||||
|
||||
+1
-3
@@ -50,10 +50,8 @@ function SlashCmdList.PFFOCUSNAME(msg)
|
||||
FocusUnit("target")
|
||||
end
|
||||
|
||||
local restore = CreateFrame("Frame")
|
||||
restore:SetScript("OnUpdate", function()
|
||||
RunNextFrame(function()
|
||||
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
||||
restore:SetScript("OnUpdate", nil)
|
||||
end)
|
||||
|
||||
if prevGUID and prevGUID ~= "0x0000000000000000" then
|
||||
|
||||
+23
-6
@@ -212,6 +212,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
if not this:GetParent():IsShown() then
|
||||
category[config] = r .. "," .. g .. "," .. b .. "," .. a
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -278,6 +279,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
if this:GetText() ~= this:GetParent().category[this:GetParent().config] then
|
||||
this:GetParent().category[this:GetParent().config] = this:GetText()
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
end
|
||||
this:SetTextColor(.2,1,.8,1)
|
||||
else
|
||||
@@ -328,6 +330,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
end
|
||||
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
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
|
||||
category[config] = value
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -394,6 +398,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
end
|
||||
category[config] = newconf
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
frame.input:UpdateMenu()
|
||||
end)
|
||||
|
||||
@@ -409,6 +414,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateQuestionDialog(T["New entry:"], function()
|
||||
category[config] = category[config] .. "#" .. this:GetParent().input:GetText()
|
||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||
frame.input:UpdateMenu()
|
||||
end, false, true)
|
||||
end)
|
||||
@@ -2380,11 +2386,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
|
||||
if c == "player" then
|
||||
CreateConfig(nil, T["Player SP/Haste Display"], nil, nil, "header")
|
||||
CreateConfig(nil, T["Haste Display"], C.unitframes[c], "display_haste", "dropdown", {
|
||||
"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"], C.unitframes[c], "display_haste", "checkbox")
|
||||
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["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["Always Show Health In Percent"], C.tooltip, "alwaysperc", "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["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["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(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")
|
||||
|
||||
@@ -39,11 +39,11 @@ pfUI:RegisterModule("innervatecall", function ()
|
||||
return "BATTLEGROUND"
|
||||
end
|
||||
|
||||
if GetNumRaidMembers() > 0 then
|
||||
if IsInRaid() then
|
||||
return "RAID"
|
||||
end
|
||||
|
||||
if GetNumPartyMembers() > 0 then
|
||||
if IsInGroup() then
|
||||
return "PARTY"
|
||||
end
|
||||
|
||||
@@ -96,14 +96,10 @@ pfUI:RegisterModule("innervatecall", function ()
|
||||
end
|
||||
end
|
||||
|
||||
local readyAt = GetTime() + cdRemaining
|
||||
frame:SetScript("OnUpdate", function()
|
||||
if GetTime() >= readyAt then
|
||||
frame:SetScript("OnUpdate", nil)
|
||||
local ch = GetAnnounceChannel()
|
||||
if ch then
|
||||
SendChatMessage(">> Innervate is ready <<", ch)
|
||||
end
|
||||
C_Timer.After(cdRemaining, function()
|
||||
local ch = GetAnnounceChannel()
|
||||
if ch then
|
||||
SendChatMessage(">> Innervate is ready <<", ch)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
+1
-1
@@ -323,7 +323,7 @@ pfUI:RegisterModule("loot", function ()
|
||||
end
|
||||
|
||||
function pfUI.loot:InitGroupDropDown()
|
||||
local inRaid = UnitInRaid("player")
|
||||
local inRaid = IsInRaid()
|
||||
if UIDROPDOWNMENU_MENU_LEVEL == 1 then
|
||||
if ( inRaid ) then
|
||||
pfUI.loot:BuildRaidMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
||||
|
||||
@@ -66,9 +66,5 @@ pfUI:RegisterModule("macrotweak", function ()
|
||||
end)
|
||||
|
||||
-- Check conflicts after one tick so all addons have finished loading
|
||||
local watcher = CreateFrame("Frame")
|
||||
watcher:SetScript("OnUpdate", function()
|
||||
this:SetScript("OnUpdate", nil)
|
||||
CheckConflicts()
|
||||
end)
|
||||
RunNextFrame(CheckConflicts)
|
||||
end)
|
||||
@@ -50,7 +50,7 @@ pfUI:RegisterModule("mapcolors", function ()
|
||||
end
|
||||
|
||||
local function UpdateUnitFrames(unit_button_name)
|
||||
if GetNumRaidMembers() > 0 then
|
||||
if IsInRaid() then
|
||||
for i=1, MAX_RAID_MEMBERS do
|
||||
local frame_name = unit_button_name.."Raid"..i
|
||||
local frame = _G[frame_name]
|
||||
@@ -68,7 +68,7 @@ pfUI:RegisterModule("mapcolors", function ()
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif GetNumPartyMembers() > 0 then
|
||||
elseif IsInGroup() then
|
||||
for i=1, MAX_PARTY_MEMBERS do
|
||||
local frame_name = unit_button_name.."Party"..i
|
||||
local frame = _G[frame_name]
|
||||
|
||||
+9
-75
@@ -1,39 +1,6 @@
|
||||
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"
|
||||
function SlashCmdList.PFCAST(msg)
|
||||
local restore_target = true
|
||||
local func = pfUI.api.TryMemoizedFuncLoadstringForSpellCasts(msg)
|
||||
local unit = "mouseover"
|
||||
|
||||
@@ -50,51 +17,18 @@ pfUI:RegisterModule("mouseover", function ()
|
||||
end
|
||||
end
|
||||
|
||||
-- Nampower: CastSpellByName supports a second unit parameter directly.
|
||||
-- unit is already resolved to "mouseover", "target" or "player" at this point.
|
||||
if not func and GetNampowerVersion then
|
||||
-- Spell-name path: Nampower's CastSpellByName takes a second unit
|
||||
-- parameter directly, no target swap dance required.
|
||||
if not func then
|
||||
CastSpellByName(msg, unit)
|
||||
return
|
||||
end
|
||||
|
||||
-- If target and mouseover are friendly units, we can't use spell target as it
|
||||
-- would cast on the target instead of the mouseover. However, if the mouseover
|
||||
-- is friendly and the target is not, we can try to obtain the best unitstring
|
||||
-- for the later SpellTargetUnit() call.
|
||||
local unitstr = not UnitCanAssist("player", "target") and UnitCanAssist("player", unit) and GetUnitString(unit)
|
||||
|
||||
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
|
||||
-- Macro path: switch target so the macro's spell calls land on `unit`,
|
||||
-- then restore.
|
||||
local restore_target = not UnitIsUnit("target", unit)
|
||||
if restore_target then TargetUnit(unit) end
|
||||
func()
|
||||
if restore_target then TargetLastTarget() end
|
||||
end
|
||||
end)
|
||||
+16
-49
@@ -38,38 +38,6 @@ pfUI:RegisterModule("player", function ()
|
||||
playerFrame.myclass = myclass
|
||||
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
|
||||
local function cfgColorToHex(colorStr)
|
||||
if not colorStr or colorStr == "" then return nil end
|
||||
@@ -98,26 +66,25 @@ pfUI:RegisterModule("player", function ()
|
||||
if not cfg then
|
||||
return
|
||||
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 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("")
|
||||
return
|
||||
end
|
||||
|
||||
local haste = GetUnitField("player", "modCastSpeed")
|
||||
local modCastingTime = playerFrame.modCastingTime or 1
|
||||
local text = ""
|
||||
|
||||
if isSpellCaster and haste then
|
||||
if showHaste and isSpellCaster and haste then
|
||||
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)
|
||||
elseif hasteMode == "2" then
|
||||
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / (haste * modCastingTime) - 1) * 100)
|
||||
end
|
||||
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / haste - 1) * 100)
|
||||
end
|
||||
|
||||
if showSP and isSpellCaster then
|
||||
@@ -151,21 +118,21 @@ pfUI:RegisterModule("player", function ()
|
||||
end
|
||||
|
||||
-- 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
|
||||
local originalOnUpdate = pfUI.uf.player:GetScript("OnUpdate")
|
||||
pfUI.uf.player:SetScript("OnUpdate", function()
|
||||
if (this.throttleTick or 0) > GetTime() then
|
||||
return
|
||||
end
|
||||
this.throttleTick = GetTime() + 0.05 -- Default: 20 FPS
|
||||
if (this.throttleTick or 0) > GetTime() then return end
|
||||
this.throttleTick = GetTime() + 0.05
|
||||
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
|
||||
|
||||
-- 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
|
||||
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 }
|
||||
for id, text in pairs(UnitPopupMenus["SELF"]) do
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ pfUI:RegisterModule("raid", function ()
|
||||
this.pendingUpdate = nil
|
||||
|
||||
-- don't proceed without raid
|
||||
if not UnitInRaid("player") then return end
|
||||
if not IsInRaid() then return end
|
||||
|
||||
-- clear all existing frames
|
||||
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")
|
||||
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
|
||||
if pfUI.castbar and pfUI.castbar.player then
|
||||
chat:AddMessage(" |cff00ff00Castbar|r: Available for indicator anchoring")
|
||||
|
||||
@@ -943,7 +943,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
|
||||
CreateBackdropShadow(AtlasLootTooltip)
|
||||
|
||||
if pfUI.eqcompare then
|
||||
HookScript(AtlasLootTooltip, "OnShow", pfUI.eqcompare.GameTooltipShow)
|
||||
pfUI.eqcompare.HookTooltip(AtlasLootTooltip)
|
||||
HookScript(AtlasLootTooltip, "OnHide", function()
|
||||
ShoppingTooltip1:Hide()
|
||||
ShoppingTooltip2:Hide()
|
||||
@@ -1182,7 +1182,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
|
||||
-- use pfUI frames to draw healComm predictions
|
||||
local pfHookHealCommSendAddonMessage = HealComm.SendAddonMessage
|
||||
function HealComm.SendAddonMessage(this, msg)
|
||||
if not UnitInRaid("player") and GetNumPartyMembers() < 1 then
|
||||
if not IsInGroup() then
|
||||
libpredict:ParseChatMessage(UnitName("player"), msg, "HealComm")
|
||||
end
|
||||
pfHookHealCommSendAddonMessage(this, msg)
|
||||
|
||||
@@ -233,6 +233,14 @@ pfUI:RegisterModule("tooltip", function ()
|
||||
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 >= 1000 then hp = round(hp / 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
|
||||
local function pfUIHandlesGroupOrRaid()
|
||||
local disabled = C["disabled"] or {}
|
||||
if GetNumRaidMembers() > 0 then
|
||||
if IsInRaid() then
|
||||
if not C.unitframes.raid then return false end
|
||||
-- Hide Turtle frames if: pfUI raid module is active, OR player disabled visibility
|
||||
if disabled["raid"] == "1" then
|
||||
|
||||
@@ -27,7 +27,7 @@ do
|
||||
-- ClassicAPI dependency check.
|
||||
-- pfUI relies pervasively on the modern C_* / SuperWoW / nameplate / focus
|
||||
-- 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_WEBSITE = "https://github.com/brues-code/ClassicAPI"
|
||||
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
|
||||
@@ -102,6 +102,10 @@ pfUI.version = {}
|
||||
pfUI.hooks = {}
|
||||
pfUI.env = {}
|
||||
|
||||
pfUI.events = Mixin({}, CallbackRegistryMixin)
|
||||
pfUI.events:OnLoad()
|
||||
pfUI.events:SetUndefinedEventsAllowed(true)
|
||||
|
||||
-- check if macro addons are loaded (disables macrotweak/macroscan)
|
||||
function pfUI:MacroAddonsLoaded()
|
||||
return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")
|
||||
|
||||
@@ -2,25 +2,13 @@ pfUI:RegisterSkin("Character", function ()
|
||||
local rawborder, border = GetBorderSize()
|
||||
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
||||
|
||||
-- Compatibility
|
||||
if PlayerTitleDropDown then -- tbc, wotlk
|
||||
-- Character Tab
|
||||
SkinDropDown(PlayerTitleDropDown)
|
||||
PlayerTitleDropDown:SetPoint("TOP", CharacterLevelText, "BOTTOM", 0, -2)
|
||||
PlayerTitleDropDownText:SetPoint("LEFT", PlayerTitleDropDown.backdrop, "LEFT", 6, 2)
|
||||
SkinDropDown(PlayerStatFrameLeftDropDown)
|
||||
SkinDropDown(PlayerStatFrameRightDropDown)
|
||||
-- Honor Tab
|
||||
StripTextures(HonorFrame)
|
||||
StripTextures(ArenaFrame)
|
||||
|
||||
-- Honor Tab
|
||||
StripTextures(PVPFrame)
|
||||
else -- vanilla
|
||||
-- Honor Tab
|
||||
StripTextures(HonorFrame)
|
||||
|
||||
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
|
||||
CreateBackdrop(HonorFrameProgressBar)
|
||||
HonorFrameProgressBar:SetHeight(24)
|
||||
end
|
||||
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
|
||||
CreateBackdrop(HonorFrameProgressBar)
|
||||
HonorFrameProgressBar:SetHeight(24)
|
||||
|
||||
local magicResTextureCords = {
|
||||
{0.21875, 0.78125, 0.25, 0.3203125},
|
||||
@@ -148,22 +136,19 @@ pfUI:RegisterSkin("Character", function ()
|
||||
end
|
||||
end
|
||||
|
||||
HookScript(CharacterFrame, "OnShow", function()
|
||||
hooksecurefunc("CharacterFrame_OnShow", function()
|
||||
RefreshCharacterSlots()
|
||||
RefreshPetPosition()
|
||||
end)
|
||||
|
||||
if not this.hooked then
|
||||
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
||||
-- update only character slots!
|
||||
if string.find(this:GetName(), "^Character.-Slot$") then
|
||||
RefreshCharacterSlot(this)
|
||||
end
|
||||
end)
|
||||
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
||||
this.hooked = true
|
||||
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
||||
if this:GetParent() == PaperDollFrame then
|
||||
RefreshCharacterSlot(this)
|
||||
end
|
||||
end)
|
||||
|
||||
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
||||
|
||||
StripTextures(PaperDollFrame)
|
||||
StripTextures(CharacterAttributesFrame)
|
||||
StripTextures(CharacterResistanceFrame)
|
||||
|
||||
Reference in New Issue
Block a user