70899 Commits

Author SHA1 Message Date
Jyrki Vesterinen
d81f230680 Clear unit death animation after killing the unit
This is another and much better way to fix the unit halo remaining.
2017-12-28 12:02:29 +02:00
Jyrki Vesterinen
f50c7d3f2a Revert "Work around unit halo not disappearing with [kill] animate=yes"
This reverts commit 70b468070b71616aa3663088b6ad171391d0c4f0.

As I said in the commit message, the fix is not pretty, and
@CelticMinstrel said in IRC that a different fix would definitely be
better. I'll fix the problem by having an animation automatically
release the unit when done, instead (next commit).
2017-12-28 11:48:12 +02:00
Steve Cotton
1c2968c632 L S8 Give Harper a loyal overlay in Liberty's final scenario
He's been a silver-crowned hero until this scenario, and in
the final scenario he's still loyal with dialogue if he dies,
so make him easily visible to the player.
2017-12-26 08:30:01 -06:00
Jyrki Vesterinen
70b468070b Work around unit halo not disappearing with [kill] animate=yes
The problem was that the kill animation retained a reference to the unit.
Triggering a Lua garbage collection (which destroys the animation object)
fixes it, although it's definitely not a pretty fix.

Closes pull request #2313.
2017-12-25 18:35:01 +02:00
gfgtdf
9cd200032c
fix player not proceeding to next scenario in Low 22
reported on the forum
2017-12-23 20:39:20 +01:00
Rikard Falkeborn
557bbf36ea Make some functions static in display.{cpp,hpp} 2017-12-22 19:48:45 +02:00
Charles Dang
393ac9bd70 Game Events/Manager: refactor event iteration interface
Instead of trying to iterate over two lists at once, just construct a new list of matching
handlers. This should fix #2310 too, since it ensures any additional events added after
iteration begins don't get executed.
2017-12-22 04:14:35 -05:00
Jyrki Vesterinen
e0e59ac463 Fix exception when [harm_unit] is used without an attacking unit
Regression from commit 38e31aa61f60abed71bd266e6d2abe61035805b4.
In particular, it broke WML unit tests.
2017-12-21 20:24:48 +02:00
Wedge009
fd656b61c4
Merge pull request #2309 from jostephd/whiteboard-sp-undo-stack
whiteboard: Don't clear the undo stack in SP mode.
2017-12-21 16:34:37 +11:00
josteph
5858208cf8 whiteboard: Don't clear the undo stack in SP mode.
Fixes #2303.
2017-12-21 02:21:56 +00:00
Vasya Novikov
7be364f3b5 addon_manager: fix append_tag usage
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.
2017-12-20 22:23:53 +02:00
Gunter Labes
0c4ee56eac
Merge pull request #2307 from vn971/not_executable_images
make images not executable
2017-12-20 21:01:08 +01:00
Vasya Novikov
6a1a91cd7c make images not executable 2017-12-20 22:19:35 +03:00
Gregory A Lundberg
38e31aa61f Do not access non-existent unit
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
2017-12-19 15:05:24 -06:00
Jyrki Vesterinen
f064f50f1b [heal_unit]: Turn on floating text with animate=yes
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.
2017-12-18 23:28:45 +02:00
Jyrki Vesterinen
d80d47eb8a [heal_unit]: fix wrong value of "hits" parameter
Only "hit", "miss" and "kill" are allowed.
2017-12-18 22:04:35 +02:00
Gregory A Lundberg
0353242315
DiD S07: Fix Taylor talks to himself
Use an alternate message if the unit spotting us is General Taylor.
2017-12-17 15:24:31 -06:00
jostephd
f76420ba2a Translate damage types in the unit_preview_pane tooltip. (#2296)
Use translations from the "wesnoth" domain because the damage type
strings ("pierce", etc.) aren't available in the "wesnoth-lib"
domain.
2017-12-16 23:28:20 -05:00
Charles Dang
a8663601ef Wesnothd: move some function declarations to more logical places
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.
2017-12-17 14:18:04 +11:00
mattsc
ddc4334143 Update Xcode project 2017-12-16 07:34:28 -08:00
Jyrki Vesterinen
a1fe596cff Fix #2273: map labels aren't drawn in the editor
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.
2017-12-16 17:12:00 +02:00
Charles Dang
ddd8d81d81 Revert "Wesnothd/Game: removed unused mp_game_title attribute from level data"
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.
2017-12-15 23:42:07 +11:00
Charles Dang
8ad14255e1 Wesnothd: fixed outdated game list being erroneously sent to clients on game close
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.
2017-12-15 22:20:40 +11:00
Charles Dang
dd41080a99 Wesnothd/Game: code cleanup
* Range-for
* Auto
* Used simplified index-based for-loops over in-loop index calculation via ptr distance.
* Used shared_ptr::reset
2017-12-15 22:20:05 +11:00
Charles Dang
252e774433 Wesnothd/Game: removed unused mp_game_title attribute from level data 2017-12-15 22:20:05 +11:00
Charles Dang
3e33da7409 Wesnothd/Game: formatting cleanup 2017-12-15 22:20:04 +11:00
doofus-01
8473e49288
Giant Scorpion unit images (#2266)
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.
2017-12-14 19:48:43 -08:00
josteph
d7afadc94b
HttT: Fix OOS when redoing a recall and Li'sar is allied
For #2216.
2017-12-14 14:07:46 -06:00
Gregory A Lundberg
8aabad972a
Document grow_direction
Closes #2293
2017-12-14 13:28:36 -06:00
sigurdfdragon
2e27f05f80 DiD: Fixup MANOR_DOORS macro
Prevent an opened door from being opened again and causing a 'terrain
with a string with more than 4 characters has been found' error.
2017-12-13 22:51:51 -05:00
Charles Dang
ab2cfa0ac2 Fixup 002b1a3c871f (bad indent)
[ci skip]
2017-12-14 11:15:07 +11:00
Charles Dang
002b1a3c87 MP Staging/Join Game: unified player list handling and added player icons
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.
2017-12-14 11:12:49 +11:00
Celtic Minstrel
9c0b304a53
Fix #2281 (lua console formatting can be broken) (#2284) 2017-12-13 08:53:43 -05:00
Jyrki Vesterinen
01a81c2c6d Fix some GUI dialogs that don't fit on screen darkening on redraws
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.
2017-12-12 21:42:02 +02:00
Charles Dang
d2b53f5368 Removed some unnecessary boost includes 2017-12-12 20:10:33 +11:00
sigurdfdragon
1f4416e823 SotA S07: Stylistic fix due to terrain graphics change
Due to terrain Xuce change from hewn cavewall to minewall.
Restores original look. No gameplay changes.
2017-12-11 21:58:46 -05:00
sigurdfdragon
0fde54bf12 TSG S07a: Stylistic fix due to terrain graphics change
Due to terrain Xuc change from hewn cavewall to minewall.
Per discussions on irc, restores original look.
No gameplay changes.
2017-12-11 21:58:23 -05:00
sigurdfdragon
966e76b0fa NR: Stylistic fix due to terrain graphics change
Due to terrain Xuc change from hewn cavewall to minewall.
Minewall looks out of place over chasm, so remove it.
No gameplay changes.
2017-12-11 21:57:43 -05:00
Charles Dang
b889fb86b4 MP: fixed some user list issues
* 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.
2017-12-12 12:22:20 +11:00
Gregory A Lundberg
1253da81e6
Fix warning: missing prototype 2017-12-11 11:32:38 -06:00
Charles Dang
6759f41b1e GUI2: cleaned up and restructured initialization process
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.
2017-12-11 14:49:58 +11:00
Victor Sergienko
2c154b580d Crash in attack_type::matches_filter - impl_unit_attack_match in some scenarios. 2017-12-10 20:17:56 +02:00
Victor Sergienko
e16e4baf79 #2094 Work around a crash on a platforms with (supposedly) some Boost/iconv incompatibility. Specifically, iOS and MacOS/XCode. 2017-12-10 20:17:56 +02:00
Gregory A Lundberg
034ad29a15 Fix Travis
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.
2017-12-10 07:45:58 -06:00
Gregory A Lundberg
bf2d5fa048 Revert "Fix travis osx build."
This reverts commit 489eed776091b65ab3ebe0ade2e1d0405658a375.
2017-12-10 07:45:58 -06:00
Jyrki Vesterinen
b710af1716 Fix #2285: GCC-dev compiler warnings 2017-12-09 18:30:49 +02:00
newfrenchy83
23e358fa07 add major_amla option in amlas (#2268) 2017-12-09 02:18:59 -05:00
Gregory A Lundberg
b7881a0e6e Force linking all widgets
Ensure all GUI2 Widgets are linked into the Wesnoth executable even if there are no specific references to them.
2017-12-08 21:27:40 -06:00
Charles Dang
e4b61eab29 EI: deploy fake shroud overlay in throne room map
[ci skip]
2017-12-07 19:38:06 +11:00
Charles Dang
624cc3b851 Replaced shroud terrain with fake shroud overlay
[ci skip]

Credit to @shikadilord for the idea. The old terrain was kept (hidden) for compatibility.
2017-12-07 19:36:40 +11:00