554 Commits

Author SHA1 Message Date
Chris Beck
8534aa2851 remove unnecessary argument to game_display::scroll_to_leader
The function was requiring a reference to unit map, although
the game_display owns a referece to this, and it was always
called with that instance.
2014-06-08 12:44:03 -04:00
Chris Beck
4e7aa83647 catch exceptions in game_display, game_display::fake_unit dtor's 2014-06-07 23:22:53 -04:00
Chris Beck
df74d891d2 give global fcn's (find/get)_visible_unit a home in game_board
Unit tested and playtested after moving the functions decalarations,
and definitions, adding links to play_controller::game_board from
resources.?pp, and executing find and replace commands:

git grep -lz 'find_visible_unit(' | xargs -0 perl -i'' -pE "s/find_visible_unit\(/resources::gameboard->find_visible_unit\(/g"
git grep -lz 'get_visible_unit(' | xargs -0 perl -i'' -pE "s/get_visible_unit\(/resources::gameboard->get_visible_unit\(/g"
2014-06-01 11:31:47 -04:00
gfgtdf
84556b11fc remove num_turns parameter
this was always equal to level["turns"].to_int(-1) so i replaced it with that.
2014-05-28 04:31:20 +02:00
Chris Beck
3c9844889b Make sure all error logs flush with std::endl, so we get on travis.
This is the result of running this command in directory src/

find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and carefully inspecting the results.
2014-05-20 15:37:52 -04:00
Chris Beck
c5838b9513 inline the definition map_location::null_location
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
2014-05-20 10:42:13 -04:00
Chris Beck
63f4945d9b apply disable_notifications preference in all platforms 2014-04-14 14:32:52 -04:00
aquileia
2f6a6a7d0e move UTF-8 functions to a separate namespace 2014-03-22 20:57:01 +01:00
Chris Beck
ad4c57f22e implement "last 5 chats" notification properly
(fixup 6d460b98271312f806fadfa037b7ea082e862a24)

proper code to find 5'th \n is:

		int endl_pos = -1;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos+1);

and not

		int endl_pos = 0;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos);
2014-03-17 07:50:02 -04:00
Chris Beck
6d460b9827 fix bug #21757
by fixing up bad commit eb9274bd4c78a5f9a86bc9e0bf748f701d81e6b1.

the code to drop messages older than 5 should run inside the if block,
in the scenario when there were previous message, not outside it (!)
2014-03-05 16:06:35 -05:00
Chris Beck
eb9274bd4c linux dbus notifications now remember only last 5 messages 2014-02-28 21:53:45 -05:00
Chris Beck
2ed1338e59 concatenate messages to front rather than end of dbus messages
this is intended to make linux dbus notifications a bit more useful, as it appears on my machine that the current notifications only display the messages in the most distant past...
2014-02-24 01:47:30 -05:00
Mark de Wever
d9a28391ab Use proper Doxygen comment.
The issue was found by Clang 3.4.
2014-01-05 15:44:19 +01:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
fendrin
9a44642689 Save villages and items. 2013-12-21 06:39:48 +01:00
fendrin
c31a065340 Lifted the reach map data structure from game_display to display.
The reach map is useful in the editor as well.
For now the map is used to show the highlighted reach in the minimap if
a unit is selected.
2013-12-05 21:47:27 +01:00
fendrin
eb5bda51a7 Code formating. 2013-10-19 15:13:24 +02:00
Mark de Wever
15cc6a4fab Remove an unused const variable.
The issue was detected by the upcomming Clang 3.4.
2013-10-06 17:37:08 +02:00
Ignacio R. Morelle
ac0e0b74a3 Improve i18n of app notifications on OS X
Some relevant user-facing strings were not marked as translatable.

Caveat: the game_display::send_notification method is designed around
comparing some of the relevant strings. This means that some
functionality may not work properly if the translation language is
changed between notifications. It doesn't seem like anyone considered
this when designing the platform-neutral interface of this
functionality, though, seeing as how there's a call to
game_display::send_notification elsewhere that already uses a localized
argument.
2013-09-13 19:44:02 -03:00
Ignacio R. Morelle
70cd182282 Improve i18n of system tray notifications on Windows
The system tray icon tooltip and some notification headers were not
translatable, which resulted in them being hardcoded to English. Fixed
this by making them translatable.

Caveat: the game_display::send_notification method is designed around
comparing some of the relevant strings. This means that some
functionality may not work properly if the translation language is
changed between notifications. It doesn't seem like anyone considered
this when designing the platform-neutral interface of this
functionality, though, seeing as how there's a call to
game_display::send_notification elsewhere that already uses a localized
argument.
2013-09-13 19:44:02 -03:00
Alexander van Gessel
38b224c1ff Revert "Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old""
This reverts commit 23b72d6956e6316f8b50a6accba607f66cf197a7.
2013-08-09 00:13:46 +02:00
Thibault Févry
23b72d6956 Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old"
This reverts commit 5fa5c034110c3c942d299c8fd440297c89aca037, reversing
changes made to 06374c64ba00977a4f720a44108593fc43d5c787.
2013-08-08 18:50:46 +02:00
fendrin
7614195710 lifted parse_team_overlays from game_display to display.
This is part of makeing [item] and other overlays work in the editor.
2013-07-20 15:59:28 +02:00
Alexander van Gessel
38e9c55367 Don't show various interface elements on the map when you can't interact
Part of bug #16350 by eleazar.
2013-06-24 01:02:29 +02:00
fendrin
20ef5c1e94 Fix spelling in comments. 2013-06-15 21:41:34 +02:00
Alexander van Gessel
bab455dc8c Recolor new hex cursors for yours/enemy/ally/empty 2013-06-15 03:22:45 +02:00
Alexander van Gessel
38403216c8 Add 'yours' hover-hex version 2013-06-11 04:08:48 +02:00
Alexander van Gessel
823abf8e14 Use split enemy hover-hex image 2013-06-11 03:47:31 +02:00
Alexander van Gessel
7e31d6b632 Use hover-hex-enemy.png over attack targets 2013-06-09 03:21:41 +02:00
fendrin
db9a469310 Implemented the editor item tool. 2013-05-24 05:44:58 +02:00
Maxim Biro
2fc758377a Implementation of notifications for Windows OS. 2013-05-17 17:11:07 -04:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
J. Tyne
713372699d Optimization: Only generate reports if they will be shown somewhere. 2012-10-25 22:45:07 +00:00
Jérémy Rosen
c0287b85ba fix bug #20098 you can't invalidate separately fake and real units,
...they need to be invalidated at the same time
2012-09-09 19:14:09 +00:00
J. Tyne
441aa8cfc5 Consolidate the fake_unit assignment implementations. 2012-08-16 00:42:18 +00:00
J. Tyne
cacbe287bc Fix game_display::fake_unit assignment.
One version left the fake unit in a bad state (not on a display, but recorded
as being on one), and the other failed to keep the fake unit on a display,
even though the comments indicated it did.

With this change, the display is preserved over assignment, which is consistent
with the copy constructor and the documentation for assigning a unit to a fake.
It is not easy to preserve the fake_unit's position in the deque, and currently
no benefit in trying to, so that part of the documentation has been changed.
2012-08-12 22:38:32 +00:00
J. Tyne
5b04a3e07c fake_unit: Inlining the constructors and cleaning up some Doxygen comments. 2012-08-12 22:01:53 +00:00
J. Tyne
1bb57c95da Fix: a fake_unit would lose its exception safety if operator= was used. 2012-08-12 21:20:03 +00:00
Fabian Müller
179c251d96 Implemented the village ownership editor tool. 2012-07-27 13:34:00 +00:00
Sergey Popov
6b6eafb213 Use BOOST_FOREACH directly instead of #define foreach BOOST_FOREACH
The define is extremely unreliable, will break compile with boost >=
1.50 and upstream can't fix issues with it, see
https://svn.boost.org/trac/boost/ticket/6131
2012-07-07 00:49:45 +00:00
Gabriel Morin
0cb4a6eaf4 Ensure all pointers in resources.cpp are initialized as NULL.
Then rely on resources::whiteboard being NULL to detect whether WB is
initialized. Fixes bug #19632.
2012-04-11 00:11:08 +00:00
Mark de Wever
c198d1f039 Use empty() instead of comparing size() with 0.
Issue found by cppcheck.
2012-04-08 08:11:57 +00:00
Gabriel Morin
49851c2805 Changed the method for fading out units that have planned moves...
...to a somewhat safer one: I apply the "ghosted" animation right
before drawing happens and remove it afterwards. Fixes bug #19619.
2012-04-05 11:04:26 +00:00
Fabian Müller
72fc103fe9 Lifted unit drawing from game_display to display. 2012-03-31 18:16:27 +00:00
Mark de Wever
d773fc7990 Strip trailing whitespace. 2012-02-06 20:27:34 +00:00
Ignacio R. Morelle
1852dcd2b3 Do not require restarting Wesnoth to disable or enable...
...desktop notifications

(noted by un214 on IRC)
2012-01-25 04:30:21 +00:00
Gabriel Morin
31a49ecb3f Display terrain % and various other marks when creating multi-turn moves.
Fixes bug #18635.
2012-01-21 23:16:12 +00:00
Simon Forsyth
702d49cd0f Make gold hex cursor appear above all terrain when no unit visible
Fixes one of the issues identified in

http://forums.wesnoth.org/viewtopic.php?f=4&t=35886
2012-01-14 22:49:39 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00