Allows an easy fix for 'unit not present or is duplicated' issues
when debug-hopping through campaign scenarios. Enforces uniqueness of
ids (when they're given) of units for the same side while handling
[unit] tags, both in [side][unit], [side] and in [event][unit].
Now there's 'if a unit with same id is in recall list, do a recall
instead of creating new unit'. Also, if the hex is occupied, the unit
will be placed in nearby hex. Thus, find_vacant in [unit] tags is now
obsolete.
A new WML attribute "placement" (default value is 'map,recall' for all
units except leader-given-directly-in-side, for which the default is
'map,leader') governs the way unit will be placed. 'map' means 'place
according to X,Y, if they point at a valid on-map location', 'leader'
means 'place next to leader or next to start position, if there's no
leader on map'. 'recall' means 'place to recall list'. This fixes
(together with fendrin's fixes to WML) bug #14373, bug #14444, bug
#14451, and some of the issues described on forum.
Got rid of many old hacks, including one which will break some UMC:
previously, if there was a leader in recall list, it was used instead
of leader given directly in side. now this behavior happens only if
id's match. Removal of this hack is needed, because, if it had stayed,
it would be not as straightforward to specify multiple leaders per
side when some of them come from previous scenarios, and some of them
come from current scenario.
...since their ranges are overwritten by the shipped ones. In other
words, they will never be used if the new ones are in scope. This also
gets rid of a warning message.
...in [waypoints] x=1,2,... y=1,2,..
Note that if a WML event changes the goto then waypoints are
discarded. This is done by adding an extra last waypoint equal to
goto for consistency check (removed when loading), so WML can still
edit them if needed.
Hiding one row at a time in the game_load dialog, when the filter
resulted in an empty set was slow. Every time a row was hidden the next
row was selected and its callback called. Directly after that the newly
selected row was hidden as well... The speedup is quite noticable.
Before it always "worked" since set_visible in twidget calls
invalidate_layout(). Now only call invalidate_layout() if we failed to
handle the resize ourselves.