Note that this still doesn't allow the --upload
functionality to work. After this fix,
wesnoth still complaints about unordered WML.
It is believed that this is a separate issue though,
happened because of the latest simple_wml changes.
The [kill] tag can run animations. But it can also fire the `last breath` event, which can call [kill]. When we get back to the original [kill], the unit is gone, causing an error attempting to run the animations.
Added a check to ensure the unit is still on the map before we attempt to run the animations.
The Issue also requested that [harm_unit] pass the unit causing the harm into the [kill] tag so that `last breath` could use the secondary (killing) unit available like it does elsewhere.
Closes#2298
I also moved the animation to be played *before* healing, which is the same
order as in C++ code. In the previous order, the animation isn't played for
some reason.
Fixes#2295.
send_to_players was only used in the game class implementation. The other two functions were
used in both server.cpp and game.cpp, so it made sense to be declared in server.hpp.
For some damn reason, I needed to specify `game::error` in the global namespace to get this
to build now. No idea why.
It was caused by two independent bugs. Fixing either would have made the
map labels to show up: I fixed both.
First, map_labels::visible_global_label() is intended to check whether any
label from the player's team is shown in a certain position, in order to
check if a global label in the same position can be shown. In the editor,
the "team name" is the empty string - the same as the "team name" for
global labels. As a result, all global labels were considered to be in the
player's team, and therefore every global label was suppressed in favor of
itself.
That wouldn't have been a problem on its own, however. Commit 2fb13f89daa25c8443e537a3cbafb43bb4301b4f
added a check that makes all labels visible in the editor, before checking
if they overlap team labels. The problem was that the check wasn't working.
It's true that there are no teams in the map editor, but the same isn't
true in the scenario editor - and labels can only be placed in the scenario
editor.
I fixed the first problem by checking if there is a viewing team to begin
with, and the second problem by calling display::in_editor() instead of
checking the number of teams.
This reverts commit 252e77443333ba2b0e0b3abbf070ce507d8d33b6. Turns out the key is used
by replays.wesnoth.org and not the client. The name= key accessible otherwise is only
temporary data sent by the server, whereas this key is saved in the replay.
When a host canceled a game and returned to the lobby, they would see their just-closed game briefly
appear in the game list before disappearing again. Upon debugging, I found that the client was receiving
gamelist data that included the closed game. A game-was-deleted diff entry is still sent by cleanup_game.
NE and SE base/standing frames. Defending and pincer-ing animations for both NE- and SE-facing frames. Stinger animation for SE-facing frames. Portrait replaced.
Previously, MP Staging was using connect_engine::connected_users() to fill in the user list.
However, I noticed that the server was already sending the user list to all clients, including
the host, so I could unify the handling between Staging and Join Game by just using the server
data for both.
I've also added appropriate indicators for host, observer, and self in the list for both dialogs.
Additional host= and observer= status keys are sent by the server for that purpose.
I've also made the server dispatch the player list to the host when a game is created. This is
slightly redundant, since the host is the only player at that point, but it's easier than creating
a user config locally, or using connected_users(), not to mention easier to maintain.
The wesnothd::game::send_user_list function no longer exists early id `description_` is null.
No idea why it did that. It's not even used in the function. Anyway, it needed to be removed in
order for the above change to work.
Speaking of the host's copy of the player list, I haven't touched that. It's still needed for
managing things in the connect_engine. Might simplify things further in the future by delegating
more handling to the server, since it has a lot of the data needed already, but that's a different
project.
Clip_rect_setter was implemented incorrectly: it ignored the previous clip
rectangle and sometimes made the clip rectangle *larger* than it was
before. That allowed partially obscured widgets to draw to a larger screen
area than they were supposed to.
Fixes#1583, #1591, #2202.
* Fixed observers not being properly removed from the connected users list if they disconnected.
This fixes#2287. I'm not exactly sure how this was handled before, but I changed the code in
connect_engine to handle the observer_quit signal even if the observer had not been assigned a
side (which it checked for before).
* Fixed an issue where a user would still be marked as connected if they canceled their Faction
selection.
This mostly has to do with moving various components into more logical locations instead of
all mushed together in gui/widgets/settings.*pp. To that end, the following changes have been
made:
* The gui2::init function has been moved to its own file in the gui/ toplevel.
* load_settings() has been merged into init().
* All functions and code relating to gui theme definitions have been moved to their own file.
* All code relating to widgets or window static init have been moved to their own file.
* window::update_screen_size has been moved out of the window class and into settings.cpp.
* The unimplemented free-stadnding version of load_widget_definitions has been removed.
* gui_definition::read and gui_defintion::load have been merged into the gui_definition ctor
and greatly simplified.
* Some functions relating to builder_widgets have been renamed for clarity.
* add/remove_single_widget_defintion now access the current gui theme instead of the default.
This looks like it was a mistake made in the original code.
* Since the static registry is now externally linked, the unit tests accessor for window types
has been removed.
* Documentation has been updated. The wikidoc comment for gui_definition has been removed. It
was rather out-of-date and needed to be reworked anyway.
* widget_builder_func_t's signature is now to take a config reference and not a copy, though
REGISRER_WIDGET had already passed register_builder_widget a lambda that took a reference.
* Various other misc cleanups and improvements.
From @sinda / @singalen commit: suppress unused variable warnings, add test for Lion/Mountain Lion changes for loadNibNamed
Added fixes for new warnings about three macro values deprecated, following suggested replacements from the compiler.
Back in 515f450432cda01d4c I attempted to optimize this, but I didn't do it right. Since I didn't
define a move ctor for canvas, that std::move call was useless and the copy ctor was being called
anyway. Though, that change wasn't a total waste. It still reduced the number of canvases created
from (I think) 3 to 2, since the code was no longer going default-construction
and copy-assignment from the state struct.
These new changes completely remove the canvas object from the state struct. Nothing particularity
special was being done there, only a call to canvas::set_cfg. Instead, the canvas config is saved
in the state objects and then styled_widget initializes the canvas itself. This does mean there's
config copying going on here, sadly, but it's unavoidable given the current design.
This also removes the definition_load_configuration function from styled_widget. Its contents were
moved to the ctor. This ensures only the exact number of canvas objects needed are created. No
copying from the state objects, no reallocations. This also means we can delete the copy ctor (see
below).
A move ctor was added to canvas (though it admittedly isn't needed now since no canvas moving
occurs), and the copy ctor deleted.
It occurred if so many add-ons were installed that the credits text surface
needed to be split to two, and it affected all text until restarting
Wesnoth.
I literally do not remember writing this with the false argument. Anyway, it meant the
screen area was saved in screen coordinates and not pixels, which caused crashes on certain
systems.