Skip to content

Commit

Permalink
Fix Faction Detail not opening when clicking on a reputation having icon
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoRogai committed Dec 5, 2024
1 parent 663c3d4 commit d0f80be
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions RepHub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,8 @@ end
function RepHub:IconColumnSort(libSt, rowa, rowb, column)
local cellaValue, cellbValue = libSt:GetCell(rowa, column).value, libSt:GetCell(rowb, column).value

local cellaIconPosition = cellaValue:find("\124t ", 1, true)
if cellaIconPosition then
cellaValue = cellaValue:sub(cellaIconPosition + 3)
end

local cellbIconPosition = cellbValue:find("\124t ", 1, true)
if cellbIconPosition then
cellbValue = cellbValue:sub(cellbIconPosition + 3)
end
cellaValue = RepHub:StripIconFromText(cellaValue)
cellbValue = RepHub:StripIconFromText(cellbValue)

if libSt.cols[column].sort == SORT_ASC then
return cellaValue < cellbValue
Expand All @@ -296,6 +289,14 @@ function RepHub:IconColumnSort(libSt, rowa, rowb, column)
end
end

function RepHub:StripIconFromText(text)
local iconPosition = text:find("\124t ", 1, true)
if iconPosition then
text = text:sub(iconPosition + 3)
end
return text
end

function RepHub:GetColoredText(text, color)
return string.format("\124cFF%02X%02X%02X%s\124r", color.r * 255, color.g * 255, color.b * 255, text)
end
Expand Down Expand Up @@ -557,6 +558,7 @@ function RepHub:CreateRepHubFrame()
if realrow then
local rowdata = RepHubTable:GetRow(realrow)
local factionName = RepHubTable:GetCell(rowdata, 1).value
factionName = RepHub:StripIconFromText(factionName)
RepHub:ShowFactionDetailFrame(factionName)
end
end,
Expand Down

0 comments on commit d0f80be

Please sign in to comment.