Skip to content

Commit

Permalink
Sort commodity names by translated string
Browse files Browse the repository at this point in the history
- Use translated string rather than translation key for lexicographical sort in system/sector map trade computer widget
  • Loading branch information
Web-eWorks committed Jun 26, 2024
1 parent ad7b33b commit bff8965
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions data/pigui/modules/system-econ-view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function SystemEconView.buildCommodityList(sys, otherSys)
local otherLegal = otherSys and otherSys:IsCommodityLegal(name)

local tab = {
info.l10n_key,
lcomm[info.l10n_key],
legal and sys:GetCommodityBasePriceAlterations(name),
otherSys and otherLegal and otherSys:GetCommodityBasePriceAlterations(name)
}
Expand Down Expand Up @@ -117,7 +117,7 @@ function SystemEconView.buildStationCommodityList(system, station, otherStation)
local otherPrice = otherStation and otherStation:GetCommodityPrice(item)

local tab = {
item.l10n_key,
lcomm[item.l10n_key],
legal and SystemEconView.GetPricemod(item, price) - systemPrice,
legal and otherPrice and SystemEconView.GetPricemod(item, otherPrice) - systemPrice
}
Expand Down Expand Up @@ -154,7 +154,7 @@ end

local function drawCommodityTooltip(info, thisSystem, otherSystem)
ui.customTooltip(function()
ui.withFont(pionillium.heading, function() ui.text(lcomm[info[1]]) end)
ui.withFont(pionillium.heading, function() ui.text(info[1]) end)

local profit = getProfitabilityInfo(info[2], info[3])
if otherSystem and profit then
Expand Down Expand Up @@ -186,7 +186,7 @@ function SystemEconView:drawCommodityList(commList, illegalList, thisSystem, oth
ui.child("CommodityList", Vector2(0, 0), ui.WindowFlags{"NoScrollbar"}, function()
for _, info in ipairs(commList) do
ui.group(function()
ui.text(lcomm[info[1]])
ui.text(info[1])
ui.sameLine(width - iconWidth * 3)

drawIcon(otherSystem and getProfitabilityInfo(info[2], info[3]), iconSize)
Expand Down Expand Up @@ -219,7 +219,7 @@ function SystemEconView:drawCommodityList(commList, illegalList, thisSystem, oth

for _, info in ipairs(illegalList) do
ui.group(function()
ui.text(lcomm[info[1]])
ui.text(info[1])
ui.sameLine(width - iconWidth * 2, 0)

-- only display illegal icon if the commodity is actually legal in the other system
Expand Down

0 comments on commit bff8965

Please sign in to comment.