- better fix for the bug "briefly empty hex if we must scroll to a
moving unit" than commit 18093.
- avoid the problem which occur when trying to draw orb of moving
temporary unit (see 2007-06-06T09:16:20Z!alinkmaze@gmail.com)
- now the orb+bars are hidden after the end of the inital scrolling
and the start of the move
- add a check for strange 1-hex path
...breaks an assert when do the first fake move in IE1.
I remove it for the moment, because i don't see the error. There is
still a bug with the lich not caused by this commit but maybe related
to the problem.
- show a temporary unit *before* the scrolling, if not we will scroll
to a (briefly) empty hex
- get the starting time *after* the scrolling, if not the animation
will miss the time elapsed
and the unit jump to the current time
- no need to invalidate adjacent hexes after each step, already done
when redrawing units with offset and walking
- the last "else" had no effect
- use set_route(NULL) to clear the path, so invalidate it only if present
- multiline, so the def% is always on center and turns to reach just
below. Also allow next point
- def% is a little bigger, because it's more important and also for
helping the darkening in next point
- def% is slighlty level-colored, but it's hard to choose a good color
scale using a constant brightness currently use the formula : color =
{255 - def, 105 + def, 0} but not very differentiable and a bit darker
...to evaluate the dragging distance
This also remove the previous problem "maximum+abs" with some
compiler, but use power which is supposed safe
Change the dragging threshold from 10px to a little bigger 14px (the
previous diagonal)
Still much smaller than a hex and the idea is that missed drag&drop
are less annoying that unwanted move.
Also move the threshold definition to the top of the file
...in the test-scenario, (but probably elsewhere too) : the unit's
decorations were blitted on the status bar.
So, remove a useless redraw_unit() when WML-create the unit, and
instead use a draw() since the hex was invalidated.
This happened because redraw_unit() was used outside the "clipping
context" of the function to draw a tile.
- fix a bug preventing to scroll to the first unit
- highlight and show in sidebar the chosen unit after the scrolling
(because often lost in a pack of other units)
- if a unit was already selected on the map, pre-select it in the
list. Select the first, if not.
- add a CANCEL button to quicly escape without changing to an other unit.
...similar code to draw text in a hex
add a new function to replace this redundancy (+ some cleaning for
drawing the black border). The function draw_enemies_reach is now
almost empty, so remove it.
No visible change.
* the movement hint now display a "(1)" turn to reach, where the unit
will have no moves left (distance, village or ZoC)
* fixed bug with the number of turns to reach when crossing several ZoC