forked from minetest-mods/global_exchange
Compare commits
2 Commits
b22b72f5c2
...
6989f6a00e
Author | SHA1 | Date | |
---|---|---|---|
6989f6a00e | |||
9c8f62320e |
@ -9,14 +9,15 @@ local S = minetest.get_translator("global_exchange")
|
||||
|
||||
-- NALC split() function
|
||||
local function split(str, sep)
|
||||
if not str then return nil end
|
||||
if not str then return "Item doesn't exist" end
|
||||
local result = {}
|
||||
local regex = ("([^%s]+)"):format(sep)
|
||||
for each in str:gmatch(regex) do
|
||||
if #each > 30 then
|
||||
each = string.sub(each, 1, 30).."..."
|
||||
local sub = nil
|
||||
if #each > 34 then
|
||||
sub = string.sub(each, 1, 34).."..."
|
||||
end
|
||||
table.insert(result, each)
|
||||
table.insert(result, sub or each)
|
||||
end
|
||||
return result
|
||||
end
|
||||
@ -50,8 +51,8 @@ local function mk_summary_fs()
|
||||
local all_items = minetest.registered_items
|
||||
for i, row in ipairs(exchange:market_summary()) do
|
||||
local def = all_items[row.Item] or {}
|
||||
add_row(row.Item,
|
||||
split(def.description, "\n")[1] or S("Unknown Item"),
|
||||
add_row(#row.Item > 24 and string.sub(row.Item, 1, 24).."..." or row.Item,
|
||||
split(def.description, "\n")[1] or S("No description"),
|
||||
wear_string(row.Wear),
|
||||
row.Buy_Volume or 0,
|
||||
row.Buy_Max or "N/A",
|
||||
|
@ -53,6 +53,7 @@ Buy Max=Achat Max
|
||||
Sell Vol=Qté vente
|
||||
Sell Min=Vente Min
|
||||
Unknown Item=Item inconnue
|
||||
No description=Pas de description
|
||||
New (-0%)=Neuf (-0%)
|
||||
Good (-10%)=Bon (-10%)
|
||||
Worn (-50%)=Usé (-50%)
|
||||
|
Reference in New Issue
Block a user