78544 Commits

Author SHA1 Message Date
Iris Morelle
5e535a7bac Remove obsolete comment 2021-03-13 19:02:30 -03:00
Iris Morelle
f5d30e5c70 gui1: Bring scrollbar design in line with GUI2 2021-03-13 18:35:50 -03:00
Iris Morelle
57b89d225a gui1: Fix incorrect menu item size constraints
Regression from d1f026d22b9d0a989e72d1b0c31ac25fe6def8c8.
2021-03-13 17:10:31 -03:00
mattsc
0d5c2b1658 Fix attack prediction assert
The corrections applied in calculate_probability_of_debuff() are already taken into account in the main attack outcome calculation for being slowed.  They do not need to be applied again, that only needs to be done for being poisoned.  Doing this for being slowed also can cause an assert, such as the one reported in issue #5533 (and probably also the one in issue #5002).

Fixes #5533
2021-03-13 11:34:20 -08:00
Iris Morelle
45ca791387 ui: Fix ThemeWML [label] text_rgb= being horribly broken
First cause of breakage seems to be that the introduction of color_t
changed the size of the colour components from something longer than 8
bits to 8 bits, resulting in stringstream outputting invalid UTF-8. The
second cause is the dropping of GUI1 markup along with SDL_ttf.
2021-03-13 15:01:08 -03:00
Martin Hrubý (hrubymar10)
a0d1896942
Fix Xcode project 2021-03-13 18:40:27 +01:00
Iris Morelle
2435a0908e Update changelog
[ci skip]
2021-03-13 14:03:56 -03:00
Iris Morelle
56e6d0344f Update VS project files 2021-03-13 13:51:47 -03:00
Iris Morelle
055eb13e67 Move font::is_cjk_char() to help browser implementation 2021-03-13 13:51:47 -03:00
Iris Morelle
c5e1f77e80 gui1: Drop last instances of GUI1 markup support in menu widgets 2021-03-13 13:51:47 -03:00
Iris Morelle
5ce799ddbd gui1: Remove unit level and xp sorters
This functionality is entirely unused in 1.14 and later because GUI1
menus aren't used to list units anymore.

(Strictly speaking, all sorters are unused right now.)
2021-03-13 13:51:47 -03:00
Iris Morelle
066136af81 font: Remove a few more orphaned markup-related code paths
These were used by the GUI1 markup-supporting render APIs, and the
homebrew line wrapping implementation.
2021-03-13 13:51:47 -03:00
Iris Morelle
196db7b413 Remove SDL_ttf and FriBidi mentions from INSTALL.md and the VS Readme
[ci skip]
2021-03-13 13:51:47 -03:00
Iris Morelle
1c40a0271e ci: Remove dependencies on SDL_ttf and FriBidi 2021-03-13 13:51:47 -03:00
Iris Morelle
2dfdc0061d Remove SDL_ttf wrapper API
This removes the build-time dependencies on SDL_ttf and FriBidi,
alongside the SDL_ttf wrappers, the SDL_ttf text surface class, the
SDL_ttf render cache, and the SDL_ttf (de)initialization code.
2021-03-13 13:51:47 -03:00
Iris Morelle
8a9e861eb3 bi: Remove tracking of SDL_ttf and FriBidi 2021-03-13 13:51:47 -03:00
Iris Morelle
c17e6c00df font: Drop SDL_ttf dependency in font::parse_markup()
GUI1 markup isn't being used anymore anyway. This function is only
allowed to remain for a little bit longer as an implementation detail.
2021-03-13 13:51:47 -03:00
Iris Morelle
c42506ad2b font: Use pango_render_text() instead of get_rendered_text() 2021-03-13 13:51:47 -03:00
Iris Morelle
3fb36ee22d font: Make font_style optional in pango_render_text/line_size() 2021-03-13 13:51:47 -03:00
Iris Morelle
66659e03f8 font: Reimplement font::get_max_height() using Pango
A few caveats:

 * This implementation allows configuring the font family class and
   style to select the correct font for any given context. The default
   values are equivalent to what was being done in the SDL_ttf-based
   version, but not future-proof. Users like the GUI2 textbox should
   make use of the new optional parameters to select a more relevant
   font going forward (not part of this commit).

 * Pango has a line height metric, equivalent to SDL_ttf's
   TTF_FontLineSkip(). However, this is not what we want here -- the
   ascender + descender formula is intended to give us a neat box where
   the tallest glyph can fit, not the minimum distance between
   baselines. This is important for the GUI2 textbox in particular.

 * The internal implementation uses the default text renderer and sets
   relevant parameters. This should not introduce new issues, but if it
   does then that means someone is not resetting the renderer properly
   before using it.

This notably rids GUI2 of its one known dependency on SDL_ttf.
2021-03-13 13:51:47 -03:00
Iris Morelle
0024cfa7e4 gui1: Use font::pango_line_width() in more places
The SDL_ttf version is still in use in the SDL_ttf API itself.
2021-03-13 13:51:47 -03:00
Iris Morelle
a44c185333 font: Set a default function parameter 2021-03-13 13:51:47 -03:00
Iris Morelle
ffffd073bf font: Drop some code paths that have already been transitioned
This impacts font::draw_text(), font::text_area(),
font::word_wrap_text().
2021-03-13 13:51:47 -03:00
Iris Morelle
ec94da31b5 font: Drop more GUI1 markup support 2021-03-13 13:51:47 -03:00
Iris Morelle
d1f026d22b gui1: Move more code to using the compatibility API 2021-03-13 13:51:47 -03:00
Iris Morelle
1898c0e3d2 font/sdl_ttf_compat: Implement text_area() substitute
Again, no GUI1 markup here.
2021-03-13 13:51:47 -03:00
Iris Morelle
00c031d782 gui1: Use font::pango_draw_text() 2021-03-13 13:51:47 -03:00
Iris Morelle
fbf7d055f2 font/sdl_ttf_compat: Implement draw_text() substitute
This doesn't support GUI1 markup, intentionally.
2021-03-13 13:51:47 -03:00
Iris Morelle
a7015a9c95 help: Use Pango word wrap implementation instead of SDL_ttf 2021-03-13 13:51:47 -03:00
Iris Morelle
b58dbb59db font/sdl_ttf_compat: Add a Pango-based word wrap implementation
This lets Pango do all of the work for us and pulls the text back from
the renderer. It shouldn't be much more expensive than it needs to be --
the only real expensive step is copying the characters back into a list
of strings, and it's not by much.

Note: I haven't quite figured out what the partial_line parameter does
or what to do about it. It's probably not trivial to implement since it
seems to involve the decision of whether to break a line within word
boundaries or not.
2021-03-13 13:51:47 -03:00
Iris Morelle
07af824c2b font/sdl_ttf_compat: Use a single private renderer
It's not the same renderer globally used for everything else to avoid
any potential issues with state not being cleared or whatever.
2021-03-13 13:51:47 -03:00
Iris Morelle
4bb412c56d help: Use Pango for most functionality
We're still using SDL_ttf-based word wrapping, which we need to replace
with something that uses Pango instead.
2021-03-13 13:51:47 -03:00
Iris Morelle
8cd739cef1 font/sdl_ttf_compat: Initial Pango-based font rendering API for GUI1
This adds a minimal wrapper around pango_text intended for use in GUI1,
in particular for the help browser. Functionality is very incomplete
right now but for the time being we can render text, determine line
dimensions, and ellipsize text, which is almost the bare minimum needed
for porting the Help system (it's still missing a word wrapping
implementation).
2021-03-13 13:51:47 -03:00
Nils Kneuper
39d75333c0 updated Czech translation 2021-03-13 16:26:00 +01:00
nemaara
76886c4381 Liberty: dialogue revision again 2021-03-13 02:26:06 -05:00
nemaara
33fd1e97eb Liberty: change default difficulty 2021-03-13 01:38:40 -05:00
Iris Morelle
2425b89789 ui: Set the correct Pango ellpisizing mode
Whoops.
2021-03-13 03:16:48 -03:00
Celtic Minstrel
62183363b1
Add a label rule for WFL 2021-03-13 01:15:04 -05:00
Iris Morelle
f4165f77e9 ui: Use the public pango_text instance for rendering
The recommendation is not to use separate pango_text instances, but the
theme ui code and floating label code create a lot of them. How about
no.
2021-03-13 03:11:27 -03:00
Steve Cotton
31cdf16319 Unsubtly warn about subtle problems loading saved games from old versions
This connects to issue #2710, although the main reasoning about it is in #5517.
The difficulty balance isn't the only problem with loading old saved games, but
it's a simple example to explain.

This warning is intended for the change between 1.14 and 1.16, but will be shown
to anyone loading 1.15.x saves into 1.15.y - that's something that they should
expect in a dev branch.
2021-03-13 03:45:41 +01:00
Celtic Minstrel
e0c1ac2626
Fix [unstore_unit]x,y=recall,recall
Fixes #5604
2021-03-12 19:46:35 -05:00
Iris Morelle
e720a437b0 pot and documentation update 2021-03-12 20:22:02 -03:00
Iris Morelle
e954c7e389 wc: Fix strings wrongly assumed to exist in the wesnoth textdomain
This does not fix #5114 or #5526, but it does fix #5311.
2021-03-12 20:01:52 -03:00
Iris Morelle
3d7842c43e gui2/mp_faction_select: Use a disambiguator for the Random gender option
You just know sooner or later someone's going to try to use "random" for
something other than gender and some translations will end up looking
wrong as a result.
2021-03-12 20:01:52 -03:00
Iris Morelle
2de931cfa0 wc: Fix mapgen-related strings being in the wrong textdomain
The _ locals are there to ensure that if _ is overridden anywhere else
in the enclosing scope (which I haven't properly determined *where* it
is yet) it gets overridden again with the right textdomain object.
It *does* tell wmlxgettext what the correct textdomain is without using
the `-- #textdomain` hack anyway, so might as well just do it this way
regardless of the global-looking _ in map/main.lua.

CC #5311
2021-03-12 20:01:52 -03:00
Pentarctagon
edef0c5f33 Add database insert for addon information. 2021-03-12 16:12:09 -06:00
Pentarctagon
9b2429c393 Add validation for the feedback topic id. 2021-03-12 16:12:09 -06:00
Pentarctagon
b974423e2e Add optional fuh to campaignd. 2021-03-12 16:12:09 -06:00
Pentarctagon
9b7a958e9a
Add a new query to get faction side count. 2021-03-12 00:27:06 -06:00
nemaara
790bd029fc Add Liberty update to changelog 2021-03-11 02:01:41 -05:00