Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Template for new versions:
- `aquifer`: make ``--skip-top`` and top-relative ``--levels`` take effect for the ``drain``, ``convert``, and ``add`` actions instead of being silently ignored
- `autodump`: ``destroy`` no longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held items
- `buildingplan`: fix "Unlink all" only unlinking some mechanisms (or crashing) when freeing mechanisms from the building
- `sort`: fix the Places/Workshops and task searches missing workshops by their current display names (e.g. "Stoneworker's Workshop", "Screw Press")
- `timestream`: deal properly with units who have breathing difficulties
- `stocks`: overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable

Expand Down
6 changes: 6 additions & 0 deletions plugins/lua/sort/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ local function get_task_search_key(cri_unit)
table.insert(result, bld.name)
local btype = bld:getType()
if btype == df.building_type.Workshop then
-- the display name may differ from the enum item name (e.g.
-- Masons -> "Stoneworker's Workshop") and is the raw-defined
-- name for custom workshops
local name = df.new('string')
bld:getName(name)
table.insert(result, name.value)
table.insert(result, df.workshop_type.attrs[bld.type].name or '')
table.insert(result, df.workshop_type[bld.type])
elseif btype == df.building_type.Furnace then
Expand Down
8 changes: 8 additions & 0 deletions plugins/lua/sort/places.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ local function get_workshop_search_key(workshop)
end

table.insert(result, workshop.name)

-- the display name may differ from the enum item name (e.g. Masons ->
-- "Stoneworker's Workshop") and is the raw-defined name for custom
-- workshops
local name = df.new('string')
workshop:getName(name)
table.insert(result, name.value)

table.insert(result, df.workshop_type.attrs[workshop.type].name or '')
table.insert(result, df.workshop_type[workshop.type])

Expand Down
Loading