Commit graph

62 commits

Author SHA1 Message Date
Charles Dang
c6bf9359d8 Create Engine: GUI1 markup and include cleanup 2016-11-12 13:02:36 +11:00
Gregory A Lundberg
d31555f8cf Pedantic includes
Change all includes to start at the base instead of assuming the directory where included from.

This makes it more apparent exactly which header has been included, since many have the same name.

This also allows moving all header files out of the src directory.
2016-11-11 11:00:22 -06:00
Celtic Minstrel
10b6a34615 Rename all GUI2 dialogs to drop t- prefix
This also places them in a new dialogs namespace.
2016-11-09 01:27:30 -05:00
Celtic Minstrel
a1967ec16a Rename twml_exception -> wml_exception 2016-11-09 01:17:14 -05:00
Celtic Minstrel
6513d6ac01 fixup! Fix Lua-invoked dialogs not showing before prestart
09d35947f4

The mentioned commit broke the Lua map generator by removing a parameter from an
overridden method. This commit fixes that by removing it from the superclass as well
and cascading that through.

In addition, override annotations have been added to the generators to guard against
similar mistakes in the future.
2016-10-20 03:21:39 -04:00
Charles Dang
b6ea5106ca Moved marked-up_text.*pp to font/ 2016-10-16 22:54:07 +11:00
Charles Dang
ebc8ddfb78 Move certain text constants into the constants file 2016-10-16 22:07:37 +11:00
Charles Dang
9b6fc78690 Revert "MP Create: basic implementation of saved games as their own category (debug only)"
This reverts commit 9a569df848.

This commit somehow causes massive lag when opening the Campaign dialog with a large (several hundred) saves.
Somehow, the save_index was being regenerated every single time a new save was processed, likely due to
the calling of save.summary() in the create_engine initialization loop. It remains to be seen if this is a bug
in the save_index code, which seems possible.

This commit was also likely the cause of bug #25146. While the fix for that might have been simpler (short-circuiting
the campaign type conditional with a savefile corruption check), since this commit has already caused issues, it's
best to revert it and revisit this idea at another time.
2016-10-05 05:53:06 +11:00
Charles Dang
de8a4270a4 Forgot to include this in d88f591eb5 2016-10-02 02:58:57 +11:00
gfgtdf
e8bf29c241 clean some includes
this contains a fix in  playcampaign.cpp where an object was accidently
copied.
2016-09-16 22:35:41 +02:00
Charles Dang
9a569df848 MP Create: basic implementation of saved games as their own category (debug only) 2016-09-08 18:53:58 +11:00
Charles Dang
a232b0c2cb MP Create: disable Settings button if generator doesn't allow settings 2016-09-03 16:47:53 +11:00
Charles Dang
8b60904074 Create Engine: added method to get active mod data 2016-09-02 12:53:50 +11:00
Charles Dang
7ec92eb754 Create Engine: if only one difficulty is defined, use it without a dialog prompt 2016-08-31 10:35:02 +11:00
Charles Dang
88726caebc Fixup typo from 6b3f9d8cbd 2016-08-19 13:41:01 +11:00
Charles Dang
6b3f9d8cbd MP Create: much more efficient method of game filtering 2016-08-19 13:37:23 +11:00
Charles Dang
90c3c05af4 MP Create: improved handling of campaign difficulty selection
Instead of showing the difficulty dialog in post_show and setting the retval to twindow::NONE if the
dialog was canceled, we add a custom exit hook that fires when double clicking the games list or pressing
the Create Game button that shows the dialog instead, and returns if canceled. This is much cleaner.
2016-08-19 12:33:00 +11:00
gfgtdf
f124dd179c gui2 mp create improvements 2016-08-17 14:41:30 +02:00
Jyrki Vesterinen
8d1cb23f82 MP create: fix UB if filter excludes all campaigns/scenarios/maps 2016-08-11 22:41:54 +03:00
Charles Dang
05092ba2f6 Refactor most boost pointer related stuff to use their stdlib counterparts
This constitutes drop-in replacements for:

* boost::shared_ptr
* boost::scoped_ptr
* boost::weak_ptr
* boost::enable_shared_from_this
* boost::static_pointer_cast
* boost::dynamic_pointer_cast

This excludes boost::intrusive_ptr, except for stray includes. Refactoring that is more complicated.
2016-07-25 09:28:42 +11:00
Celtic Minstrel
ca382018b7 BOOST_FOREACH -> range for 2016-04-02 09:38:29 -04:00
Charles Dang
0936066bf3 Fixed initializing of mp scenarios
Was accidentally broken in 876710af8c.
2016-04-01 02:00:23 +11:00
Celtic Minstrel
3ac7f8d970 NULL -> nullptr
A few cases of NULL were missed, since changing them led to errors
(Mainly instances where it was passed to a boost::function)
2016-03-31 00:42:38 -04:00
Charles Dang
876710af8c Use std::to_string() or equivalent wherever possible
This commit removes the utility srt_cast() function and replaces its calls,
along with calls to lexical_cast<std::string>() (and its boost variant),
with std::to_string().

In a few cases where the input type isn't compatible with to_string,
lexical_cast<std::string> is still used.

In other cases where lexical_cast was operating on MAKE_ENUM enums, the
call has been replaced with ENUM::enum_to_string, which is faster.
2016-03-31 11:18:51 +11:00
Celtic Minstrel
bc711f5f43 Consolidate related files into subdirectories 2016-03-20 16:20:09 -04:00
Celtic Minstrel
fe0df45947 Consolidate formula and hotkey files in corresponding dirs 2016-03-20 16:15:50 -04:00
gfgtdf
2369d3f9ae clenaup more includes
this changes some class member types to scoped pointer so that we can
remove an include from the header.
2016-01-16 23:42:02 +01:00
gfgtdf
93c53df6d8 remove display dependency from mp connect code.
and from codes that are used by it, specially the loadgame and the
networkrecieve dialog.
2016-01-12 23:18:01 +01:00
gfgtdf
bb546c17bc remove display dependency from map_generator 2016-01-12 23:11:07 +01:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Elvish_Hunter
9b7b1751fd Removed trailing tabs and whitespaces from C++ source
I used this command line: find <source directory> -name \*.\[ch\]pp -print0 | xargs -0 sed -i 's/[[:blank:]]*$//'
2015-12-21 20:39:46 +01:00
Charles Dang
591b1aa6be Give new [difficulty] tag precedence over old difficulties= syntax 2015-12-16 19:49:20 +11:00
Charles Dang
7a1b5c80ff Fix a crash when entering a campaign with no difficulties provided
The code to guard against an eventuality was hidden inside an if-block that relied
on a specified define index value being passed to select_campaign_difficulty().
2015-12-16 19:47:17 +11:00
gfgtdf
7f13156c28 Revert "Rename team_name/user_team_name to team_id/team_name (old syntax still valid)"
And related commits.

This reverts commit 545253ec2b.
This reverts commit 1215f65eb8.
This reverts commit 11664f4024.
This reverts commit e948df3424.
This reverts commit 3781e7839f.

This commits were reverted to exclude them from wesnoth 1.13.2 release because:
1) We are still unsure about the best name oftthese attributes
2) This breaks multiple campaigns, including LoW and the tutorial.
Feel free to revert this revert after 1.13.2 when thse issues can be solved..
2015-12-10 21:29:52 +01:00
Charles Dang
3781e7839f Rename team_name/user_team_name to team_id/team_name (old syntax still valid) 2015-10-26 00:44:28 +11:00
Charles Dang
bdaddd9a4f New syntax for campaign difficulty
This replaces the old format using the tlegacy_menu_item syntax with a new one using a [difficulty] tag.
The only syntax is still supported for now
2015-09-29 15:35:39 +11:00
Lipka Boldizsár
6d64baa207 Remember modifications separately for sp and mp.
Fixes bug #23617.
2015-07-27 01:27:36 +02:00
gfgtdf
0cd8ea5453 Merge branch 'master' of https://github.com/abacabadabacaba/wesnoth into abacabadabacaba-master
Conflicts:
	changelog
	src/game_launcher.cpp
2015-06-21 17:12:56 +02:00
gfgtdf
87313970e1 fix [modification]type=key
Previous it couldhappens that create_engines and depcheck::manager s lis
of mods could get out of sync which caused wrong modification to be
active.

Also we add a type= key to [era]s chiech defaults to mp so that only the
default era is avaiable in sp by default (for technical reasons there
must be at least one era avaiable in sp.
2015-06-21 16:07:36 +02:00
Ignacio R. Morelle
f6c77b7dd8 gui2/tcampaign_settings: Request unescaped era names
Otherwise everything gets displayed with a caret prefix because GUI1
markup is of course not recognized by GUI2.
2015-06-20 20:42:01 -03:00
gfgtdf
acf177fbd0 automaticly detect whether to show mp_configure in sp
We now automaticly show mp_configure in sp iff there are actually things
to configure. This means if eigher force_lock_settiings was explicitly
set to false or if the [campaign] or one of the [modification] provides
[options] to configure.
2015-06-19 20:38:20 +02:00
gfgtdf
aad571d0bd fix mp depcheck crashing
previously mp depcheck was initialized after refeshing the cache which
caused a missmatch betwen create_engine::mods_ and depcheck::depinfo_
2015-06-18 18:58:02 +02:00
gfgtdf
c2e1d71fc2 less config reloads
This removes a config reload when opening multiplayer or singleplayer
campaign selection screen after playign a campaign.

To do this we must make sure the default era for sp and for mp have the
same id becasue otherwise we might get an id not found error.
2015-06-18 16:21:28 +02:00
gfgtdf
da1c8bf60e rewrite MAKE_ENUM macro
Instead of creating an enum, the MAKE_ENUM macro now creates a struct
which holds an enum and provides functions for enum <-> string
conversion.

This has multiple advantages:
1) We don't need MAKE_ENUM_STREAM_OPS anymore.
2) The generated struct is much easier to use in templates
3) We don't allow implicit to int conversions anymore.
4) The enum values are now declared inside the structs scope.
2015-06-04 02:08:02 +02:00
Ignacio R. Morelle
7b92923555 Fix unbound memory read (bug #23606)
This was introduced in commit 8e5eb9a8d4,
probably because it's not clear enough in our implementation of MD5 that
the result of MD5::raw_digest() (and util::md5() by proxy) is not a
null-terminated string. I've added a comment to util::md5() to clarify
this in case it comes up again, but what we really should do is replace
the MD5 implementation with something a bit more C++-ish.

Fixed the issue by having the caller request the text representation of
the MD5 digest instead.
2015-06-02 19:23:53 -03:00
Ignacio R. Morelle
f735f7f283 mp: Add missing fields in constructor initializer list 2015-06-02 18:49:43 -03:00
Ignacio R. Morelle
d7d76ac1fc mp: Ignore formatting markup in era names 2015-04-23 20:13:20 -03:00
Evgeny Kapun
b21dd2dce1 Started showing on which difficulty levels a campaign was completed 2015-04-20 18:58:13 +03:00
gfgtdf
295e1bdaad Revert "don't reload config when selecing campaigns"
This reverts commit 61a8de3d94.
2015-04-05 19:35:36 +02:00
gfgtdf
a882a83444 add type=sp/mp for [era] and [modification]
This allows wmldevs to have their eras and modifications only available
in sp or only in mp. By default (if type=  is omitted) it is available
in both.
2015-02-02 23:15:23 +01:00