Merge remote-tracking branch 'wolfboyft/patch-2' into develop

develop
lethosor 2021-07-05 11:41:37 -04:00
commit fb7560d8bf
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 8 additions and 1 deletions

@ -314,9 +314,16 @@ function ItemTypeDialog(args)
if defcnt > 0 then
for subtype = 0,defcnt-1 do
local def = dfhack.items.getSubtypeDef(itype, subtype)
local text
local success, adjective = pcall(function() return def.adjective end)
if success and adjective ~= "" then
text = " " .. adjective .. " " .. def.name
else
text = " " .. def.name
end
if not filter or filter(itype,subtype,def) then
table.insert(choices, {
icon = '\x1e', text = ' '..def.name, item_type = itype, item_subtype = subtype
icon = '\x1e', text = text, item_type = itype, item_subtype = subtype
})
end
end