add docs for creatures search overlay

develop
Myk Taylor 2023-10-07 22:50:31 -07:00
parent 8886cd7e79
commit ab386a0ed2
No known key found for this signature in database
2 changed files with 10 additions and 2 deletions

@ -91,3 +91,11 @@ and "ranged combat potential" are explained in detail here:
https://www.reddit.com/r/dwarffortress/comments/163kczo/enhancing_military_candidate_selection_part_3/ https://www.reddit.com/r/dwarffortress/comments/163kczo/enhancing_military_candidate_selection_part_3/
"Mental stability" is explained here: "Mental stability" is explained here:
https://www.reddit.com/r/dwarffortress/comments/1617s11/enhancing_military_candidate_selection_part_2/ https://www.reddit.com/r/dwarffortress/comments/1617s11/enhancing_military_candidate_selection_part_2/
Creatures overlay
-----------------
The search widget that appears on the "Creatures" info panel sub-tabs (e.g.
"Citizens", "Pets", etc.) can search the lists by name and other shown
attibutes. For example, searching for ``caged`` will show all caged prisoners
on the "Other" tab.

@ -145,14 +145,14 @@ end
local function overall_training_search(data, filter, incremental) local function overall_training_search(data, filter, incremental)
general_search(creatures.atk_index, function(elem) general_search(creatures.atk_index, function(elem)
local raw = df.creature_raw.find(elem) local raw = df.creature_raw.find(elem)
if not raw then return '' end if not raw then return end
return raw.name[1] return raw.name[1]
end, nil, data, filter, incremental) end, nil, data, filter, incremental)
end end
local function assign_trainer_search(data, filter, incremental) local function assign_trainer_search(data, filter, incremental)
general_search(creatures.trainer, function(elem) general_search(creatures.trainer, function(elem)
if not elem then return nil end if not elem then return end
return ('%s %s'):format(dfhack.TranslateName(elem.name), dfhack.units.getProfessionName(elem)) return ('%s %s'):format(dfhack.TranslateName(elem.name), dfhack.units.getProfessionName(elem))
end, nil, data, filter, incremental) end, nil, data, filter, incremental)
end end