Commit graph

123 commits

Author SHA1 Message Date
josteph
9e8db93893 help: Call gettext on ToD topic strings that are already marked translatable
Manually fwdported from 82af89f950

(cherry picked from commit 82af89f950)
2018-11-03 06:52:16 +00:00
josteph
c54f4e6f19 Help: Hide abilities with empty names.
Fixes empty name abilities in help in Liberty S1.

(cherry-picked from commit c88a799b90)
2018-10-07 03:25:22 +00:00
Martin Hrubý
96bbebb514 Fix building with Xcode 10 (#3460)
Resolves #3458.

(cherry-picked from commit 50301f84e3)
2018-10-07 03:24:17 +00:00
Charles Dang
dfce371287 Convert custom unicode type aliases to proper types (available as of C++11)
This changes:
utf8::char_t   ->  char
utf8::string   ->  std::string
utf16::char_t  ->  char16_t
utf16::string  ->  std::u16string
ucs4::char_t   ->  char32_t
ucs4::string   ->  std::u32string

utf16::string and ucs4::string are now proper strings instead of vectors of characters too.

In order to get this change to compile at all, I needed to add a ucs4_convert_impl::convert_impl
specialization for wchar_t alongside the new char16_t specialization; both point to the same
conversion implementation type.

This commit doesn't do any additional cleanup. I'm sure if we looked, we could get rid of a
lot of the custom conversion code and probably a bunch of stuff that might have had to do with
supporting utf16::string and ucs4::string being vectors instead of basic_string specializations.
Either way, I don't know the code (or encoding handling in general) to make a call as to what's
needed or not. I'll let someone else do that.

(cherry-picked from commit 1deacd89f6)
2018-10-07 03:18:49 +00:00
Charles Dang
45f871067f Use std::size_t everywhere instead of plain size_t
Excludes:
* spirit_po/
* xBRZ/

(cherry-picked from commit fc2a58f693)
2018-10-07 03:17:59 +00:00
Charles Dang
950a156712 Addressed most of the remaining whitespace issues from #2613
[ci skip]
2018-03-11 14:59:37 +11:00
Celtic Minstrel
dc0d6474e8 Boost deprecation logdomain severity when debug mode is enabled 2018-03-04 21:21:33 -05:00
Charles Dang
044dedb43a Removed Credits section from help browser (fixes #2555)
I had disabled this when I redid the End Credits screen in GUI2 (476027f) since (IIRC)
I didn't want to figure out about parsing the new config-based credits storage. The topic
remained in Help, empty. We've decided the new End Credits screen is a better method for
viewing the credits anyway, so I'm now removing the topic.
2018-03-03 21:27:19 +11:00
Charles Dang
e270a7c665 Formatting cleanup: > > to '>>`
Allowed since C++11. Might as well use it everywhere.
2018-02-21 12:11:21 +11:00
Charles Dang
dec677f2c5 Refactor unit type ability metadata storage
This fixes #1774. Essentially, I made the help browser use both ability name and ids when
deciding which ones to add topics for. To facilitate that, I've gotten rid of the separate
vectors for ability names and descriptions and consolidated all the data into a single
ability_metadata struct to unit_type. It still needs to be expanded for use in the unit
class (which I intend to do), which is why it has a whole bunch of fields I don't use.

I've also totally refactored the ability topic generation code in the help browser.
2018-02-19 21:47:48 +11:00
Charles Dang
f23305f7e2 Formatting cleanup: T const& -> const T& 2018-01-23 01:26:23 +11:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Charles Dang
eab8380fc4 Avoid copying temp configs when adding config children (where possible)
A few of them are quite small, so this has no performance effect on those, but a few others
are potentially quite large, such as the one in campaign_server.cpp.
2017-12-03 07:37:12 +11:00
josteph
673c1fa4d9 help: Handle traits with empty names or descriptions.
Fixes #2108.
2017-11-03 18:11:08 +11:00
Charles Dang
542f65d2a7 Use std::string::empty() for string-is-empty comparisons 2017-09-05 06:25:26 +11:00
Charles Dang
2eacb4e1c3 Use !std::string::empty() for string-is-not-empty comparisons 2017-09-05 06:25:25 +11:00
gfgtdf
0f44669e59 improve faction help ids
this not only fixes a very theoretical case where an era could have the same id as an era form another faction. It also makes it possible to check whether a topic describes a faction by just checking it's id prefix.
2017-06-21 20:58:48 +02:00
ln-zookeeper
01b4a162f0 Fixed help topics not working right when multiple factions share an id
For example the factions of Default Era and Age of Heroes have the same id's, which caused the faction help topics to have the same id's as well, leading to a faction link on both era pages to lead to the same faction page. Adding an era prefix to the faction topic id's makes them unique and solves the problem.
2017-06-21 21:32:05 +03:00
Charles Dang
e41a415588 Deployed yet even more further additional emplace_back 2017-05-10 14:15:15 +11:00
Charles Dang
e4f03fe459 Moved all preferences source files into a single folder 2017-05-04 11:04:19 +11:00
Charles Dang
2a6ca6cd9e Deployed more emplace_back (how do I keep missing these...)
Covers more cases of:

* push_back(std::pair
* push_back(std::make_pair
* push_back(std::make_tuple
* push_back(T) where T is an empty object of type T

Small thing I noticed: this does mean the numbers in font::subset_descriptor are no longer 'cast' to size_t before being
added to the vector, but that shouldn't matter (hopefully).
2017-04-28 17:15:13 +11:00
Charles Dang
0c3260dc05 Finished deploying std::map::emplace (cont. e1a579da51)
Apparently, the last time I did this I only grepped for `insert(std::pair` not `insert(std::make_pair`. Oversight, much?
2017-04-12 07:51:42 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Celtic Minstrel
12cf0fb45e Replace some uses of string::find with string::compare
These instances were found by cppcheck.
Thanks matthiaskrgr for running it.
2017-03-16 17:10:38 -04:00
Charles Dang
b97a20b059 Split SDL_Surface wrapper class and related helper struts into their own file
This (should) allow sdl/utils.hpp to be modified without a huge rebuild, since a number
of widely used headers included that file simply for the surface class type.
2016-12-10 22:36:31 +11:00
Charles Dang
71bb216352 Use font::unicode_bullet instead of manually writing • 2016-12-10 14:14:51 +11:00
Celtic Minstrel
e7e5ca5fa2 Fix Travis 2016-12-01 15:06:25 +02:00
Charles Dang
4b3862493f Convert all usecases of SDL_Color to color_t 2016-11-30 17:59:30 +11:00
Charles Dang
9baabccf91 Use standard library includes instead of C includes when possible 2016-11-30 11:48:10 +11:00
Charles Dang
eb3effad21 Replace int_to_color and string_to_color with their appropriate color_t counterparts 2016-11-28 12:17:49 +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
08852f6131 Rename most remaining non-GUI2 types to avoid t- prefix 2016-11-09 01:17:14 -05:00
Celtic Minstrel
b74afeff73 Rename terrain classes to avoid t_ prefix 2016-11-09 01:13:17 -05:00
Charles Dang
8c92a9ee8e Formatting cleanup: moved const qualifiers before type names 2016-10-31 01:04:18 +11:00
Charles Dang
4b66735293 Help: flipped a conditional to prevent crashes when parsing invalid vectors 2016-10-17 11:45:16 +11:00
Jyrki Vesterinen
5e2af01fba Fix build
This involves splitting standard colors out of font/constants.cpp.
Serialization/string_utils.cpp, that is part of wesnothlib
(compiled into both client and server) uses ellipsis and Unicode minus sign
from font constants, which means that font/constants.cpp must be part of
wesnothlib as well. However, one of standard colors is evaluated by calling
inverse(const SDL_Color&) declared in sdl/utils.hpp. Sdl/utils.cpp has way
too many dependencies to live in wesnothlib.

Hence, standard colors are now in a file of their own:
font/standard_colors.cpp. That file is part of wesnoth (not wesnothlib) and
only available for the client.
2016-10-16 18:34:22 +03:00
Charles Dang
b6ea5106ca Moved marked-up_text.*pp to font/ 2016-10-16 22:54:07 +11:00
Jyrki Vesterinen
af733360a8 Fix a bunch of MSVC2015 compiler warnings about hiding declarations
This commit still doesn't fix all of them. I decided to leave alone
cases where variables with the same name are assigned in multiple
conditions of the same if...else if...else statement, and cases where a
scope logging macro is used multiple times in the same scope. In any
case, this commit greatly reduces the warning count on MSVC2015 and makes
new warnings much easier to spot.
2016-10-06 00:11:56 +03:00
Charles Dang
476027f239 Completely refactored internal handling of credits and enabled new dialog
This removes the ugly string markup and makes the dialog parse the config directly.

This also temporarily disables the display of credits in the help browser.
2016-09-15 03:09:14 +11:00
Celtic Minstrel
b143ea4397 Use intrusive pointers for unit attacks
This is primarily for the purpose of the Lua API, to enable attack data to persist
even if a unit no longer owns the attack.
2016-08-28 00:24:23 -04:00
Celtic Minstrel
16786f9905 Generate help topics for weapon specials obtained through AMLAs 2016-08-13 17:08:50 -04:00
gfgtdf
4d84d42c47 iterator_range instead of pair for config::child_itors
with this wwe can use .size(), .empty(), .front(), operator bool, etc.
on config::child_itors objects.
2016-08-13 16:59:34 +02:00
Bär Halberkamp
7dbf17f3fe Fix traits in help 2016-07-31 15:46:55 -04:00
Charles Dang
24577e117d Merge pull request #716 from wesnoth/boost_trimming
Boost-related cleanups
2016-07-30 15:51:30 +11:00
Bär Halberkamp
4e71bbe448 Generate trait help instead of hardcoding
Introduces a new key "help_text=" in [trait]
2016-07-29 18:44:10 -04: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
Charles Dang
52cba5fc63 Enabled Lato for GUI1 and adjusted assigned sizes accordingly
Since GUI1 widgets seem to rely on the given font size values in font.hpp
for their dimensions, those are unchanged. ThemeWML-provided sizes were adjusted,
and larger sizes assigned to elements that were too small with the new font.

Theme element rects were also adjusted as necessary.
2016-05-18 08:05:02 +11:00
Celtic Minstrel
1649930113 Lua API for the name generators 2016-04-15 15:51:23 -04:00
Celtic Minstrel
ca382018b7 BOOST_FOREACH -> range for 2016-04-02 09:38:29 -04: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