* Added code allow the mouse the click in a text and set the cursor at the
proper location.
* Added the selection indication.
* Added mouse dragging to select a range.
* Mouse double click selects all (doesn't work due to bug in event code).
* ctrl-C, ctrl-X and ctrl-P do copy paste (doesn't work yet on Mac).
* On UNIX based sytsems select does copy (middle mouse paste doesn't work yet).
* Fixed some minor bugs.
...after reloading a game, "Create Unit" crashes
To reproduce it: start test-scenario, save, reload, create unit, then
crash at dialogs.cpp:995 because the first selected unit is not build.
So I remove the "dummy_unit" from the create unit list.
YogiHH, please review this because I don't know why this "dummy_unit"
is created by reloading game (be we certainly must remove it from this
list)
Special thanks to Chris for spotting very precisely where this bug is
coming from (can you please test this again since you probably can
reproduce best?).
Try to quit a new map with unsaved changes, click "yes I want to
save", then cancel the save dialog (to check or change something
before save/quit)
This causes an exit with the loss of your last changes. Now the
cancel abort the whole exit operation. This is a rare case, so better
ask to quit again than lose work. Also seems to be how other editor
works.
Switch to bitwise operations instead of using SDL_*RGBA operations
Faster and most of our sdl_utils already do that. (SDL_RGBA is maybe
safer for odd channels format, but we don't really use that)
Strangely it seems that someone didn't used the find function of
STL-map and instead checked the whole map until finding a match (but
why using a map then?) Obviously it was very slow (done for each
pixel, costed ~75% of the total time)
...display "Warning: screenshot hotkeys not combined with Control or
Alt keys." Probably need to also allow special keys like functions
keys or PrintScreen and maybe can be used for other game functions
(fullscreen etc...)
...now prefers using empty hexes
This lowers the frequency of blocked units when doing multi-turn moves
(on homogeneous terrains, because MP cost and defense have priority)
and also help a little fog exploration (since you can't stop on friends)
Was a one-liner but did some cleaning and comments.
This unify how leader and units are created and allow WML to define
some of its variables (moves, attacks_left,...) whitout directly
reseting them later.
...units can not attack at the first turn
This restore the previous behavior, give all its attacks to an unit
when key attack_left is missing. Seems not to resurrect bug #11451.
Still another strange thing: at the first turn, we probably must call
new_turn() for every units not only the leader (it's also an
alternative fix)