unify stress face pens and rewrite arrival sort docs

develop
Myk Taylor 2023-09-09 07:00:17 -07:00
parent 6ec5e0e1a9
commit 9d233e6e34
No known key found for this signature in database
2 changed files with 14 additions and 12 deletions

@ -37,11 +37,14 @@ be effective in the military in their current state (though see "melee
potential" and "ranged potential" sorts below for predictions about future
effectiveness).
The "arrival order" sort shows the order that your dwarves appeared at your
fort. The numbers on the left indicate the relative arrival order, and the
numbers for the most recent migration wave will be colored bright green.
The "arrival order" sorts your citizens according to the most recent time they
entered your map. The numbers on the left indicate the relative arrival order,
and the numbers for the group of dwarves that most recently entered the map
will be at the top and be colored bright green. If you run this sort after you
get a new group of migrants, the migrant wave will be colored bright green.
Dwarves that arrived earlier will have numbers in yellow, and your original
dwarves (if any still survive) will have numbers in red.
dwarves (if any still survive and have never left and re-entered the map) will
have numbers in red.
The "stress" sort order will bring your most stressed dwarves to the top, ready
for addition to a :wiki:`therapy squad <Stress#Recovering_unhappy_dwarves>` to

@ -991,7 +991,7 @@ local function is_unstable(unit)
end
local function is_maimed(unit)
return unit.flags2.vision_missing or
return not unit.flags2.vision_good or
unit.status2.limbs_grasp_count < 2 or
unit.status2.limbs_stand_count == 0
end
@ -1207,14 +1207,13 @@ for idx=0,6 do
end
end
local ASCII_FACE_TILES = {}
for idx,color in ipairs{COLOR_RED, COLOR_LIGHTRED, COLOR_YELLOW, COLOR_WHITE, COLOR_GREEN, COLOR_LIGHTGREEN, COLOR_LIGHTCYAN} do
local face = {}
ensure_key(face, 0)[0] = to_pen{ch=1, fg=color}
ensure_key(face, 0)[1] = to_pen{ch='\\', fg=color}
ensure_key(face, 1)[0] = to_pen{ch='\\', fg=color}
ensure_key(face, 1)[1] = to_pen{ch='/', fg=color}
ASCII_FACE_TILES[idx-1] = face
ensure_key(face, 0)[0] = to_pen{tile=FACE_TILES[idx-1][0][0], ch=1, fg=color}
ensure_key(face, 0)[1] = to_pen{tile=FACE_TILES[idx-1][0][1], ch='\\', fg=color}
ensure_key(face, 1)[0] = to_pen{tile=FACE_TILES[idx-1][1][0], ch='\\', fg=color}
ensure_key(face, 1)[1] = to_pen{tile=FACE_TILES[idx-1][1][1], ch='/', fg=color}
FACE_TILES[idx-1] = face
end
function get_stress_face_tile(idx, x, y)
@ -1223,7 +1222,7 @@ function get_stress_face_tile(idx, x, y)
return x == 0 and y == 1 and DASH_PEN or gui.CLEAR_PEN
end
local val = math.min(6, elem.val)
return (dfhack.screen.inGraphicsMode() and FACE_TILES or ASCII_FACE_TILES)[val][y][x]
return FACE_TILES[val][y][x]
end
function SquadAnnotationOverlay:init()