65826 Commits

Author SHA1 Message Date
Celtic Minstrel
18b7549cdc Fix unit tests 2016-09-08 03:10:38 -04:00
Celtic Minstrel
045521d5f6 Make ;choose_level work in tutorial and test scenarios 2016-09-08 02:24:18 -04:00
Celtic Minstrel
d0906ceac5 Refactor titlescreen loop so that it redraws properly behind other dialogs 2016-09-08 02:24:16 -04:00
Celtic Minstrel
da437f74ca Allow GUI2 dialogs to disable the default dialog plugins context 2016-09-08 02:24:14 -04:00
Celtic Minstrel
e32b88568e Use loading screen instead of network transmission screen when connecting to the MP server 2016-09-08 02:24:13 -04:00
Celtic Minstrel
abdba44e73 Enable navigating menus with the arrow keys 2016-09-08 02:24:10 -04:00
Celtic Minstrel
fbdceb9fc6 Make listboxes accept arrow key input when no item is selected
The left and up arrow keys select the last item in the listbox.
The right and down arrow keys select the first item in the listbox.
2016-09-08 02:24:08 -04:00
Celtic Minstrel
d8de472a57 Make tgenerator::get_item_shown also check the grid visibility
All but two calls to this function manually checked the visibility,
so it seemed logical to roll the check into this function.

For the other calls, it seems like it wouldn't matter too much,
except maybe in rare edge cases
2016-09-08 02:24:07 -04:00
Celtic Minstrel
da92ac0635 Fix empty else warning 2016-09-08 02:24:06 -04:00
Celtic Minstrel
b4daf7e1dd Fix some build issues and minor cleanup of dialog field registration API 2016-09-08 02:22:27 -04:00
Charles Dang
6aee108298 loadgame: replaced individual flag getters with data struct getter 2016-09-08 12:37:43 +11:00
Charles Dang
84de6bafb1 Unit Attack: minor cleanup 2016-09-08 12:31:21 +11:00
Charles Dang
8c270f9081 Slightly hacky attempt to make disabled weapons check context-aware 2016-09-08 12:25:07 +11:00
Charles Dang
a0453ad5d7 Don't show Attack dialog if all attacker weapons are disabled 2016-09-08 11:11:40 +11:00
Charles Dang
276047ce96 Preferences Dialog: tweaked some labels in Friends List view 2016-09-08 10:31:18 +11:00
Charles Dang
969018f7df MP Create: make use of window exit hook for showing the difficulty dialog 2016-09-08 10:30:07 +11:00
Charles Dang
d858c6b739 GUI2/Window: implement dialog exit hooks
These differ from post_show events, which are part of tdialog and show after the window has closed.
Nothing in post_show can stop the dialog closing. This new exit hook functionality allows setting of
functions that fire before a window attempts to close by any method, and can halt the order.

This is much simpler than attempting to hook into every closure source on a per-dialog basis.
2016-09-08 10:27:45 +11:00
Charles Dang
67f3113808 Unit Attack: attempt to fix disabled weapons showing 2016-09-08 09:00:44 +11:00
Charles Dang
a0ad80299b Fixed a bunch of issues with game loading
* If no game was show in the dialog (due to an invalid filter) one could still use Enter to load a game
* In the same situation above, ESC would cause a crash
* Canceling the Select Difficulty dialog would still try to load a game
  This might have been the intended behavior, but it's not optimal.
2016-09-08 07:50:51 +11:00
Charles Dang
9ea794e5a4 Listbox: added getter to check if any row is visible 2016-09-08 07:43:45 +11:00
Charles Dang
a281e16bc4 Something else I forgot to commit with 5ee75aa473be 2016-09-07 19:03:36 +11:00
ln-zookeeper
15241cd0a6 Convert remaining – to × in strings describing attack stats 2016-09-07 10:43:30 +03:00
Charles Dang
0034c8a378 Cleaned up includes 2016-09-07 17:55:00 +11:00
Charles Dang
6f510ad07d Forgot to commit some WML for 5ee75aa473be 2016-09-07 17:46:58 +11:00
Charles Dang
8dfaac367b Preferences Dialog: cleaned up Animate Map toggle code 2016-09-07 17:44:33 +11:00
Charles Dang
5ee75aa473 Preferences Dialog: refactored handling of friends list 2016-09-07 17:43:40 +11:00
Charles Dang
4f6c8690a2 Preferences Dialog: some cleanup suggested by @celticminstrel 2016-09-07 14:13:01 +11:00
Celtic Minstrel
be7670bea5 Fix [modify_side][ai] again
A logic error caused any added aspects to be mixed together with
existing aspects if it was executed before the AI had been initialized.
This is the cause of the unknown aspect warnings from
GregoryLundberg/wesnoth#28
2016-09-06 21:49:26 -04:00
Celtic Minstrel
7db4527b0f Simplify config::merge_children_by_attribute 2016-09-06 21:49:25 -04:00
Charles Dang
717aa892d2 Preferences Dialog: extensive refactor 2016-09-07 12:23:36 +11:00
Charles Dang
84759a2713 Added flag to register_bool to enable an initial firing of the passed callback event 2016-09-07 10:52:18 +11:00
Charles Dang
df51776780 Added two small features to the status label helper
* Made the first argument twidget instead of twindow to allow passing grids
* Added a 4th argument for label id. Defaults to id + "_label"
2016-09-07 10:51:17 +11:00
Charles Dang
ba81174ade Updated CB projfile 2016-09-07 10:48:26 +11:00
mattsc
e7bd4bc4ef Default AI: fix bug causing units with max_moves=0 not to attack
The support parameter in the attack evaluation quantifies how much
power the AI can bring to an attack hex. This is supposed to include
the attacking unit itself. However, in some circumstances (such as when
the unit cannot move for one reason or another) this unit is not
accounted for. If no other units can get to this hex either, support is
(erroneously) set to zero, resulting in an attack score of zero, which
in turn results in no attack. Skipping the multiplication of the score
by support in this case does not affect comparison with other attacks
here, as this is by definition the only attack possible on the given
hex.

Note that the '!is_surrounded' conditional is also covered by 'support
!= 0' and can therefore be deleted.

This fixes bug #23720.
2016-09-06 16:45:50 -07:00
Celtic Minstrel
8d6e513671 Fix XCode warnings and add missing header ref 2016-09-06 18:48:14 -04:00
Celtic Minstrel
e3346fec78 Update XCode, scons, CMake 2016-09-06 18:26:39 -04:00
Celtic Minstrel
0180a72573 Fix lots of warnings in MSVC12
Some explanations:
- savepng uses setjmp, so I changed it to C; this guarantees that someone does not accidentally introduce a C++ object in it (unlikely though that is)
- The loop in multiplayer.cpp seemed intended to allow the command-line to request repeated plays, so the break was removed rather than refactoring it to an if statement
- Some uninitialized structs were changed to be zero-initialized
- Use luaW_toboolean instead of lua_toboolean
- Needed explicit constructor for vconfig iterators, since their only member is const
2016-09-06 17:55:00 -04:00
Celtic Minstrel
84e1f4ba4d MSVC: Ignore truncated type name warnings 2016-09-06 16:30:01 -04:00
Jyrki Vesterinen
bda24b3f93 Merge pull request #760 from jyrkive/editor-crashes
Fix crash on placing a unit with the scenario editor
2016-09-06 23:27:03 +03:00
Jyrki Vesterinen
e82fc498ac Remove the map parameter from the unit::is_visible_to_team() function
Now when the function receives the entire display_context and can get the
map from there, passing the map separately is unnecessary.
2016-09-06 23:03:10 +03:00
Jyrki Vesterinen
7573678201 Fix crash on placing a unit with the scenario editor
The unit::get_ability_bool() function accessed resources::gameboard that
is not set in the editor. Now the function receives the display context
as a parameter instead.

I also fixed two crashes on editor startup in MSVC debug builds (both
caused by indexing the teams vector when there aren't any teams), and the
GUI2 unit list dialog showing wrong status icons.
2016-09-06 23:03:09 +03:00
Charles Dang
f97dc8ae12 Fire a NOTIFY_MODIFIED in all places tselectable_-inherited classes use a custom callback
These custom callbacks should be refactored out
2016-09-07 07:00:17 +11:00
Celtic Minstrel
206096cc1e Fix ignored qualifiers warning 2016-09-06 12:43:54 -04:00
Celtic Minstrel
60c62bcabc Remove several hotkeys from the titlescreen scope 2016-09-06 12:43:22 -04:00
Celtic Minstrel
91bd6ab6d0 Fix returning invalid unit types (bug #25041) 2016-09-06 11:41:22 -04:00
Celtic Minstrel
b7455d3bd4 Remove suokko AI remnants 2016-09-06 10:29:52 -04:00
Charles Dang
f4ba176e1e Added a single-member group getter 2016-09-06 16:16:30 +11:00
Charles Dang
9918e0e3e8 Faction Select: made use of tgroup::set_member_active 2016-09-06 15:48:34 +11:00
Charles Dang
e6b0d1e841 Unit Create: don't show invalid gender options for the selected type 2016-09-06 15:45:43 +11:00
Charles Dang
41b254da31 Unit Type: implement helper to get whether a type has a specific gender variation 2016-09-06 15:33:02 +11:00