Skip to content

Commit

Permalink
Faction Detail Frame - Sorted Rows
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoRogai committed Nov 14, 2024
1 parent 6795ecd commit 1b3ad1c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion RepHub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,20 @@ function RepHub:ShowFactionDetailFrame(factionName)

local factionDetailText = ""

local sortedStandings = {}
table.foreach(
factionData.standings,
function(characterName, standing)
factionDetailText = factionDetailText .. characterName .. ": " .. standing .. "\n"
table.insert(sortedStandings, { ["characterName"] = characterName, ["standing"] = standing })
end
)

table.sort(sortedStandings, function(a, b) return a.standing > b.standing end)

table.foreach(
sortedStandings,
function(k, v)
factionDetailText = factionDetailText .. v.characterName .. ": " .. v.standing .. "\n"
end
)

Expand Down

0 comments on commit 1b3ad1c

Please sign in to comment.