label war and hunt trained animals in readable names

develop
Myk Taylor 2023-10-09 17:24:13 -07:00
parent e7c07a2494
commit 61e4432424
No known key found for this signature in database
3 changed files with 7 additions and 1 deletions

@ -64,6 +64,7 @@ Template for new versions:
## Misc Improvements
- `overlay`: allow ``overlay_onupdate_max_freq_seconds`` to be dynamically set to 0 for a burst of high-frequency updates
- `orders`: ``recheck`` command now only resets orders that have conditions that can be rechecked
- `zone`: animals trained for war or hunting are now labeled as such in animal assignment screens
## Documentation

@ -1609,7 +1609,8 @@ Units module
* ``dfhack.units.getReadableName(unit)``
Returns a string that includes the language name of the unit (if any), the
race of the unit, and any syndrome-given descriptions (such as "necromancer").
race of the unit, whether it is trained for war or hunting, and any
syndrome-given descriptions (such as "necromancer").
* ``dfhack.units.getStressCategory(unit)``

@ -1267,6 +1267,10 @@ static string get_caste_name(df::unit* unit) {
string Units::getReadableName(df::unit* unit) {
string race_name = isChild(unit) ? getRaceChildName(unit) : get_caste_name(unit);
if (isHunter(unit))
race_name = "hunter " + race_name;
if (isWar(unit))
race_name = "war " + race_name;
string name = Translation::TranslateName(getVisibleName(unit));
if (name.empty()) {
name = race_name;