Was an old bug, thus can possibly introduce unexpected sighted events
sequence for complex and unclean WML (all at the same time and sources
may be far).
PS: I wait to validate the core idea before trying more optimization/cleaning
...separating it from the main unit_type list (this also replaces
alink's fix a short while ago). The dummy unit_type is necessary if we
face units that don't belong to the currently loaded era (like for
example while in the savegame load dialog).
* 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.