Commit graph

33042 commits

Author SHA1 Message Date
gfgtdf
c4cf0c9da4 fix filter not working in [disable] (#2826)
The problem was that the specials_context was not set during those
two get_special_bool calls

This removes what seems to be a rather useless optimisation in
battle_context::battle_context since choose_attacker_weapon would
just return 0 in that case.

fixes #2801
2018-04-04 10:43:27 +11:00
gfgtdf
79072b7c3d fix OOS when undoing actions with synced choices
The problm was that the old code tried to use `undo_stack().can_undo()`
to check whether the current action can be undone. But
`undo_stack().can_undo()` uses the undo stack which is only updated at
the end of each action, so it cannot be used to check whether the action
that is currently executed can be undone.

This code removes some assertion that were wrong due to the
justmentioned.
2018-04-04 10:43:26 +11:00
Charles Dang
bd00adffd4 Help Browser: don't generate nodes for hidden topics, updated link color
See 1903b05 for GUI2 label link color change. Really, this shouldn't be hardcoded here,
but I'll get to that.
2018-04-03 20:30:26 +11:00
Charles Dang
e8b750f8a7 Help: fixed unit section such as the Walking Corpse's not generating
I didn't realize that is_valid_id was only meant to check IDs provided in the help config and
not IDs generated dynamically; the latter are always correct. Granted, the old code did actually
call its analogous codepath for race and era generation, but it did not for unit sections. My
refactor made it so this check happened *any* time a section was created, regardless of its source.

To rectify that, I moved ID validation for sections into the static section generation loop like
for topics. I also moved the topic id validation prior to the ToD generation, tweaked the invalid
id message, and renamed a variable for clarity and consistency.
2018-04-03 20:19:02 +11:00
Charles Dang
6615aa7efe Swapped the position and formatting of game names and titles in the MP lobby
Addresses point 2 of #2815.
2018-04-03 19:11:29 +11:00
Charles Dang
384ba46c86 GUI2/Label: tweaked link confirmation prompt 2018-04-03 15:30:43 +11:00
Charles Dang
4bd08cefb9 Fixup 7f60fb0 (missing include) 2018-04-03 15:23:30 +11:00
Charles Dang
754d326098 Help/Manager: dead code begone! 2018-04-03 15:04:05 +11:00
Celtic Minstrel
7f60fb0fbc Add [filter_second_weapon] to leadership and resistance abilities
Closes #2761
2018-04-02 23:56:18 -04:00
Charles Dang
30455d52a2 Help: moved a util function to the only file in which it is used 2018-04-03 14:49:17 +11:00
Charles Dang
26b6ca54bb Fixed crash when starting the editor (fixes #2816)
If no display_context was passed to the display ctor (such as is the case in the editor),
the terrain_builder's gamemap pointer would be null. Really not sure why this didn't cause
a crash n the 1.14 branch, but oh well.

I just removed the ctor call to rebuild_all() since it's not really needed. The map is
rebuilt when change_display_context is called anyway, which both the editor_controller and
play_controller do.
2018-04-03 13:53:30 +11:00
Charles Dang
973a8f54f9 Help: mark currently unused-parameter as such for now 2018-04-03 13:36:17 +11:00
Charles Dang
09f6cec0c1 Fixup 3865a16 2018-04-03 13:23:03 +11:00
Charles Dang
3865a16288 Help: fixed ambiguous overload, config copying 2018-04-03 13:09:00 +11:00
Charles Dang
3fc01cadf4 Help: removed useless 'is nonnull' debug info from terrain topics
is_nonnull() just means "is not "none" or void terrain".
2018-04-03 12:59:14 +11:00
Charles Dang
b0d72724a0 Fix extra qualifier on function declaration 2018-04-03 12:55:24 +11:00
Charles Dang
a064b4f66b Help/Manager: don't need to keep a game config pointer anymore
I had removed the code that used it. We can just keep a help config pointer.
2018-04-03 12:54:14 +11:00
Charles Dang
3cba52c607 How did these sneak past... (fixup 23e78ab) 2018-04-03 11:54:00 +11:00
Charles Dang
23e78abb20 Help: massive refactor and cleanup of the help backend
This basically splits all the stuff in help/help_impl.*pp into multiple files by their
function, and refactors the entire workflow into a proper object-oriented interface in
modern C++.

There are still a features missing (such as hidden section parsing in the manager) that
I'll get back to.

Few incidental changes and fixes:
* Terrain topics now sorted alphabetically.
* Help text now small
* Fixed wrong toggle button id in browser. This is what was making it impossible to expand
  any sections.

The GUI2 help browser is now back in working order, inasmuch as you can view all sections'
and topics' text (save units').
2018-04-03 11:51:57 +11:00
Charles Dang
636ada65a8 Use proper bool instead of yes/no when setting config values 2018-04-02 13:36:51 +11:00
gfgtdf
9593062fc6 guard against calling user_choice_manager::pull() recursively 2018-03-31 19:44:14 +02:00
gfgtdf
bce8c29568 treat local choices as like sycned contexts in replay.cpp
this makes more sense as the game cannot handle sycned commands while
executing local choices. It also fixes an OOS in
wesnoth.synchronize_choices
2018-03-31 19:44:05 +02:00
gfgtdf
edd7a82255 pull remote user input even if we are doing a local choice.
this mainly effects wesnoth.synchronize_choices:
previously the client would not process incoming choices from other
players while it was exeucting its own local choice (usually a dialog).
The problem this commit fixes is that with the old behaviour any choice
from another player would block the incoming queue, in particular
chatmessages after that command would be delayed until the
wesnoth.synchronize_choices is finished.
2018-03-31 19:44:03 +02:00
Celtic Minstrel
6184489a65 Fix an incorrect error message in [clear_global_variable] 2018-03-30 18:39:24 -04:00
Celtic Minstrel
325f4c4070 Support force_scroll in [move_units_fake] (same as in [move_unit_fake]) 2018-03-30 18:38:58 -04:00
Celtic Minstrel
d48206bdbe Remove speaker=id support from SUF 2018-03-30 18:38:14 -04:00
Celtic Minstrel
5ee9b09470 Add a way in [filter_wml] to match key values against a glob 2018-03-30 18:37:20 -04:00
Celtic Minstrel
b483d96f50 Fix [filter_wml] implementation so that [or] tags actually work 2018-03-30 18:36:56 -04:00
Celtic Minstrel
dd4f80fdd1
Fix scenario editor writing to wrong key 2018-03-29 21:48:07 -04:00
Charles Dang
01bcee6be7 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-29 20:33:51 +11:00
Charles Dang
20a58fd8f8 Removed help_manager struct (it will be replaced)
This is in preparation for a larger refactor.
2018-03-29 20:33:00 +11:00
Iris Morelle
8a905134a4 wesnothd, campaignd: Fix warning about uninitialized field on _WIN32 2018-03-29 05:23:15 -03:00
pentarctagon
0bbc78945e Remove tools-external-libs.
Also put Boost_RANDOM_LIBRARY, CRYPTO_LIBRARY, and MYSQL_LIBS into server-external-libs.
2018-03-27 19:21:16 -05:00
Iris Morelle
4799ca05fe cmake, scons: Drop option to enable or disable the removed SDL_SavePNG code
Commit dfc42e8a8d removed said code since
Wesnoth can use IMG_SavePNG() from SDL_image 2.0 instead. However, the
author left the build-time configuration options intact, and also part
of the necessary code for CMake to link Wesnoth against libpng.

Note that this change also eliminates an unnecessary direct link-time
dependency on libpng when using both CMake and SCons.
2018-03-27 18:56:03 -03:00
Jyrki Vesterinen
706015ab85 Remove some unreachable code 2018-03-27 21:34:37 +03:00
gfgtdf
a1c06fbc65 disable debug command off-turn in mp
the serer wouldn't accept these commands anyways.
2018-03-26 18:48:03 +02:00
pentarctagon
3343a9451a Remove SDL2_TTF 2018-03-26 17:56:36 +11:00
Charles Dang
8fc49bdce1 Fixed some stuff causing compiler errors 2018-03-26 17:55:24 +11:00
Iris Morelle
56e7b01ac4 Refactor synced debug commands prompt to bring the string count down to 2
Otherwise there are too many repetitive strings for translators to work
with, which is rather unfair for an exception like this during the 1.14
RC phase. It also makes for better code.

Also added an article "The" at the start of the strings for :command
notifications.
2018-03-26 03:16:36 -03:00
Iris Morelle
eacbc5f695 gui2/text_box: Store hint text as a t_string
Storing it in a regular string results in issues with the game getting
stuck with the translation for the locale that was set during GUI2
initialization and not reflecting changes when switching languages later
on.
2018-03-26 03:16:36 -03:00
Iris Morelle
cbec739e23 New translatable version of the synced debug command prompt text 2018-03-26 01:26:09 -03:00
Iris Morelle
b7e08977ed Set a custom dialog caption for the synced debug command prompt
This replaces the caption with something more apropos than the generic
"Save Game" caption. It necessitates a minor API change though.
2018-03-26 01:08:07 -03:00
Charles Dang
b4adec6ef5 Help Browser: removed custom formatting conversion for <bold>, <italic>, and <header> 2018-03-26 15:06:11 +11:00
Charles Dang
8b6270f92f Fix some unused parameter warnings caused by recent commits 2018-03-26 14:36:15 +11:00
Charles Dang
b08fa98260 Removed CVideo::blit_surface
Used to be a surface drawing helper for blitting on the framebuffer surface.
I made it work with accelerated rendering by forwarding it to render_copy,
but we don't need it anymore. All but one of its usecases have been removed.
2018-03-26 14:15:38 +11:00
Charles Dang
c453a97dac Removed custom blit_surface function
Unused now. And we wanted to get rid of it anyway.
2018-03-26 14:11:41 +11:00
Charles Dang
c198be1fa8 Removed the SDL_TTF and GUI1 font rendering API and associated functions
This removes all functions related to:
* GUI1 font formatting
* GUI1 font rendering
* Manual text surface size calculations
* The font description interface. While it wasn't exclusive to the TTF rendering system,
  it was unused by Pango/Cairo rendering.

A huge chunk of the help browser code was commented out since we don't have font::line_width anymore.
Likewise, a hack was added to the GUI2 text box since we don't have have get_max_height anymore.

font::is_cjk_char was retained (as well as some related helpers) since they might be useful
later.

I'll leave it to someone else to update the CMake/Scons files to remove TTF as a build
dependency.
2018-03-26 14:08:45 +11:00
Iris Morelle
ab67b402d1 Let synced debug command notifications be localized, fix them up a bit
There's a gettext call but there was nothing to mark the strings as
translatable in xgettext's view. Additionally, fixed a minor case of
missing the colon before the command name, replaced ASCII apostrophes,
and rewrote a notification with awkward wording.
2018-03-25 23:49:32 -03:00
Charles Dang
34797ed1a2 Removed or commented out (for reference) all uses of the GUI1 button widget
And removed said widget.
2018-03-26 13:13:17 +11:00
Charles Dang
0a67e9725c Help: marked "Level" string in unit topic description translatable
I apparently forgot to do this at some point... Fixes one of the issues mentioned in #2732.
2018-03-26 12:21:23 +11:00