53875 Commits

Author SHA1 Message Date
flix
301e0d5d43 Fix a bug. 2013-09-24 02:37:20 +02:00
flix
dc72d7b67e Add new recruitment CA.
The Candidate Action is not 'hung in' yet.
2013-09-23 17:50:09 +02:00
flix
4959db0952 Add aspects for new recruitment CA.
The aspects are:
- recruitment_diversity
- recruitment_instructions
- recruitment_more
- recruitment_randomness
- recruitment_save_gold

All aspects will only work with the new recruitment CA (not committed yet).
See http://wiki.wesnoth.org/AI_Recruitment
2013-09-23 17:09:26 +02:00
flix
fb4361d666 Prepare attack.*pp for new recruitment CA.
This includes:
- A new constructor for class battle_context_unit_stats to make simulations work with unit_types,
- Making function combat_modifier() a bit more generic (to specify a custom lawful-bonus),
- Changing method battle_context::better_combat() to be a static method (It doesn't use class-members).
- Adding method unit_type::resistance_against() so a unit_type can evaluate WML-resistance-abilities.
2013-09-23 16:35:07 +02:00
JaMiT
50f97f0534 Fixing compilation issues.
Apparently iterator_extend_base caused more issues than it solved,
so it is gone now.

Also, access to the underlying iterator has been made less roundabout.
2013-09-22 16:34:08 -05:00
Ignacio R. Morelle
1ad6d1cc96 Use std::wstring::c_str() to get null-terminated strings, not data()
The basic_string::data() method does not guarantee the result to be
null-terminated, and passing a non-null-terminated string where a
null-terminated string is expected (i.e. every Win32 API call here)
leads to all kinds of misfortune.
2013-09-22 14:35:23 -03:00
Ignacio R. Morelle
a1d818ecaa Fix instances of 'handle' typoed as 'hanlde' 2013-09-22 14:30:23 -03:00
JaMiT
b9821441a9 No need to search through a container twice. 2013-09-22 12:27:19 -05:00
JaMiT
2401cdba8f const-qualify elements of play_controller::wml_commands_. 2013-09-22 12:10:37 -05:00
JaMiT
22796e208a Have wmi_container::get_item() return an item instead of a pointer.
Now wmi_container is a black box, with no external code concerned
with how it stores its items.
2013-09-22 12:10:36 -05:00
JaMiT
7aeacc554c Remove wmi_container::get_menu_items().
No one needs to get at the underlying implementation anymore.
2013-09-22 12:10:36 -05:00
JaMiT
72f6b5ead6 Add find() and erase() to wmi_container. 2013-09-22 12:10:36 -05:00
JaMiT
dcae119497 Make use of wmi_container's new features. 2013-09-22 12:10:36 -05:00
JaMiT
501581ea74 Turn wmi_container into a container.
This defines some types and functions that come from the STL
definition of a container. It's not complete, though, as I do
not see a reason to define size(), max_size(), or swap() at the
moment. (They would be easy to add, if the need ever arises.)

The new #include file might be useful elsewhere as well. I'll look
into that.
2013-09-22 12:10:36 -05:00
JaMiT
0774ca49f4 Using a typedef to make some code easier to read. 2013-09-22 12:10:35 -05:00
Ignacio R. Morelle
a93a372448 addon/client: Move connection step to a separate member method
This fixes memory leaks or crash-to-desktop (the latter reliably
triggered by Boost 1.54) situations resulting from failed connections to
an add-ons server throwing an exception from the addons_client
constructor, not giving the destructor a chance to run.

Thanks to loonycyborg for helping me diagnose the issue.
2013-09-21 22:08:42 -03:00
JaMiT
52cfe2b17d Eliminate variable::manager.
With the simplification of vconfig, this class no longer serves
a purpose.
2013-09-21 11:41:53 -05:00
JaMiT
919efb4ed5 Localize a static variable to the function where it is used. 2013-09-21 11:41:53 -05:00
JaMiT
acb7e7a6ae New (and simpler) memory management for vconfig.
The old management had potential, but in practice it was rarely in
a position to show off. It ended up doing little more than reference
counting; a shared_ptr can do this with less overhead.
2013-09-21 11:41:52 -05:00
Elvish_Hunter
94c33bf9af wmllint: stop complaining about unknown IDs inside [clear_menu_item] 2013-09-21 10:10:50 +02:00
Andrius Silinskas
4211c20579 Updated changelogs. 2013-09-20 20:09:33 +01:00
Andrius Silinskas
8fa57b4150 Mark "new_game_title" as translatable in wmllint.
Relevant strings were adjusted in LoW.
2013-09-20 19:14:33 +01:00
Andrius Silinskas
50460f2596 Reload game config in mp::wait.
The game config is being reloaded to make sure that players have the
same config as host, if possible.

Note that reloading only happens when it is necessary and it would not
happen if host's cache defines matches the player's ones. I.e. regular
MP scenarios won't trigger a config reload.
2013-09-20 09:08:45 +01:00
Andrius Silinskas
359597921f Fixed game's description in lobby. 2013-09-20 09:08:45 +01:00
Andrius Silinskas
ec2e592dcc Add missing out-of-range checks (mp::wait). 2013-09-20 09:08:45 +01:00
Andrius Silinskas
ee68f99551 Keep default "recruit" for correct faction lists initialization. 2013-09-20 09:08:44 +01:00
Andrius Silinskas
a53a6f5758 Don't count side with controller="reserved" as available. 2013-09-20 09:08:44 +01:00
Andrius Silinskas
1e7668e7ab Revert 0ac9f9c and adjust controllers set up.
The commit was reverted because "allow_player" value is being checked in
other places. This resulted in different default values for
"allow_player" in the different places.
2013-09-20 09:08:44 +01:00
Andrius Silinskas
f8c39ca3f1 Fixed "current_player" being assigned incorrectly (mp::connect_engine).
1st case:
Overwriting "current_player" with default value produces an incorrect
side config and causes the server to not recognize the player if its
username is not the same as "current_player" value. This is not
desirable, since a different player might be assigned to an ex-reserverd
side or a player might just simply change his/her username.

2nd case:
Using default value for "current_player" if no player has taken that
side, results in setting wrong controller in case side was reserved for
host.
2013-09-20 09:08:44 +01:00
Andrius Silinskas
45b84aa4a5 Remove unnecessary check in side_engine::available_for_user().
As a side effect, a network user is able to take a side with
"allow_player=no", if host has started the game with "--debug" command
line argument.
2013-09-20 09:08:44 +01:00
Andrius Silinskas
2932d3088d Fixed non-host players being unnotified about next_scenario data.
The players being unnotified resulted in them being able to press "End
Turn/End Scenario" button and downloading the current scenario data
instead of the next one.

Related code, which was marked as "deprecated", has been removed due to
not actually affecting anything.
2013-09-20 09:08:44 +01:00
Andrius Silinskas
e3ceed9ee2 Use a function to update "End Turn" button's and menu item's state. 2013-09-20 09:08:44 +01:00
Andrius Silinskas
f57b29fc13 Moved level download utility functions to mp::wait. 2013-09-20 09:08:43 +01:00
Andrius Silinskas
7d704687be Added out-of-range check for level selection (mp::create). 2013-09-20 09:08:43 +01:00
Andrius Silinskas
ebc8b3b7f5 Handle observers for non-first "allow_new_game=yes" scenarios. 2013-09-20 09:08:43 +01:00
Espreon
a457455c69 Updated the Vietnamese translation. 2013-09-19 22:05:34 -04:00
fendrin
f5e673e644 Replace all kinds of the constant pi representations.
Replaces every appearance of the circle constant pi I could find with
the representation from boost/math/constants/constants.hpp.
2013-09-19 01:06:55 +02:00
fendrin
66ee6c4857 SUF: New filter "has_variation"; renamed "variation_type"->"variation"
The new has_variation SUF attribute filters if a unit has a variation
child type with the given id. If the unit is a variation itself the
siblings are considered.
2013-09-19 01:06:55 +02:00
fendrin
7e95aa90bb New has_variation(id) method
This method is used for querying if a unit has a certain subtype.
If the unit is a variation itself it checks the siblings.
2013-09-19 01:06:55 +02:00
anonymissimus
c0a24dc4b7 fix warning about unreachable code 2013-09-18 20:13:48 +02:00
anonymissimus
93e28f42f3 fix warnings about unreachable code 2013-09-18 20:13:46 +02:00
Ignacio R. Morelle
1e3e56b699 Updated RELEASE_NOTES for add-ons management improvements 2013-09-18 01:35:44 -03:00
fendrin
dbad165891 Support for variation= in [unit_type]. 2013-09-18 04:40:48 +02:00
fendrin
3c83420483 Filtering for variation_type=. 2013-09-18 04:06:22 +02:00
fendrin
85f84dd383 Documentation and cleanups to the RotSprite methods. 2013-09-18 02:37:13 +02:00
fendrin
80ca05e448 Simplified Rotsprite algorithm.
It is used to perform any kind of rotation with the RS imagepath
function which could only rotate in multiplies of 90 degrees previously.
2013-09-18 02:37:13 +02:00
Espreon
de953ecda5 Updated the British English translation. 2013-09-17 11:06:47 -04:00
Ignacio R. Morelle
2351b07f9e gui2/taddon_filter_option: Various UI layout improvements
* Use "Options" as a dialog title instead of "Filter Options" for
   simplicity and to represent its current functionality better.
 * Limited dialog width to 800 pixels for readability.
 * Replaced neutral sorting options header with something that hopefully
   describes their purpose in a more user-accessible fashion.
 * The installation status options listbox now grows along with its
   containing grid.
 * Ascending/Descending options are placed closer to the sorting
   criterion selection.
 * Description labels use text wrapping when needed.
2013-09-17 04:08:50 -03:00
Ignacio R. Morelle
a16bda37f4 addon/mg: Implement fallback sorting algorithm/direction selection
This replaces the container-driven add-ons list sorting with
std::stable_sort() on a vector for the sake of simplicity, since now
sorting is controlled by user preferences rather than being completely
hard-coded. Alphanumerical sorting by add-on title continues to be the
default option, but now it is also possible to choose between last
upload time sorting (timestamp field in campaignd data) and first
upload order (which is the campaignd WML order, which is artificially
restored using an internal sorting index for now since the std::map
add-ons list optimization causes the campaignd order to be lost in the
pipeline). It is also possible to choose the sorting direction
(ascending or descending).

The full rationale for the whole design follows (also provided in
Doxygen comment form):

"The internal add-ons list is actually implemented employing an
associative container to map individual list entries to add-on ids for
faster look-ups. The visible form of the list may actually include more
elements than just the contents of the add-ons server; more
specifically, it may include Publish and Delete entries for local
add-ons with .pbl files.

The GUI1 list/menu class does not support horizontal scrolling, which
results in a very limited set of information columns that can be
displayed safely without running out of space and causing content to be
omitted, and clicking on any column header to change the sort also
affects the Publish/Delete entries by necessity. These two factors
combined make it inconvenient at this time to just use the GUI1
widget's interface to make it default to a specific sorting criterion.

Thus, we need a 'neutral' or 'fallback' sorting step before feeding the
add-ons list's data to the widget and appending Publish/Delete options
to it. Since this is definitely not the most evident UI concept in use
in this dialog, it is hidden behind the Options dialog and has sensible
defaults intended to optimize the add-ons experience; alphanumerical
sorting feels natural and breaks any illusion of quality rating or any
such that could result from a list default-sorted by first-upload order
as done in all versions prior to 1.11.0."

***

To recapitulate, this is probably the ugliest thing I've ever done, but
those are the limitations imposed by Wesnoth's chronic UI framework
deficiencies.
2013-09-17 03:23:23 -03:00
Ignacio R. Morelle
09ae97d8a6 addon/info: Add artificial upload/creation order index field
This will be used for sorting add-ons by creation/first-upload time
in the add-ons list, since it is currently a map indexing add-ons
by name for performance reasons and otherwise the first-upload order
(determined by the add-ons list WML order as delivered by campaignd)
is completely gone since 1.10.x.
2013-09-16 23:48:45 -03:00