diff --git a/api/config.lua b/api/config.lua index 74427087..d5f67302 100644 --- a/api/config.lua +++ b/api/config.lua @@ -785,6 +785,8 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("tooltip", nil, "itemid", "0") pfUI:UpdateConfig("tooltip", nil, "movespeed", "0") pfUI:UpdateConfig("tooltip", nil, "aurasource", "0") + pfUI:UpdateConfig("tooltip", nil, "spellid", "0") + pfUI:UpdateConfig("tooltip", nil, "unitid", "0") pfUI:UpdateConfig("tooltip", nil, "showbuffs", "0") pfUI:UpdateConfig("tooltip", nil, "alpha", "0.8") pfUI:UpdateConfig("tooltip", nil, "alwaysperc", "0") diff --git a/modules/gui.lua b/modules/gui.lua index fd0217df..9d873b1e 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2773,20 +2773,22 @@ pfUI:RegisterModule("gui", function () CreateConfig(nil, T["Status Bar Texture"], C.tooltip.statusbar, "texture", "dropdown", pfUI.gui.dropdowns.uf_bartexture) CreateConfig(nil, T["Items"], nil, nil, "header") - CreateConfig(nil, T["Show Item IDs"], C.tooltip, "itemid", "checkbox") CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "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 Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox") + CreateConfig(nil, T["Show Item IDs"], C.tooltip, "itemid", "checkbox") CreateConfig(nil, T["Spells"], nil, nil, "header") CreateConfig(nil, T["Show Aura Caster"], C.tooltip, "aurasource", "checkbox") + CreateConfig(nil, T["Show Spell IDs"], C.tooltip, "spellid", "checkbox") CreateConfig(nil, T["Units"], nil, nil, "header") 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 Movement Speed"], C.tooltip, "movespeed", "checkbox") CreateConfig(nil, T["Show Unit Buffs"], C.tooltip, "showbuffs", "checkbox") + CreateConfig(nil, T["Show Unit IDs"], C.tooltip, "unitid", "checkbox") end) CreateGUIEntry(T["Castbar"], T["General"], function() diff --git a/modules/tooltip.lua b/modules/tooltip.lua index a60c50c9..ed366424 100644 --- a/modules/tooltip.lua +++ b/modules/tooltip.lua @@ -273,11 +273,14 @@ pfUI:RegisterModule("tooltip", function () local unit = pfUI.tooltip:GetUnit() pfUI.tooltip:UpdateBuffs(unit) if unit == "none" then - -- process item tooltips if C.tooltip.itemid == "1" and GameTooltip:HasItem() then local _, _, itemID = GameTooltip:GetItem() GameTooltip:AddLine(T["ItemID"] .. ": " .. itemID, .25,.5,1) GameTooltip:Show() + elseif C.tooltip.spellid == "1" and GameTooltip:HasSpell() then + local _, _, spellID = GameTooltip:GetSpell() + GameTooltip:AddLine(T["SpellID"] .. ": " .. spellID, .25,.5,1) + GameTooltip:Show() end return @@ -344,6 +347,13 @@ pfUI:RegisterModule("tooltip", function () end end + if C.tooltip.unitid == "1" and not UnitIsPlayer(unit) then + local npcID = C_CreatureInfo.GetCreatureID(UnitGUID(unit)) + if npcID then + GameTooltip:AddLine(T["UnitID"] .. ": " .. npcID, .25,.5,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 @@ -352,16 +362,22 @@ pfUI:RegisterModule("tooltip", function () GameTooltip:Show() end - if C.tooltip.aurasource == "1" then + if C.tooltip.aurasource == "1" or C.tooltip.spellid == "1" then hooksecurefunc(GameTooltip, "SetUnitAura", function(self, ...) local aura = C_UnitAuras.GetAuraDataByIndex(unpack(arg)) if not aura then return end - local caster = aura.sourceUnit and UnitName(aura.sourceUnit) - if not caster and aura.sourceGUID then - caster = UnitNameFromGUID(aura.sourceGUID) + if C.tooltip.aurasource == "1" then + local caster = aura.sourceUnit and UnitName(aura.sourceUnit) + if not caster and aura.sourceGUID then + caster = UnitNameFromGUID(aura.sourceGUID) + end + if caster and caster ~= "" then + self:AddLine(T["Cast by"] .. ": " .. caster, .25,.5,1) + end + end + if C.tooltip.spellid == "1" then + self:AddLine(T["SpellID"] .. ": " .. aura.spellId, .25,.5,1) end - if not caster or caster == "" then return end - self:AddLine(T["Cast by"] .. ": " .. caster, .7, .7, 1) self:Show() end) end