Fix a very old bug making the AI rates targets as if they were all
reachable in 1 turn. AI should now prefer targets reachable in 2 turns
against one needing 3 (if same value).
Note that it only affects targets needing more than 1 turn to reach.
This also make "complex targetting" works and should make the AI pick
the best unit to reach the best target (probably begin by sending
scouts grab undefended villages)
...uncovered with the help of Aethaeryn, who provided a test case. The
bug caused the AI, in certain situations, to make weird
shuffle-doing-nothing moves and not seek enemies or their villages
Indeed, if another unit takes the place of the attacker or the
defender (e.g. Trinity scenario K02), the change would go undetected,
hence causing a segfault at attack end.
...light text on dark background.
The current situation (light text on light background) makes it
impossible for people with low contrast sensibility to read the text
of the buttons.
(I suppose the current situation also affects people using poor LCD
displays, since the buttons are usually displayed at the bottom of the
screen, where the contrast for light colors is the worst.)
Uses the new notifications to send the events, this means only the
widget getting or losing the focus gets the event not it's parents.
Also comment out the old code to handle mouse focus.
Mainly sort stats by changing frequency and direct usefulness (+ some
readability concern).
Put level next to XP (as done in recall dialog), MP as first stat
(main use of unit list), use status to separate numbers and make the
large column (traits) in last position. Initial sort by unit type and
add possibility to sort by status.
This makes the sorting a bit more intuitive: user sees different
colors, click on the sorting arrow sorts them by brightness which has
a known meaning from XP bar color (XP needed to level up). Fix bug
#14486.
Make no sense with the current "XP needed for the next level" sorting,
make it even more harder to understand that this order is used, and
using another column as main base to sort the clicked column was bad
UI.
Overall statistics (only for files with a smaller recompressed size):
Original size: 3725 KiB on 74 files
Optimized size: 3300 KiB
Total saving: 425 KiB = 11% decrease
Unify with other unit::generate_* function, also to better show that
it has side-effect.
Spare one useless RNG call when unit_type has only one gender.
...when a valid user animation was available. Detected with drake
on-water anim, but could be triggered by anim animation. Also add a
security against force redraws between the end of a strike and the
next strike