57309 Commits

Author SHA1 Message Date
Ignacio R. Morelle
d0d95f2f9f wam: Use a tuple for the --change-passphrase argument's metavar
Fixes its help entry looking like this:

>  --change-passphrase ADD-ON OLD NEW ADD-ON OLD NEW ADD-ON OLD NEW
>                        Change the passphrase for ADD-ON from OLD to NEW

When it really should look like this:

>  --change-passphrase ADD-ON OLD NEW
>                        Change the passphrase for ADD-ON from OLD to NEW
2014-06-12 00:27:20 -04:00
Ignacio R. Morelle
e057cd3b81 campaignd: A few style consistency fixes I missed before
Spacing, unary & positioning, and static functions vs. anonymous
namespace functions.
2014-06-11 23:23:01 -04:00
Ignacio R. Morelle
610070e4e4 campaignd: Don't use GUI1 markup in [upload] response
Wesnoth 1.7.x and later use a GUI2 code path to display the [upload]
response message, which means GUI1 markup won't work with it. They do
not enable Pango markup either, and in any case, formatting messages
properly should be the client's responsibility, not the server's.

Perhaps later we should allow including a secondary message in the
response or something like that.
2014-06-11 23:11:50 -04:00
Ignacio R. Morelle
f9936f12e4 Merge pull request #202 from aquileia/VC_update
Update VC project
2014-06-11 22:57:15 -04:00
Ignacio R. Morelle
e122da96e4 update_server: Use $HOME/source for SOURCE_ROOT
... instead of hardcoding a path in /usr. This should let server2 and
server3 use an unmodified copy of the script.
2014-06-11 22:53:38 -04:00
Ignacio R. Morelle
9b065fd9a0 gui2/tchat_log: Add a button to copy the filtered page contents to clipboard
This copies the current contents of the dialog to clipboard. The button
currently lacks a tooltip because the tooltip has the potential to cause
map labels to glitch through the dialog when displayed (see commit
eab3e6fb646fda8cc6101a3e568c86c2b17b707f and bug #22176).
2014-06-11 20:32:42 -04:00
Ignacio R. Morelle
913333e3ef gui2/tchat_log: Refactor log formatting and page extents calculation
This functionality will be shared with a new Copy to Clipboard button
and its callback in the next commit, so it has to be refactored so that
we don't wind up with duplicate code. This is also why
gui2::tchat_log::model::stream_log() now has a 'raw' parameter which
defaults to 'false'.

I couldn't resist the temptation so I added some const specifications to
a few write-once variables, in particular those that ended up in
gui2::tchat_log::controller::calculate_log_line_range().

While I didn't change any existing behavior (to my knowledge, anyway), I
changed the algorithm for the 'count_of_pages' value as follows:

  // Before:
  count_of_pages = model_.count_of_pages() != 0
                   ? model_.count_of_pages()
                   : 1;
  // After:
  count_of_pages = model_.count_of_pages() >= 1
                  ? model_.count_of_pages()
                  : 1;

I don't believe model_.count_of_pages() can yield a value less than
zero, so this shouldn't alter the previous behavior in practice.
2014-06-11 20:32:41 -04:00
Ignacio R. Morelle
acd814f64c CodeBlocks project update 2014-06-11 19:30:43 -04:00
Chris Beck
8e923abeb1 fix compilation 2014-06-11 19:28:51 -04:00
aquileia
7e628340d0 Update VC project 2014-06-12 00:24:08 +02:00
Chris Beck
f698badbd1 team::objectives_changed and countdown ops become mutable
This allows game_board to unfriend both playsingle_controller
and replay_controller, without adding new methods to game_board.

This partially reverts commit
15ed9d186676c56db60e3bd9a3f147b6fdca85a4,

"refactor replay_controller in order to unfriend game_board"
2014-06-11 18:19:28 -04:00
Chris Beck
5b2bf83443 remove unnecessary friend class 2014-06-11 18:06:39 -04:00
Chris Beck
15ed9d1866 refactor replay_controller in order to unfriend game_board 2014-06-11 17:59:13 -04:00
Chris Beck
4ffb2371b2 remove unnecessary friend class 2014-06-11 17:45:20 -04:00
Chris Beck
359caee9a8 fix a problem where :cl command caused campaign to end
Suggested by gfgtdf on irc.
2014-06-11 17:30:33 -04:00
Chris Beck
ac44e80a25 Merge branch 'game_map_scoped_ptr_in_game_board' 2014-06-11 16:16:18 -04:00
Ignacio R. Morelle
6757d25af1 Improve formatting of the MP save/replay warning for Load Game
Sadly, not backport-able to 1.12.
2014-06-11 16:06:18 -04:00
Chris Beck
a16ed4ccfd fix compilation 2014-06-11 15:37:22 -04:00
Boldizsár Lipka
42bb7378bd Guard occurences of ttexture with an #if. 2014-06-11 22:59:55 +02:00
Chris Beck
c88b64be23 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-11 14:51:43 -04:00
Boldizsár Lipka
4a179629c4 Load the logo from the texture cache. 2014-06-11 22:49:37 +02:00
Boldizsár Lipka
aaf3afff1d A function to get textures from the cache. 2014-06-11 22:49:37 +02:00
Boldizsár Lipka
d7026648f7 Color mod functions for ttexture. 2014-06-11 22:49:36 +02:00
Boldizsár Lipka
d80b4788fe Add texture caches. 2014-06-11 22:49:36 +02:00
Boldizsár Lipka
66fdc79e5d Add a function that loads a texture. 2014-06-11 22:49:36 +02:00
Boldizsár Lipka
03c0efe95b Remove twindow::clear. 2014-06-11 22:49:36 +02:00
Boldizsár Lipka
4288e08b04 Better name for twindow::clear(Uint8, Uint8, Uint8, Uint8). 2014-06-11 22:49:36 +02:00
Chris Beck
656870ca64 move parse_location_range to map:: object
This function required the use of resources::game_map, so properly
should be a method of game_map. This will help us to make sure that
such functions work when using either the editor or the play
controller, or the replay controller, and generally improve
encapsulation.
2014-06-11 14:50:07 -04:00
Chris Beck
33689f6c7c fixup prior commit 2014-06-11 14:48:19 -04:00
Chris Beck
0d6f146ed3 use disp_context->units() in reports, not resources::units 2014-06-11 14:15:44 -04:00
Chris Beck
d2f35c6082 comment out unused includes 2014-06-11 13:26:10 -04:00
Chris Beck
2bd6520d0c use display_context pointer for reports that need teams 2014-06-11 12:39:07 -04:00
Chris Beck
3b70c87f5b Merge branch 'fixup_segfaulting_editor' 2014-06-11 01:31:25 -04:00
Chris Beck
da552fc10e fixup segfaulting editor, favoring display_context over game_board
Currently, the editor does not generate game_board objects, and
leaves the pointer resources::gameboard null. This commit makes
map_location, reports, and tod_manager, three things used in
editor mode, use the display_context pointer instead of the
game_board pointer. We also move a function to display_context,
which finds a const unit * to a visible unit at a hex.
2014-06-11 01:28:15 -04:00
Ignacio R. Morelle
6558bdc785 campaignd: Write config to disk every ten minutes, not 60 seconds
The 60 seconds value was just intended for internal testing and it
slipped into production by accident.
2014-06-11 00:44:32 -04:00
Chris Beck
126358f50c add display_context pointer to resources
This should be removed soon, it is just a short term corrective
measure for an editor segfault introduced in prior commits. The
plan is to correct the segfaults, then refactor this away.
2014-06-11 00:20:11 -04:00
Chris Beck
e4eb0a3ede use ptr to impl for gamemap in game_board, avoiding map.h include
unit_map is modified in many places that don't normally include
map.hpp, so to avoid doing harm by adding this class, I am making
it hold a scoped pointer to the gamemap instead of an actual
gamemap. This results in very few changes.

- The implementation of game_board has to use the pointer.
- game_board must use copy and swap idiom
- lua get terrain function must pass strings to the game_board,
  not enums, and we parse them as std::strings in game_board
  instead of as c strings in lua api (which was a bit gross anyhow)
2014-06-10 23:23:39 -04:00
Ignacio R. Morelle
1ef59a37d1 THoT S4: Replace the wooden bridge with a stone one per the start dialogue
This commit also rewrites the map to drop the superfluous whitespace per
the changes to the editor in 1.11.x.
2014-06-10 23:12:24 -04:00
Ignacio R. Morelle
52f71d900f Merge branch 'feature/campaignd-refactoring'
Refactors most of campaignd's code to ease future feature additions and
bug fixes, making the code slightly more organized and readable.

No behavior changes expected or observed from the state previous to this
merge.
2014-06-10 22:46:00 -04:00
Ignacio R. Morelle
fb5c5abeff campaignd: Use const references or values where applicable
Some old code used copies or read-write refererences for strings that
are never deliberately modified afterwards; and a bit of my own code
gets a (arguably tiny) WML config by value from a method that always
returns a read-only reference, missing out on a tiny optimization
opportunity by avoiding a config copy.

There was also a once-written int variable in handle_request_campaign().
2014-06-10 22:39:33 -04:00
Ignacio R. Morelle
e13570954a campaignd: Code indentation and spacing style changes for consistency
No functional changes.
2014-06-10 22:39:32 -04:00
Ignacio R. Morelle
603c06d1e7 campaignd: Show RO mode warning in load_config() rather than in run() 2014-06-10 22:39:32 -04:00
Ignacio R. Morelle
9b1fd86016 campaignd: Use empty C strings instead of t_strings to clear out attributes 2014-06-10 22:39:32 -04:00
Ignacio R. Morelle
dff480bb07 campaignd: Drop pointless use of lexical_cast to set WML attributes
Since 1.9.x, using lexical_cast to set config attributes is no longer
required and the engine will automatically try to cast string values to
a more "natural" type.

Thus, this commit incurs in no real behavior changes.
2014-06-10 22:39:32 -04:00
Ignacio R. Morelle
7535b916a3 campaignd: Wrap request handler registration statements in macros
This should make it easier to add new handlers or change their API at a
later point.
2014-06-10 22:39:32 -04:00
Ignacio R. Morelle
42ee57c919 campaignd: Move and document more ancillary functions
Since the move is between two files, I took this opportunity to rename
a "campaign" parameter to "addon" and tweak the code style for
consistency.
2014-06-10 22:39:31 -04:00
Ignacio R. Morelle
0d81fae45b campaignd: Move several anonymous namespace members to a new file
This step covers the markup char check function and the add-on feedback
URL formatter.
2014-06-10 22:39:31 -04:00
Ignacio R. Morelle
e5354435b1 campaignd: Refactor construct_message/error() functions and boilerplate
This replaces them with two methods that are part of the server class
itself.

These functions were always used in conjunction with
network::send_data() to send the generated WML object to a network
client. Because the config was created within the functions and not on
the callsite, this resulted in a call to the config copy constructor
that could be avoided by grouping the network::send_data() call together
with the WML generation.
2014-06-10 22:39:31 -04:00
Ignacio R. Morelle
c164cb22b0 campaignd: Refactor request handling blocks into separate methods
These methods are tried and run in sequence by looking them up from a
request handler registry maintained as part of the server object. Since
every campaignd request is a single WML node with an identifying name, I
feel this approach makes things more readable than the previous massive
deeply-nested if-else-if chain approach, but that might be just me.
2014-06-10 22:39:31 -04:00
Ignacio R. Morelle
a8ea4796a0 campaignd: Replace write_config() scheduling mechanism
Check time() deltas instead of incrementing a counter variable forever.
This should allow to extract a bit of the run() logic into a separate
method later.
2014-06-10 22:39:30 -04:00