Skip to content

Commit

Permalink
use itemdef-based item descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jul 6, 2023
1 parent 50c07b2 commit 7a001c0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/caravan/movegoods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MoveGoods.ATTRS {
frame_title='Select trade goods',
frame={w=84, h=45},
resizable=true,
resize_min={h=35},
resize_min={w=81,h=35},
pending_item_ids=DEFAULT_NIL,
}

Expand Down Expand Up @@ -215,12 +215,9 @@ local function get_risky_items(banned_items)
end

local function make_item_description(item_type, subtype)
-- TODO: get a subtype-specific string
local str = string.lower(df.item_type[item_type])
-- if subtype ~= -1 then
-- str = str .. (' (%d)'):format(subtype)
-- end
return str
local itemdef = dfhack.items.getSubtypeDef(item_type, subtype)
return itemdef and string.lower(itemdef.name_plural) or
string.lower(df.item_type[item_type]):gsub('_', ' ')
end

local function get_banned_token(banned_items)
Expand Down

0 comments on commit 7a001c0

Please sign in to comment.