Commit 1dd79561 authored by Robin Schoonover's avatar Robin Schoonover

Add Faction ID for reputation detail frame.

parent 54b5abc1
Pipeline #186 passed with stage
......@@ -17,19 +17,40 @@ function addon:AddIDLine(tip, ...) -- idname, id
end
end
local tmp = {}
function addon:IDLine(...)
wipe(tmp)
for i = 1,select("#", ...),2 do
local name, id = select(i, ...)
if id then
tinsert(tmp, format("|cff33cc44%s ID:|r %s", name, id))
do
local tmp = {}
function addon:IDLine(...)
wipe(tmp)
for i = 1,select("#", ...),2 do
local name, id = select(i, ...)
if id then
tinsert(tmp, format("|cff33cc44%s ID:|r %s", name, id))
end
end
if #tmp > 0 then
return table.concat(tmp, " / ")
end
end
end
do
local tmp = {}
function addon:TextAppendID(fs, ...)
local line = self:IDLine(...)
local orig = fs:GetText()
if line == fs._alltheid and strfind(orig, line) then
return
end
wipe(tmp)
tinsert(tmp, orig)
tinsert(tmp, "\n")
tinsert(tmp, line)
fs:SetText(table.concat(tmp, ""))
if #tmp > 0 then
return table.concat(tmp, " / ")
fs._alltheid = line
end
end
......
......@@ -7,3 +7,4 @@
AllTheIDs.lua
GameTooltip.lua
PetJournal.lua
ReputationFrame.lua
local addon_name, addon = ...
hooksecurefunc("ReputationFrame_Update", function()
if ReputationDetailFrame:IsShown() then
local selected = GetSelectedFaction()
local _, _, _, _, _, _, _, _, _, _, _, _, _, factionID = GetFactionInfo(selected)
addon:TextAppendID(ReputationDetailFactionDescription, "Faction", factionID)
end
end)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment