not complete, but I stopped pulling the thread before the whole
project unravelled 8)
(1) team and player numbers should be unsigned.
(2) sizes of gui elements should usually be unsigned.
This probably introduced some bugs.
https://gna.org/bugs/index.php?func=detailitem&item_id=4380
This is non-trivial. We don't want to break people's customized
hotkeys, yet we need to change the fundamental way keyhanding works.
Above all, we do not have a keyboard map.
SDL gives the unicode value of the keys pressed, as well as the key
itself and the modifiers. We need to use this unicode value sometimes
(eg. for ':', which is not shift-; on non-US keyboards) and the
keycode at other times (F1 has no unicode value, and shift-space is
the same as space). We do this as follows:
(1) Single-letter keys get treated as the character,
(2) Multi-letter keys (function keys, delete, etc) and space get
treated as the actual key.
However, we want backwards compatibility, so *if* they specify a shift
modifier we fall back to old-style keycode.
Finally, if the control key is pressed we often need to map the
unicode value back to the "raw" value to figure out what the character
is. We only do this if the character value is less than 64: it's
probably not a universal rule.
(Fixes: https://gna.org/bugs/index.php?func=detailitem&item_id=5100 )
- [music_list] now just [music] as it is in event.
- file tag is now name, as in event.
- music events supported
- 'play_once=yes' plays once immediately then resumes playlist
- 'append=yes' required not to overwrite previous playlist entries
- 'immediate=yes' to start playing this track (then rest of playlist)
immediately.
Also, more comments, and play_music_file() changed to play_music_repeatedly().
When calculating paths, we need to differentiate between the team the
unit is on, and the team doing the calculation. These are *different*
for Show Enemy Moves and highlighting enemy units' range: we *know*
they can't walk through our ambush.
In general, checking map.count(loc) != 0 is not the right thing to do,
you should use find_visible_unit(). A player can currently find an
invisible unit on your keep by trying to recall on that hex, for
example, but I consider that too minor to worry about, and difficult
to solve.
(see https://gna.org/bugs/index.php?func=detailitem&item_id=4938).
Scenario files can specify:
[music-list]
file="wesnoth-2.ogg"
ms_before=5000
ms_after=1500
[/music-list]
One or more times. ms_before & ms_after specify the milliseconds of
silence before and after, and are optional (ie. 0 if not specified).
The old "music=" style is still supported if no [music-list] sections
are present.