Compare commits

...
Sign in to create a new pull request.

1622 commits

Author SHA1 Message Date
Celtic Minstrel
e1506935a1 Support bonus="string" in [objectives][gold_carryover]
This will take the string as an explanation of a condition that needs to be satisfied to receive an early finish bonus.
2018-08-04 23:36:49 -04:00
Celtic Minstrel
9ba7fd6d4a Support bonus=<multiple> in [objectives][gold_carryover] 2018-08-04 23:36:02 -04:00
Celtic Minstrel
7bd355e942 Support carryover_add in [objectives][gold_carryover] 2018-08-04 23:35:31 -04:00
Celtic Minstrel
01d7069d7d Implement a more modular approach to specifying objectives 2018-08-04 22:57:12 -04:00
Konrad2
37ddf43d3a Updated credits for @Konrad22 (#3430) 2018-08-04 21:34:30 +11:00
josteph
ef71d0efcb Addon Manager: Unabbreviate "asc" and "desc".
@jyrkive https://github.com/wesnoth/wesnoth/pull/3418#issuecomment-410433850
2018-08-04 12:47:55 +03:00
josteph
569e1d85a5 Addon Manager: Don't use "ascending" and "descending" to describe how dates are sorted. 2018-08-04 12:47:50 +03:00
Jyrki Vesterinen
fb5f46c52a Help: update the "Installing Add-ons" page (addresses #2703)
[ci skip]
2018-08-04 11:03:39 +03:00
Jyrki Vesterinen
40205c55fb Help: document cores (#2703)
[ci skip]
2018-08-04 11:01:47 +03:00
Steve Cotton
66c56403db SoF S4: Improved the reminder to recruit miners (#3422) (fixes #3394)
Updated to [allow_undo], because the hint message shouldn't block undoing a
recall.  Recruiting can't be undone, even with [allow_undo], so this isn't
allowing a cheater's opportunity to recruit units with desired traits.
2018-08-04 08:46:27 +03:00
Celtic Minstrel
ff4e1b2e61 Add new contributors since 1.14.0 to the credits
Anyone who prefers to be credited some other way (or whose name I misspelled) can feel free to open another PR

@Byteron @rrigby @DisherProject @Ferk @Konrad22 @lilinitsy @UnwiseOwl @bandita137@Ordoviz
2018-08-03 20:50:10 -04:00
rrigby
16e858263c Add categories to appdata
following https://standards.freedesktop.org/menu-spec/latest/apas02.html
2018-08-03 15:07:51 +02:00
josteph
f293c7cb32 GUI: Fix check for no usable weapons.
Fixes #3424.
2018-08-03 15:43:48 +03:00
Jyrki Vesterinen
46bec21fa3 Fix: halo (if any) remains when wesnoth.put_recall_unit() is used
Based on the suggested fix in #3425. Closes #3425.
2018-08-03 12:02:53 +03:00
sigurdfdragon
c6d2a0febc NR: Ensure Krash doesn't overwrite other units and is properly placed.
This could happen if a player has Krash and skipped S10a.
2018-08-02 22:57:08 -04:00
joeylmaalouf
4befb3580d NR S7-8: avoid recreating the new companions from scratch 2018-08-03 01:54:20 +02:00
joeylmaalouf
7c70c1d985 NR S7: give Stalrag traits for consistency 2018-08-03 01:54:20 +02:00
Nils Kneuper
8fb7429ca8 updated Italian translation 2018-08-02 21:30:20 +02:00
Nils Kneuper
bcce3fb4cc updated French translation 2018-08-02 21:29:21 +02:00
Konrad2
87eb901c10 SoF S01: Added snowy mountains to right map edge (#3401) (fixes #3383)
New map for SoF - Sc1 to fix #3383 (removing the fast way to reach the elvish leader, by replacing some regular mountains with snowy mountains).
2018-08-01 10:10:07 +03:00
josteph
55e4147213 debug: Give feedback for :droid.
#2819
2018-07-31 22:59:14 +02:00
josteph
0f520ad8a6 debug: Fix ":droid" always toggling droid on/off even when given two arguments (":droid <side> off"). 2018-07-31 22:59:04 +02:00
gfgtdf
936516c83b fix game crashing when showing a too large tooltip
previously the game would go into an infinite loop at
https://github.com/wesnoth/wesnoth/blob/1.14.4/src/gui/widgets/window.cpp#L1046
when a tooltip doesn't fit on screen, this could in particular happen in
the mp lobby when hovering over the 'i' of a game that uses a ridiculous
amount of modifications.

I currently don't see any case where the game is actually able to 'fix'
a bad height that was reported from reevaluate_best_size. so i just
disable reevaluate_best_size for floating tooltips.

If there exists such a case, an alternative fix could be to change the
reevaluate loop in window::layout to also stop when a new iteration
returned the same size as the previous iteration.
2018-07-31 22:58:45 +02:00
gfgtdf
90fb50d70f improve wesnoth version warning further 2018-07-31 22:58:36 +02:00
gfgtdf
ba18e17e43 improve wesnoth version warning. 2018-07-31 22:58:28 +02:00
gfgtdf
610e4f2969 add server notifications about outdated wesnoth versions. 2018-07-31 22:58:18 +02:00
gfgtdf
f84d79e033 fix skip replay being active in later scenarios
in mp campaigns.
2018-07-31 22:58:09 +02:00
gfgtdf
eec8b674de fix require_scenario & require_era
previously both were broken:
1) 'require_scenario' was only checked if the scenario was installed
which obviously doesn't make any sense at all.
2) 'require_scenario' was read from the local scenario data instead from
the remote scenario.
3) 'require_era' was only checked when the scenario was not installed,
so people who do have an outated version of the era installed could not
join bacause it assumed require_era=yes in that case.
4) the server tried to read 'require_scenario' from the wrong wml node,
'require_scenario' is an attribute of [scenario] and not of savefile
toplevel.
2018-07-31 22:58:00 +02:00
gfgtdf
15c59037d3 mplobby: add debug info 2018-07-31 22:57:51 +02:00
gfgtdf
367aec2bb2 don't process a corrupted gamelist_diff further
fixes #3017, assuming that the error is actually casued by the
'process_gamelist_diff failed'

As process_gamelist_diff simply returns after getting an error its quite
likeley that the gamelist is then in a  corrupted state so we stop
processing it until we get a fresh gamelist.
2018-07-31 22:57:38 +02:00
gfgtdf
edc57d2388 add comment 2018-07-31 22:57:26 +02:00
gfgtdf
eb23ac5646 preserve traslatable strings in simple_wml.
previously it would happen that for example an attribute like
`side_name=_"female^Footpads"` in side would get its translatable mark (_)
removed after the game has started. This meant that observers that enterd
the game after it started would see the literal string "female^Footpads"
in the status side overview window.

The new code marks all translatable simple_wml attributes to make sure their
translatable mark is preserved along with their textdomain. It can still
happen though that attributes will appear in the the wrong textdomain area
after simple_wml processing though because in some cases note::output
might skip over textdomain markers. It is still not as bad as string like
"female^Footpads" appearing in the ui though.

An alterntive appraoch to fix this issue would be to carefully make sure
not to change any atributes of wml tags that can also contain translatable
attributes, which would probably imply not editing the wml objects received
by the client at all and instead storing the new information (in particular
side information like is_local=yes/no) in a seperate wml object. (that would
then be sended to the clients along with the original scenario wml objects.)

fixes #1420
2018-07-31 22:57:16 +02:00
gfgtdf
c4aacbe31f don't use std::pair
instead we use a custom struct. std::pair is bad becasue you never know
what "first" or "second" mean.
2018-07-31 22:57:06 +02:00
gfgtdf
44734570dd fix attacks beein wrongly disabled
as said in the comment, that get_special_bool might return the wrong value, as since 5f58cd7c6d the bc_vector no longer contains disabled attacks we can just remove this code.

fixes #3324
2018-07-31 22:56:53 +02:00
gfgtdf
97b5612691 ignore [delay] during preload,prestart and initial lua.
as the ingame ui is not shown yet, [delay] would only result in showing a black screen,

Also in the case of initial lua it might result in crashes because of the threaded loadingscren, or simply because parts of the ui are not initialized yet.
2018-07-31 22:56:41 +02:00
Iris Morelle
12a3b973b9 pofix: 1.14 announcement rules for 1.14.4
Also fixes a mistake from the 1.14.3 rules that caused "xxx MiB" to be
replaced with "xxx MB MiB" for all platforms. Oops. Nobody noticed
anyway (?).

[ci skip]
2018-07-31 14:59:59 -04:00
Severin Glöckner
c2064827e4 THoT S6: minor changes for difficulty and map
Uses an Orcish castle instead of destroyes human. Troll would maybe fit best,
but it doesn't fit well with the surrounding. Has now only 2 castle hexes.

On easy difficulty, reduced turns by two, it should be enought turns.
Also added one more enemy, as there are less wolves spawned on easy.
And income for Gryphons once again increased by 1, they are very expensive.

Reminding events have been adjusted to turns.

[ci skip]
2018-07-30 17:25:26 +02:00
Severin Glöckner
390d66fda1 THoT S6: Let the AI avoid the mage's hut
Until he is found. This also means one less villages for side 2, increased
their income thatfor,

[ci skip]
2018-07-30 17:25:26 +02:00
josteph
92bb1c263b THoT S6: Now that the player is told which hut to look at, don't trigger Ratheln if the player ignores the hint.
Suggested by @sevu.
2018-07-30 17:25:06 +02:00
sigurdfdragon
c2cf0288fc Update changelog 2018-07-29 12:43:56 -04:00
sigurdfdragon
46cc9a5289 SotA S21: Slight touchups
Only recruit level 2 to match what nagas arrive with.
2018-07-29 12:43:48 -04:00
sigurdfdragon
32a630bd3f SotA S21: Fix #3294 properly
It is the Saurians that have their males killed in S11, so the females
take revenge.
2018-07-29 12:43:41 -04:00
sigurdfdragon
7ced35839b Revert "SotA S11 & 21: Fix #3294"
This reverts commit a4bad90bad.

It is supposed to be the male Saurians that get killed in S11, and the
females seek revenge in S21.
2018-07-29 12:43:35 -04:00
josteph
f0ed45bde9 THoT S6: Let a Scout be the first to smell Ratheln's cooking.
[ci skip]
2018-07-29 17:51:33 +02:00
Jyrki Vesterinen
74d8cfa98e WML unit tests: port ability to override strict mode from 1.14
The ability isn't needed in master because none of the unit tests call
deprecated functions here, but it may be useful in the future or make
cherry-picking of future changes easier.
2018-07-28 08:18:59 +03:00
Jyrki Vesterinen
6450bada57 Lua: delete loadstring()
Fixes the vulnerability introduced in commit 52ae31efb2.
2018-07-28 08:16:00 +03:00
Jyrki Vesterinen
aa73b83600 Extend the first CVE-2018-1999023 unit test to also try loadstring()
Like @gfgtdf pointed out, loadstring() is still supported by Lua in the
name of backwards compatibility, even though it was deprecated in Lua 5.2
and is no longer mentioned in Lua manual. Thus, as of committing this it's
actually possible to load Lua bytecode.

Let's unit test this to ensure that we don't reintroduce this
vulnerability.
2018-07-28 08:12:48 +03:00
DisherProject
d13c451afb Liberty S8: Fix some event filters 2018-07-27 20:01:29 -04:00
DisherProject
f32dfaa917 Liberty S8: Remove unnecessary hidden side
Side 3 was composed by enemy reinforcements. Since they were
spawned on the right corner of the map, and since side 2
was blocked inside Halstead by and [avoid] tag, it was
necessary to add a new hidden side which could move freely
on the map.
If we upgrade the AI, removing the [avoid] tag, this hidden
side becomes unnecessary.
2018-07-27 20:01:29 -04:00
DisherProject
e63a15fc91 Liberty S8: General fix and cleanup to the AI goals
All sides will now head to the central fortress. Orcs
should now be a bit smarter, and they should not suicide
during the morning or the afternoon. The humans in Halstead
will initially remain inside their fortress, until the enemy
arrival.
2018-07-27 20:01:29 -04:00
DisherProject
4ced6c7526 Liberty S1-S7: Fire victory when enemies are defeated
Instead of checking whether there are no enemy units left
every time one of them dies, use the "enemies defeated"
event.
2018-07-27 20:01:29 -04:00
DisherProject
cbe2bcef6b Liberty S1: Filter event by condition instead of using an
if-then clause
2018-07-27 20:01:29 -04:00
DisherProject
ddf9949cff Liberty S5-S6: Replace deprecated keys
"share_maps" and "share_view" have been replaced in
favour of "share_vision"
2018-07-27 20:01:29 -04:00
Iris Morelle
3b91481a0c UtBS: Improve Eloh's attack animation timings
Also remove a Kate modeline I didn't intend to push.

[ci skip]
2018-07-27 19:32:30 -04:00
Iris Morelle
c56e8aa695 Sync 1.14 changelog
[ci skip]
2018-07-27 19:08:38 -04:00
Iris Morelle
6e1a861bda UtBS: New graphics for Eloh by me
There are two layers of halos and they are applied in a somewhat
convoluted fashion. I should probably explain why.

The bottom halo is designed so it's drawn *below* the main unit sprite
so as to not muddle the colours on it. Halos are normally drawn *on top*
of sprites.

The back halo is specifically masked so it's drawn behind the main unit
sprite without overlapping any of its pixels, but it's asymmetrical and
supposed to flip along with the unit sprite depending on the direction
it's facing. Halos do not do that currently, at least not without using
animation WML conditionals. Unfortunately, for some reason, using a
standing animation that's nothing but conditionals causes the game to
crash at the moment.

Taking all this into consideration, using the blit IPF is a much easier
mechanism to avoid both issues at once, even if it makes the code
slightly awkward.

If someone can think of an alternative method, they're more than welcome
to change the code as long as the sprite's composition remains exactly
the same as it is now. I'm just the artist in this case.

[ci skip]
2018-07-27 19:08:38 -04:00
josteph
a08b7c3ab3 THoT S10: Clarify objectives.
[ci skip]
2018-07-27 23:03:50 +02:00
josteph
5758c900e2 THoT S6: Rephrase Ratheln cue.
It didn't make sense for the dwarves to only notice "glowing" after night had ended.

[ci skip]
2018-07-27 23:03:22 +02:00
Jyrki Vesterinen
212601deab check_utf8.sh: don't check the second Lua bytecode test scenario
This avoids the other file with binary data.
2018-07-27 23:53:58 +03:00
Jyrki Vesterinen
8dc60ae98f check_utf8.sh: don't check the Lua bytecode file
This avoids one of the two files which are currently causing macOS SCons
builds to fail in the master branch.
2018-07-27 23:52:38 +03:00
loonycyborg
0c3ba36d68 scons: fix strict hardened builds on Gentoo 2018-07-27 16:28:23 +03:00
Jyrki Vesterinen
52ae31efb2 Lua: implement our own load() instead of monkey-patching Lua code
Monkey-patching has multiple problems. The biggest problem for a security
fix like this is that it's way too easy to forget to re-apply when we
update Lua to a newer version.

Instead, we now have the implementation of load() under our control and can
update Lua without risk of reintroducing CVE-2018-1999023.
2018-07-27 15:36:56 +03:00
gfgtdf
6b13a63bb0 wml test for cve-2018-1999023
this test whether we succesfully prevent the exceution and parsing of
precompiled lua chunks, which can be used to break the lua sandbox.
This test does not cover all affected functions in particular not the ai
code that loads lua chunks.
2018-07-27 15:36:56 +03:00
gfgtdf
2554c166dd disallow loading lua bytecode via load/dofile (CVE-2018-1999023)
This could otherwise be used to escape the lua sandbox, as described in
multiple sources. For example one can use it to reenable the os.execute
function to do shell commands

The affected functions were
load,loadstring,wesnoth.dofile,wesnoth.require and various places in the
wesnoth source where lua chunks were loaded for example by the ai code.

This commit also changes the lua source to change luas load (which is
the same as loadstring), alternatively we could add a wrapper around the
original load function that always passes "t" as third parameter, i went
this way mostly because it was easier to implement, but also because i
was not 100% sure that is is impossible to query the upvalues of a
function via lua (wesnoth disables debug.getupvalue but still).

There is also an occurance in the application_lua_kernel that was not fixed
because i assumed that umc cannot contian application lua scipts.

As further security measure we might want to disable printing the function
adress in luas tostring for c functions, this cannot be exploited by itself
but it can be used to defeat ASLR in some cases.
2018-07-27 15:36:56 +03:00
ln-zookeeper
386493790e Updated snowy hut tile icons 2018-07-27 14:00:35 +03:00
doofus-01
9042b0beb7 Additional village variations (#3342)
* revised and additional snowed hut villages, with night-light TOD variations

* remove spaces to keep column alignment
2018-07-27 13:32:12 +03:00
Jyrki Vesterinen
e961cc0899 Fix: we negate an unsigned integer
Negating an unsigned integer still returns an unsigned value
(in other words, always positive) which isn't what we want.
2018-07-27 11:35:54 +03:00
jostephd
6e31c83c64 Fix sorting of units by level in Recall List and Unit List (#3370)
Now the triangle points down when the list is sorted by level descending.
2018-07-27 10:29:02 +03:00
joeylmaalouf
96d8ee06b0 updated contributors list 2018-07-25 19:29:55 -04:00
joeylmaalouf
05c6e397ba Tutorial: standardize Menu references 2018-07-25 19:29:49 -04:00
joeylmaalouf
9240d6d23d Tutorial: provide more detail about the Status Table 2018-07-25 19:29:42 -04:00
sigurdfdragon
ee798121e4 DM: Add last breath dialog for Zorlan 2018-07-25 19:29:37 -04:00
sigurdfdragon
3cfa413cbc DM: Generalize death message so it works when Delfador is young and old 2018-07-25 19:29:31 -04:00
ProditorMagnus
625f18ab2e Make /q sl and status case insensitive 2018-07-24 22:26:30 +03:00
Toom
aab10daac4 Show "failed to fit" message with single timestamp (#3367)
Before:

20180724 17:21:37 error gui/layout: Failed to fit vertical list to requested rect; expected bottom edge was 277
20180724 17:21:37 error gui/layout: , actual bottom edge was 195
20180724 17:21:37 error gui/layout:  (top edge is 113)

After:

20180724 17:34:30 error gui/layout: Failed to fit vertical list to requested rect; expected bottom edge was 277, actual bottom edge was 195 (top edge is 113)
2018-07-24 17:57:05 +03:00
Nils Kneuper
36ecc030a6 updated British English translation 2018-07-23 23:16:44 +02:00
Toom
c0727bacf3 Fix 4801629ab1 typos
[ci skip]
2018-07-23 17:34:22 +03:00
gfgtdf
b684c8b3aa fixup update changelog.md 2018-07-23 17:33:41 +03:00
gfgtdf
4801629ab1 Update changelog.md 2018-07-23 17:33:30 +03:00
Jyrki Vesterinen
d8e2498dde Create a named struct for terrain name and movement pair
This allows the sorting logic top be shared between the sidebar and the
unit preview pane. It also means that we no longer need to create a lambda
to sort them.

I also refactored the generation of movement cost data in help. In
particular, we're no longer extracting the struct to named local variables.
2018-07-23 17:25:24 +03:00
lilinitsy
61b7e7298b Sort the movement costs in the tooltip in ascending order (#3305)
Sort movement costs in tooltip, unit preview pane, and unit description alphabetically.
2018-07-23 17:16:56 +03:00
Jyrki Vesterinen
aea5d67f93 Changelog: fix issue #3277 being mistyped as 3722 2018-07-23 15:13:56 +03:00
Martin Hrubý (hrubymar10)
097c89f916 Update README.md for Xcode builds 2018-07-23 09:42:49 +02:00
Iris Morelle
74cbae01c4 pofix: Rule for an http:// → https:// conversion in translatable strings 2018-07-22 07:31:32 -04:00
Iris Morelle
bb86afcb72 gui2/unit_recall: Fix i18n issues
The original commit adding the Rename Unit button marked two strings in
the C++ source for extraction without making them translatable.
2018-07-22 07:30:46 -04:00
Elvish_Hunter
af63d17e32 wmlindent: fixed crash on non-existent paths
Fixes #3346
2018-07-21 21:12:20 +02:00
sigurdfdragon
f6f1093661 SotA S21: Fix #3293: Nagas stealing villages
By having the nagas be able to recruit and put the gold to use.
Fits dialog better, improves play, & makes naga leader less suicidal.
2018-07-20 21:12:03 -04:00
Nils Kneuper
99cfb028d8 updated British English translation 2018-07-19 21:39:41 +02:00
Charles Dang
263ad96ad3 VS: updated README
[ci skip]
2018-07-19 19:41:24 +11:00
Severin Glöckner
0ca460efcd Macro reference: Add hint to clear variable afterwards
[ci skip]
2018-07-19 01:45:47 +02:00
Nils Kneuper
111b5db7b4 updated Bulgarian translation 2018-07-17 22:57:35 +02:00
Nils Kneuper
6295e82238 updated British English translation 2018-07-17 22:50:25 +02:00
Martin Hrubý (hrubymar10)
bc4d22dc72 Migrate links to https if available - Fwd c18537edc0 2018-07-16 19:07:08 +11:00
Łukasz Hryniuk
c11ac9081b Add about.cfg entry 2018-07-16 08:16:51 +11:00
Łukasz Hryniuk
349b18b216 gui2: allow renaming units in the Recall dialog 2018-07-16 08:16:51 +11:00
Celtic Minstrel
45674a3d79 Fix AI ignoring teleport locations when moving leader to leader goals 2018-07-15 10:56:17 -04:00
Celtic Minstrel
99233339dd wesnoth.find_path: Allow specifying custom flags (in particular teleport) when using a custom cost function 2018-07-15 10:56:17 -04:00
josteph
d2c8c1ae0d THoT S9: Implement a victory condition closer to the one described in the objectives.
The previous condition was, "Win as soon as Aiglondur and Angarthing
have each touched the signpost".  The new condition is, "Win as soon
as Aiglondur is on the signpost and Angarthing is next to him, or the
other way around".

[ci skip]
2018-07-15 16:29:54 +02:00
Severin Glöckner
74b39ef3d6 Tutorial S1: followup previous commits
- Removed need for quick trait by spawning quantain next to Delfador
- Disabled movement point tracking due to #3344
- Use only one [label] tag to place both labels
- Removed id's of later quintains, as they are not used
- added some whitespaces

[ci skip]
2018-07-15 16:29:46 +02:00
Andras Szell
e3a95cc039 Tutorial S1: prevent getting stuck next to Delfador, unable to end turn
Fixes #1584 1c - Delfador summons the puppet, you have 0 MP left but the
                 puppet is not adjacent to you, and can't attack or undo

Changed Delfador's initial position to match the quintain's, and made him
step away to summon in the original place next to us, so we don't need to
move again to attack after we reach him.
The movement points of the mage are now updated and he gained quick trait
to fit for the more movements he does.
Final movement also touched, so he does not seem to sidestep the new
enemies when leaving the map.
2018-07-15 16:29:46 +02:00
josteph
af71bfe9c7 WML: Support the the 'jamming' key in [unit].
This syntax is already in use in the test scenario.
2018-07-15 09:43:05 -04:00
Charles Dang
06c723636a Fixed base64 images not being translated to textures 2018-07-15 21:33:00 +11:00
Charles Dang
300197e9c0 GUI2/Dispatcher: pass the message parameter for message events around as const
Really no reason for it to be non-const. That would imply the message's contents should
be modifiable, but that doesn't make sense.
2018-07-15 16:49:49 +11:00
Charles Dang
b47b6f1359 GUI2/Dispatcher: simplified callback function aliases with an alias template
This guarantees all events have the same initial four parameters. Also improved documentation.
2018-07-15 15:49:37 +11:00
Nils Kneuper
e4da51adc3 updated Czech translation 2018-07-14 23:54:08 +02:00
josteph
f4aa5ac66a THoT S6: Highlight the hut mentioned in dialog.
[ci skip]
2018-07-14 21:41:58 +02:00
josteph
96fffa2182 THoT S3: Marth-Tak faces east before hailing Aiglondur.
[ci skip]
2018-07-14 21:41:58 +02:00
josteph
fbd08b006e THoT S4: Let the enemy recruit level 2 units on normal difficulty.
[ci skip]
2018-07-14 21:41:58 +02:00
Severin Glöckner
3c57546e89 THoT S6: improve mage appearance event
- is now less odd if the event is triggered from the map borders
- works with debug mode

[ci skip]
2018-07-14 21:39:27 +02:00
sigurdfdragon
d0931ae9cf DM: Fixup 370e50c 2018-07-14 13:35:21 -04:00
Jyrki Vesterinen
d11d8ec8e1 Help: Hide "Lit Stone Wall" terrain (#2966)
The terrain was deprecated in commit 64493b256f.
@Vultraz has said in comments of #2966 that deprecated terrains aren't
supposed to be shown in help.

Fixes #2966.

[ci skip]
2018-07-14 17:00:24 +03:00
Nils Kneuper
0a35507f3f updated British English translation 2018-07-14 11:02:35 +02:00
gfgtdf
08d907e570 add a comment 2018-07-14 16:57:37 +11:00
Charles Dang
c0b09315d1 Language Selection: declared an execute function 2018-07-14 16:20:34 +11:00
Charles Dang
637e69f271 Used the return value of modal_dialog::show instead of an explicit retval check when possible 2018-07-14 16:17:59 +11:00
Charles Dang
85e9b40495 GUI2: added/renamed widget data types aliases
Also moved the string_map alias into the GUI2 namespace and renamed it widget_item.
It's the same as utils::string_map, but this makes its purpose clearer.
2018-07-14 16:07:12 +11:00
Charles Dang
e62ec5f806 GUI2/Tree View: use NOTIFY_MODIFIED events instead of manual callbacks
Unlike other widgets where `this` is the event target, the tree nodes fire the event
with the tree widget itself as the target.

I had added a fire-event call in f97dc8ae12, but with
the target as the node. I don't think there was any way that would have worked...
changed.
2018-07-14 12:09:06 +11:00
Charles Dang
996551e6f7 GUI2/Tree View [Node]: formatting cleanup 2018-07-14 11:54:35 +11:00
DisherProject
d5e22a32c3 DM: add some TODOs 2018-07-13 20:28:23 -04:00
DisherProject
d0a369c65d DM S21: Add some visual effects
1) Give elves orcish bows
2) Animate the first two riders when they're spawned, so it
looks like they've been recruited
2018-07-13 20:28:23 -04:00
DisherProject
370e50c5a6 DM utils/sides.cfg: follow up FIXME 2018-07-13 20:28:23 -04:00
DisherProject
289af5ba1b DM S14: follow up TODO 2018-07-13 20:28:23 -04:00
DisherProject
4a9c6610d4 DM S08: Remove some (apparently) unused stuff 2018-07-13 20:28:23 -04:00
Nils Kneuper
fb4dbb3fce updated Japanese translation 2018-07-14 01:21:52 +02:00
Nils Kneuper
3a3bf21e37 updated Hungarian translation 2018-07-14 01:15:20 +02:00
Charles Dang
8da9f0cc04 GUI2/Tree View Node: used std::make_shared when possible
Child nodes were still managed with unique_ptrs in 1.14, so we couldn't use make_unique
there. Child nodes are now managed with shared_ptrs here on master.
2018-07-14 06:38:08 +11:00
Charles Dang
ae7d05e8fc MP Staging: move side nodes when changing teams instead of recreating them
Mp Join Game will require further refactoring; it recreates the entire tree when receiving data...
2018-07-14 06:32:44 +11:00
Charles Dang
fa7c967c0a GUI2/Tree View: added interface for moving nodes between parent nodes 2018-07-14 06:32:43 +11:00
Charles Dang
d5972c6f43 Synced 1.14.3+dev changelog section with the 1.14 branch
[ci skip]
2018-07-13 21:03:51 +11:00
Charles Dang
8fcd3f2a83 Reapply d0100758f8 2018-07-13 21:02:13 +11:00
Charles Dang
264389807c Upgrade to Lua 5.3.5 2018-07-13 21:02:12 +11:00
Charles Dang
8abb1965cb Fixup f7cf733 again 2018-07-13 18:30:52 +11:00
Charles Dang
64067dde09 Attempt to fixup f7cf733
Also made the map generator array static
2018-07-13 18:19:37 +11:00
Charles Dang
5bb72d7c89 Remove reference to players_changelog 2018-07-13 16:58:28 +11:00
Charles Dang
f7cf73307b Convert some more C arrays to std::array 2018-07-13 16:15:00 +11:00
Charles Dang
4c29a0dd58 Use '\t' instead of static_cast<char>(9) 2018-07-13 15:53:20 +11:00
Charles Dang
ce85c17020 Convert a few remaining C-style casts (for char) too static_cast 2018-07-13 15:48:20 +11:00
Charles Dang
5595c12e93 Removed players_changelog.md
[ci kip]

We decided to no longer use this and everything in here is also in the full changelog.
2018-07-13 08:45:50 +11:00
Nils Kneuper
9f16ce658b updated Spanish translation 2018-07-12 22:29:40 +02:00
Nils Kneuper
94b5e1fc52 updated Scottish Gaelic translation 2018-07-12 22:28:23 +02:00
Jyrki Vesterinen
95f19745ca Fix #2813: wrong chat color after a side is unassigned from a player
Regression from commit 36e9290.

As @gfgtdf pointed out in the bug report, because old_player was a
reference to the shared_ptr, resetting the shared_ptr in sides_ also
changed old_player, and thus 'the player lost his last side' check never
passed.

Thanks to @gfgtdf for figuring out the cause.
2018-07-12 07:35:19 +03:00
Severin Glöckner
5f7e8bd749 UtBS: change weapon name of the corrupted elf
to match the one of the Champion, and to match his sprite.

closes #3323
[ci skip]
2018-07-11 15:58:22 +02:00
Severin Glöckner
591b1cd68e TSG, end of campaign: Use linger mode to allow to review the current scenario.
Only after pressing the 'End Scenario' button the epilogue will be shown.

closes #3058
[ci skip]
2018-07-11 15:44:49 +02:00
Jyrki Vesterinen
1699c0d3f9 Fix #2789: lobby chat scrolls to top on new messages if not at bottom 2018-07-10 19:54:34 +03:00
sigurdfdragon
4fbeff273a Update changelog 2018-07-10 12:44:53 -04:00
sigurdfdragon
831e3e86d8 DM: Fix #3277
Make heroes have no upkeep, and remove hero status from character that
didn't need it. Minor touch ups.
2018-07-10 12:44:16 -04:00
Severin Glöckner
d4a6df034e TSG S4: improve magican's movement behaviour
- the movement restriction won't be applied if the magican is not
  in the caslte (due to the one exception).
- As for the exception, it's not enough if the magican has only one
  unit left, but this unit has to be on the caslte.

To sum up, the magican never leaves the castle, unless he has
(before recruiting) one last unit which is on the castle. (Maybe
from last turn's recruiting).
In case he left the castle, he goes back next to the keep next turn,
as leaders usually do.

[ci skip]
2018-07-10 01:59:58 +02:00
Charles Dang
d8426ac37a Updated changelog
[ci skip]

The chatbox entry was redundant.
2018-07-09 14:58:10 +11:00
Charles Dang
60950a797f Unit Recall: marked some sorting options as translatable
This matches Unit List.
2018-07-09 14:48:03 +11:00
Charles Dang
94db6ba8c5 Unit List/Unit Recall: simplified level sorting functionality 2018-07-09 14:47:24 +11:00
Charles Dang
c41da8255d GUI2: cleaned up a whole bunch of widget-related includes
gui/widgets/settings.hpp was rendered unnecessary in almost all dialog and widget files
as of 6759f41b1e, since it was no longer needed to implement
the internal functions wrapped by the REGISTER_DIALOG and REGISTER_WIDGET macros. Those
were register_window() and register_widget(), respectively.
2018-07-09 13:42:05 +11:00
Nils Kneuper
8b7410317a updated Chinese (Simplified) translation 2018-07-08 23:24:48 +02:00
Charles Dang
19c78fc1c2 Help: removed an unnecessary use of t_string as a map key 2018-07-09 08:03:44 +11:00
Iris Morelle
aa1976f090 pofix: Add rules for whitespace/dot count-changing commits
[ci skip]
2018-07-08 04:55:53 -04:00
Iris Morelle
de8d468b14 Fix excessive dots in ellipses in several mainline scenarios
[ci skip]
2018-07-08 04:49:37 -04:00
Iris Morelle
b8b403185e gui2/preferences: Use curly quotes in quoted text in tooltips
[ci skip]
2018-07-08 04:49:33 -04:00
josteph
dcbdac8ab5 Help: only use male_name/female_name if the unit has male/female variants. 2018-07-08 15:54:54 +11:00
josteph
a4b0de5ece Help: Use female_name and name as fallback when male_name is empty and don't list hidden traits.
This algorithm was lifted from help::generate_trait_topics().

Fixes #3284
2018-07-08 15:54:41 +11:00
josteph
29e814d8f4 THoT S7: Select Darchas so the narrator's reference to him isn't dangling. 2018-07-08 15:53:40 +11:00
Severin Glöckner
7ea951d5b9 TSG 04: Better implementation to protect the magican
The player can all the time view the stats of any unit in the sidebar. This allowed to
see that he doesn't attack because he has only one move. There is no way to see the
movement costs directly, and as long as they are higher than the max_moves it's not
possible to figure out that this is not AI behavior but a game restriction.

Additionally, as the player has to kill both leaders to continue, try to not let the
player camp around the castle for the rest of the game, by giving the leader a possiblity
to attack if he recruited last turn a unit.

[ci skip]
2018-07-06 22:33:56 +02:00
Jyrki Vesterinen
00d8548c24 Damage prediction: round very close slow probabilities to 0 or 1
In the case in bug #3321, damage prediction code somehow receives a
combatant whose probability to be slowed is very close to one of those
values but not quite it. I couldn't figure out how it's possible because
only damage prediction code itself is supposed to emit slow probabilities,
and it's not producing such a probability in this case.

Without more information, I'm simply fixing the bug by force. If the
probability is in the problematic area, we simply round it to 0 or 1. This
way such probabilities are impossible later on when we try to scale the HP
distributions so that they add to 1.

Fixes #3321.
2018-07-06 22:55:14 +03:00
Severin Glöckner
5bd6221c44 slight text edits
- missing dots in some MP strings
- superfluous space in some MP strings
-ran wmlinden on UtBS scenarios

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
2a5ea00ad0 Replace deprecated macro with terrain code in MP: Tombs of Kesorak
[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
f5890c10a2 Change campfire timezones in MP: Tombs of Kesorak
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is a visual change, no gameplay changes included.

For the always dark one exists no immage, uses one from after the fall,
with slightly adjusted ToD shifting as it looked to weak.

The 1 hex small campfires look best with dusk.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
f2a1acd97e Change Campfire timezones in TSG S8b
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is an visual change, no gameplay changes included.

Due to the lack of a save I could not view the result myself,
I chose the ToD shifting colors based on the other scenarios.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
c7d8d23256 Change campfire timezones in UtBS S3
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is a visual change, no gameplay changes included.

The ToD shifting for 'dawn' looked better than for 'dusk', and was
conidered better looking than having no ToD shift compared to the
surrounding.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Celtic Minstrel
41e757be9f Fix incorrect formatting of probabilities in the sidebar
This resulted from an incorrect use of std::setprecision, which sets the number of significant figures to display, not the number of decimal places.
2018-07-05 12:49:12 +11:00
josteph
045d331da8 WML: Don't add a \n before condition=lose objectives if there are no objectives listed before them. 2018-07-05 12:46:44 +11:00
Choicerer
02bdd17994 Fix team chat not being marked on remote clients (#3314)
Fixing the lack of stars on the remote client when sending a team/observer message.
This commit didn't modify the necessary lines in replay.cpp:
6aa3b3b
(of which the chat_msg::chat_msg one has already been fixed)

Fixes #3119
2018-07-05 12:46:43 +11:00
Choicerer
f50b644c30 Fixes broken tooltips for the unit_side flag and the unit name. (#3315)
Fixes #3306
2018-07-05 12:46:42 +11:00
Severin Glöckner
785f91065b NR: Disallow lvl 0 recruits after scenario 5.
Don't bother carrying them through the whole campaign.
This scenario seems like a good time, because there begins a new episide in the story
and all the level 1 advancement are available now too.

closes #3074

[ci skip]
2018-07-05 02:04:23 +02:00
sigurdfdragon
d22c1746e8 SotA S21: Set facing for naga appearance 2018-07-04 18:06:57 -04:00
sigurdfdragon
7d60eeeefb Update changelog 2018-07-04 17:43:42 -04:00
sigurdfdragon
2f710f83bf SotA S11 & 21: Fix #3294
Adjust units to have appropriate gender for story reasons.
2018-07-04 17:13:15 -04:00
sigurdfdragon
fd43d8454c SotA S16: Simplify dialog to fix #3291 2018-07-04 13:52:48 -04:00
Severin Glöckner
a62264412d DiD S10: add a redraw
apparently it happens normally only after dismissing the objectives

[ci skip]
2018-07-04 15:45:39 +02:00
Severin Glöckner
090ad3140f TSG S4: prevent leader of the undeads from suiciding
This is generally a problem with most leaders, but here it's worse.

Also changed his keep to the ruined version.
(Not the ajdacent castle tiles as it looks better that way.)

[ci skip]
2018-07-04 15:45:39 +02:00
Severin Glöckner
a66b30312b wmlxgettext: insert links which use ssl
[ci skip]
2018-07-04 03:46:37 +02:00
newfrenchy83
411eb6105d Update CB project (#3307) 2018-07-03 20:50:36 +11:00
Severin Glöckner
5dc80e7428 TSG S5: fix an unlikely scenario outcome
In case the player goes south and runs away fromt he bandits, and defeats
the lich first, then the choice to side or not with the bandits would
happen very late.
In case he allied with them and the other undead leader still lived, he
could end the scenario still by triggering "enemies defeated". If they were
already defeated, the scenario could not end anymore. Furthermore, the
storytext doesn't make sense anymore, at least the ending dilogue would
miss,
In case of siding with the elves one can still win by defeating Urza Afalas.
and the story still makes sense,

To solve this, in this special situation the player has no choice anymore,
the path of the elves is chosen.

(the diff may be hard to read; a good part has been wrappend with an [if])

[ci skip]
2018-07-03 04:12:51 +02:00
josteph
ea62caadf0 TSG S05: Merge all instances of [objectives].
Suggested by @sevu.
2018-07-03 00:48:34 +02:00
josteph
f4ba5cbcb8 TSG S05: Hide completed objectives.
Fixes #3031.
2018-07-03 00:48:34 +02:00
Charles Dang
c39aa72f56 Fixup 7807694
[ci skip]
2018-07-03 06:58:31 +11:00
Charles Dang
78076941a0 DiD S6: fixed previously stored orc leader ending up in the wrong place (fixes #3304)
[ci skip]
2018-07-03 06:48:57 +11:00
Charles Dang
e2fd9749a6 Re-enable the --new-widgets tests for general dialogs 2018-07-03 04:44:13 +11:00
Martin Hrubý (hrubymar10)
dc6d5850f5
Fix Xcode project after 458dd284b8 2018-07-02 18:59:35 +02:00
Charles Dang
162b9de330 Updated VS projectfile
[ci skip]
2018-07-02 22:25:51 +11:00
Charles Dang
458dd284b8 GUI2: removed 2010 experimental listbox
This was never finished, is not maintained, suffers from a lack of features the "old" listbox
class now has, and seems (according to the logs) to be have been superceded by the pane widget.
At the very least, the pane widget seems to be what mordante was working with in his early
prototype of a new addon manager, and not this 2010 list class.
2018-07-02 22:22:17 +11:00
Severin Glöckner
9a37fe3a07 copied German translation to maser
primary reason is rather to have less problems if
someone uses the master files when translating for 1.14

[ci skip]
2018-07-02 04:20:47 +02:00
Charles Dang
9fe86315f5 GUI2: dropped a remaining t-prefix from a type 2018-07-02 13:08:48 +11:00
Charles Dang
6cc3d1427c Disable in-game HUD for now
Need to sort out the problems with dispatching events to the HUD or the gamemap, respectively.
Disabling the HUD for now so it should be possible to interact with the map in case someone
wants to work on its rendering.
2018-07-01 23:41:08 +11:00
Nils Kneuper
478df79f31 updated Chinese (Traditional) translation 2018-07-01 11:09:28 +02:00
newfrenchy83
882eeb52ab Enable C++17 in Code::Blocks 2018-06-30 11:42:45 +03:00
Jyrki Vesterinen
d8eada856a Fix build 2018-06-30 10:57:42 +03:00
Jyrki Vesterinen
3a5c2df0a1 Remove unnecessary heap allocation 2018-06-30 09:47:37 +03:00
Charles Dang
fa01fb14d2 MP Join Game: cleaned up implementation of the recent players-choose-factions changes 2018-06-30 17:23:17 +11:00
gfgtdf
a2a4dff050 fix code dublication of mp_join_game::show_flg_select
this also fixes a bug where the side number in the initial flg dialog would be off by one.

This is also a slight behviour change where not finding [era] in mp_join_game::fetch_game_config no longer throws config::error but just returns false (=cannot join game)
2018-06-30 01:12:15 +02:00
gfgtdf
0296b6068c add a comment 2018-06-30 01:11:54 +02:00
gfgtdf
c555127552 mp join: fix crash when the dialog is updated while the flg dialog is open.
we cannnot call show_flg_select from inside the select_leader_buttons callback because that select_leader_buttons might be deleted/recreated while that dialog is open whihc leads to crashes, so what we do is executing the show_flg_select
 in a seperate callstack by using a 0 ms non-repeating timer
2018-06-30 01:08:07 +02:00
gfgtdf
2dd6557449 cancel faction_select when the game starts
or when the hosts assigned  control of  that side to another player.
2018-06-30 01:07:50 +02:00
gfgtdf
c805897797 make flg manager not store confg& side_
in the non-host case the clients might get updates that change the [side] config while the flg dialog is open which might result in invalid pointers,  note that flg_manager::default_leader_cfg_ is still there but this is no problm because that is never dereferenced it's only compared to other pointers.

we also make a copy of all [multiplayer_side] on the non hosts side for the same reason.
2018-06-30 01:07:40 +02:00
gfgtdf
5ba389111e allow non hosts to change factions later.
previously players had to leave an rejoin the game to change their faction.
this was most annoying in coop games where you want might want to choose
your faction in consultation with the other players. Also you previously could
not even checkout the different available factions again after you joined
the game.
2018-06-30 01:07:30 +02:00
gfgtdf
26b5ca55e4 disallow attacking with disabled attacks via [do_command]
this fixes some rare cheats in mp.
2018-06-30 01:06:59 +02:00
pentarctagon
649fdc9a62 Remove unused images from Dead Water.
Also confirmed via PM with beetlenaut that they can be removed, and aren't supposed to still be there.
2018-06-29 15:35:22 -05:00
Charles Dang
2ad6b60c94 CVideo: tweaked non_interactive logic
"Fake interactive" mode seems like it was meant to be an interactive version of fake mode.
However, since we're using it to stop the UI drawing and the unit tests (which use it)
don't seem to display a window at all (not entirely sure why), it's weird that "fake interactive"
mode would be considered interactive.
2018-06-30 05:26:36 +11:00
Charles Dang
87ae234022 Revert recent test changes 2018-06-30 04:02:55 +11:00
Charles Dang
55caeebffe More testing... 2018-06-30 03:54:42 +11:00
Charles Dang
58110b6818 Fixup b0be17b 2018-06-30 03:41:46 +11:00
Charles Dang
b0be17b398 Experiment: don't run the unit tests in fake interactive mode
This might not be needed anymore now that we no longer have a framebuffer surface.
2018-06-30 03:28:30 +11:00
Charles Dang
98ddc311fc Preferences: added a mention of the in-game accelerated speed toggle
[ci skip]
2018-06-29 18:21:55 +11:00
Charles Dang
10e663ed6c Preferences: shifted the Skip AI Moves button around
[ci skip]

Makes it clear it's not intrinsically tied to the Accelerated Speed factor.
2018-06-29 18:21:55 +11:00
Charles Dang
cb7a679142 Preferences Dialog: drop characters_per_line from hotkey list
[ci skip]

For some reason, this made the entire page stack thinner than it should be. I have
no idea why, and I'm not sure wrap= here instead does anything (namely, wrap if it
gets too long), but it's better than what was happening before.
2018-06-29 18:10:02 +11:00
Charles Dang
226a7f7d02 Removed preference to disable halos
There's really no reason to have this anymore. It was (AFAIK) introduced years ago
as a performance-saving measure, then was moved to Advanced Preferences in 1.13 since
modern PCs mostly have no issues. With accelerated rendering, there's even less of a
reason to have this.
2018-06-29 15:07:48 +11:00
Charles Dang
399851d035 Sneaky C-style arrays be hiding
Also dropped some unused code in unit_type.

And there's still one in language.cpp, but I'm not entirely sure if it's safe to
drop the last empty entry there so I left it.
2018-06-29 14:55:02 +11:00
Gunter Labes
51b5549bd2 Fix line endings
[ci skip]
2018-06-28 22:02:17 +02:00
Charles Dang
9e29c2f1d1 Editor: don't make unit type copies in the editor palette 2018-06-29 05:53:44 +11:00
Charles Dang
292d6f407c Plugins/Context: removed C-style array ctor and use
This likely existed because this code was added in 2014 before we switched to C++11
and initializer lists.
2018-06-28 17:21:54 +11:00
Iris Morelle
ceca46c553 wmllint: Exit with non-zero status after failing to read any directories
[ci skip]
2018-06-28 00:32:18 -04:00
Iris Morelle
fbc9ac5a52 wmllint: Skip inexistent paths passed in the command line
Fixes issue #3286.

[ci skip]
2018-06-28 00:27:28 -04:00
Jyrki Vesterinen
7fc6a23643 Fix insufficient struct initialization in init_mouse_location()
See pull request #3252. This is the fix @Vultraz prefers to the PR.
2018-06-28 06:37:40 +03:00
Charles Dang
9c311e2ca5 MP Lobby: escape any game name formatting *after* receiving it from server
This avoids an issue where people could still apply formatting by using an older client.
Granted, any formatting would still appear in-lobby to anyone using an older client, but
this at least prevents the possibility of formatting appearing indefinitely if a game host
happens to never update their own client.
2018-06-28 10:42:44 +11:00
Charles Dang
0cbbed2832 Updated a credits entry regarding the Dunefolk
[ci skip]
2018-06-28 10:42:44 +11:00
Charles Dang
87fcacbd28 Revert "MP Create Game: escape any formatting applied to game name"
This reverts commit 58a2e23a0c.
2018-06-28 10:42:19 +11:00
Charles Dang
58a2e23a0c MP Create Game: escape any formatting applied to game name
This is a good point since it ensures any place that might use the title before the lobby
(don't think there's any such places right now) won't inadvertently get formatted.

Also might be worth looking into a way to just strip formatting completely.
2018-06-28 09:41:46 +11:00
Iris Morelle
c92e167a14 wmllint: Leave gzipped binary files alone, they're not safe for consumption
Fixes wmllint crashing like this upon encountering a gzip tarball in an
add-on:

  Traceback (most recent call last):
    File "/home/shadowm/bin/wmllint-1.14", line 3188, in <module>
      for fn in allcfgfiles(directory):
    File "/home/shadowm/bin/wmllint-1.14", line 2944, in allcfgfiles
      if interesting(os.path.join(root, name)):
    File "/home/shadowm/bin/wmllint-1.14", line 2927, in interesting
      return fn.endswith(".cfg") or is_map(fn) or issave(fn)
    File "/home/shadowm/src/wesnoth-1.14/data/tools/wesnoth/wmltools3.py", line 270, in issave
      return firstline.startswith("label=")
  TypeError: startswith first arg must be bytes or a tuple of bytes, not str

[ci skip]
2018-06-27 03:42:58 -04:00
gfgtdf
ff82a007d5 wb: fix wrong simulated movement points when planning to capture a village. 2018-06-27 11:20:34 +11:00
gfgtdf
17a9164904 wb: remove outcommented code 2018-06-27 11:20:33 +11:00
gfgtdf
3a28c3a346 wb: don't remove invalid actions from other players
this would bring the whiteboard data of the differnt clients out of sync  which could be a problem since the wb network protocoll identifies the actions to be removed ot replaced by index.
2018-06-27 11:20:32 +11:00
gfgtdf
ee00b88427 wb: dont send delete of actions of other sides 2018-06-27 11:20:32 +11:00
Jyrki Vesterinen
4bda3e7311 Fixed saving a map as a scenario not enabling scenario editor tools 2018-06-26 20:31:30 +03:00
Andras Szell
1ea4149a44 Fix: add redraw to narrator's message so village count is refreshed
Fixes: https://forums.wesnoth.org/viewtopic.php?f=21&t=48370

In the tutorial when we occupy the first village the message tells us the
village count got incremented, but in the old version it was incremented
only afterwards. Non-narrator messages were updated properly. By adding the
redraw, narrator messages triggered by capture event produce the same
result as other speakers.
2018-06-26 18:45:17 +11:00
DisherProject
902cf6dcfb Fix weapon specials marked as inactive 2018-06-25 21:30:52 -04:00
Charles Dang
0aa60a7b4c Revert "Swapped the first watch and second watch ToD graphics"
[ci skip]

This reverts commit 11ca2d8ad8.
2018-06-25 22:49:19 +11:00
Charles Dang
893860321a Unit Advance: left-align header
[ci skip]
2018-06-25 21:59:45 +11:00
Charles Dang
b40c666ad2 Convert a bunch of C-style arrays to std::array 2018-06-25 18:38:00 +11:00
Charles Dang
fbcdec7142 Lobby Data: removed unused era_short field 2018-06-25 18:04:10 +11:00
Charles Dang
3147be8771 Fixup 862b086 2018-06-25 17:03:54 +11:00
Martin Hrubý (hrubymar10)
fe8e1ce397
Fix Xcode project after dd69107c9b 2018-06-25 07:45:42 +02:00
Charles Dang
862b086ba9 Fixup tests for 4eee386 2018-06-25 16:38:23 +11:00
Charles Dang
dd69107c9b Removed scaling algorithm customization
We're going to be using NN scaling for the map, and that's already handled automatically
by SDL (and in the future, OGL). We don't need these settings for surface SCALED_TO_ZOOM
and SCALED_TO_HEX scaling. In any case, if we want to scale a surface to zoom or hex, it
will almost certainly be for map rendering (such scaling methods don't make sense in the
UI, for example), so just defaulting to NN is simplest.

As for why I've decided to stick with nearest-neighbor scaling for zoom, it happens to look
a lot better when done on the GPU than on the CPU for some reason (perhaps having to do with
the old rendering pipeline in which we were doing surface scaling), and it's better to have
a consistent scaling look as you zoom in, especially if we wanted to do animated zoom-ins.

This change drops the option to use Linear or xBRZ scaling for map zooming. This was already
the practical case due to me converting map rendering to use textures. NN was used for all
zoom levels, and it's fast and looks good.
2018-06-25 16:37:27 +11:00
Charles Dang
feb99c384a Cleaned up a few game_config_manager.hpp includes 2018-06-25 15:15:25 +11:00
Charles Dang
4eee386664 Stop passing a milion game_config refs around during game initializaton
There are only 3 places where it's actually really needed. Used the game_config_manager
singleton to retrieve a reference in those cases.
2018-06-25 14:57:05 +11:00
Charles Dang
11ca2d8ad8 Swapped the first watch and second watch ToD graphics
[ci skip]

See #1905.
2018-06-25 13:41:46 +11:00
Charles Dang
cd3c13aca2 Cleaned up addon loading process
This makes it so addon metadata (title, version) will be fetched from _server.pbl if
present and _info.cfg if not (see #3278).

This also eliminates the temporary addon_source struct and unifies the metadata parsing
and actual loading stages. They used to be separate since single-file addons were a
thing, but those were removed in 3f640b8e71.

Also a bunch of minor code cleanup.
2018-06-25 07:15:36 +11:00
josteph
fb88f40b61 Replay: Don't disable the "Point of view" button after reset
Fixes #3107
2018-06-24 18:48:52 +03:00
Iris Morelle
1db6fb393e campaignd: Detect .po files in add-ons and add them to the list of locales 2018-06-24 04:52:56 -04:00
Martin Hrubý (hrubymar10)
583b0f14b4
Remove old_markup.*pp from Xcode project 2018-06-24 09:18:21 +02:00
Iris Morelle
e46c05162f sound: Halt sound sources that go inaudible instead of fading them out
Fixes #3280.
2018-06-24 00:36:36 -04:00
Charles Dang
15917733e0 GUI2: removed legacy DescriptionWML parser
It's no longer needed.
2018-06-24 04:15:58 +11:00
Charles Dang
5c860aee48 GUI2/Message: removed deprecated handling of legacy DescriptionWML
Left a TODO to implement the "specify options with a single string" thing the
old comment mentioned.
2018-06-24 04:15:58 +11:00
Charles Dang
c8a8b82b9f Game Events/Menu Item: removed deprecated handling of legacy DescriptionWML 2018-06-24 04:15:57 +11:00
josteph
bad6897cbc Revert "Excluded data/test/ from tarball"
This reverts commit c934825607.

Keep data/test/ in 'scons dist' tarballs to match official tarballs.
2018-06-23 09:33:30 +03:00
josteph
0ee4854157 Fix 'scons dist'
This makes 'scons dist' work, although the resulting tarballs are not
yet identical to cmake tarballs.

Remove awk usage made obsolete by the git transition
(7f85fa000c).

Update src/revision.hpp reference to use src/revision.h.  The former
name is unused since at least 7625b1e079.
2018-06-23 09:33:30 +03:00
Charles Dang
aca7d4e6df Select Orb Colors: used a widget iterator instead of a walker
The documentation indicates you're not really meant to use the walker directly.
They're part of the implementation of the iterators. They could be used directly,
as shown here, but this is shorter.
2018-06-23 16:29:53 +11:00
Charles Dang
1eaa51b3f9 GUI2/Iterator: added some alias templates and a get() function 2018-06-23 16:27:35 +11:00
Charles Dang
1778dd8581 Actually fixup c3ed9d2bc7 2018-06-23 16:27:22 +11:00
Charles Dang
cd3f7fd8e9 Revert "Fixup c3ed9d2"
This reverts commit 39efb7a2e4.
2018-06-23 07:43:53 +11:00
Charles Dang
39efb7a2e4 Fixup c3ed9d2 2018-06-23 07:26:02 +11:00
Charles Dang
c3ed9d2bc7 GUI2/Iterator/Policy Order: updated for 3bc7c6a 2018-06-23 07:18:52 +11:00
Charles Dang
3bc7c6a3a0 GUI2: manager walker objects with unique_ptrs from the get-go
Needed the extra includes since walker_base's dtor needs to be visible to
unique_ptr's ctor.
2018-06-23 06:54:16 +11:00
Charles Dang
48c13761cc Updated changelog
[ci skip]
2018-06-23 06:03:50 +11:00
Charles Dang
f59f68a527 GUI2/Unit Preview Pane: fixed default race icon not showing for units
Missed in 207e763401. Was only working for unit types.
2018-06-23 05:50:12 +11:00
Charles Dang
6920729812 Pango/Escape: used a stringstream for constructing the escaped text 2018-06-23 04:46:03 +11:00
Charles Dang
b6a0b2cb87 Drop Down List: added documentation and did some code cleanup 2018-06-23 04:41:19 +11:00
josteph
46fb1b6d48 Rename unit_recall_default_compare to default_compare 2018-06-23 04:40:43 +11:00
josteph
5316a83349 Unit List: Sort by XP as second criterion when sorting by level.
Fixes #3260.
2018-06-23 04:40:42 +11:00
Severin Glöckner
37566db87c NR S5a: clarify text
[ci skip]
2018-06-22 18:51:08 +02:00
Pentarctagon
c954117677 Disabling hardening on Windows due to tdm-gcc's poor support.
As per sigurd's trial and error: RELRO's options are unknown entirely and -fstack-protector-strong results in compile errors.  Building with just PIE and _FORTIFY_SOURCE enabled does then compile, but results in a broken executable.
2018-06-22 08:46:34 -05:00
Severin Glöckner
e1cd47b8ec NR S7a: remove dots from objectives
[ci skip]
2018-06-22 11:57:55 +02:00
josteph
175aa81941 MP Faction Select dialog: Always show the leading unit information, never "Unknown Unit". 2018-06-21 06:36:54 +03:00
Jyrki Vesterinen
18c266c2e7 Removed code that creates a help_manager
Adjusts the changes for commit 20a58fd8f8.
2018-06-21 06:34:27 +03:00
josteph
a8f83f6e68 MP Faction Select dialog: Show leader unit details.
If the leader hasn't been discovered, the "Unknown Unit" topic will be shown.

Fixes #1491
2018-06-21 06:30:20 +03:00
Nils Kneuper
e94af64b8d updated Slovak translation 2018-06-20 22:02:22 +02:00
Nils Kneuper
63e4c16f1d updated French translation 2018-06-20 22:01:36 +02:00
josteph
8481927a5a GUI: Fix the direction of the arrow on a listbox sort column header.
This affects the files list in the the "Load Game" dialog.
2018-06-20 18:47:11 +11:00
Pentarctagon
0a7ed44c08 Remove unused test file and images. 2018-06-20 18:46:01 +11:00
newfrenchy83
9bcaf3a897 Update wesnothd.cbp 2018-06-19 21:03:25 +11:00
newfrenchy83
cffd51a425 Update wesnoth.cbp 2018-06-19 21:03:25 +11:00
Iris Morelle
0c2298d8c2 config/cache: Ensure built-in symbols like WESNOTH_VERSION are always defined
Half-fix for issue #1634 and issue #1924.

The issue that remains to be solved is that on subsequent sessions after
a campaign has failed to load, it is possible for the game to generate a
cache entry for it that only contains the main menu WML for it.
Apparently the config cache transactions mechanism causes the game to
try to generate a cache entry with the wrong defines (a define set that
doesn't include the campaign's symbol, for instance) instead of the ones
that are actually needed and used to match the cache entry's filename
via checksumming. As a result, on subsequent sessions the failed
campaign is aborted with "failed to load the scenario" instead of
displaying the real WML error again (since the error is not hit again if
it depends on the campaign's symbol being defined).

In the meantime, this at least removes the red herring error and makes
the underlying issue a bit more visible. It's a very crude hack but it
does the job.
2018-06-18 18:34:02 -04:00
Severin Glöckner
9d95aa776c SotA: reuse mainline string for ancient lich
[ci skip]
2018-06-18 20:11:29 +02:00
loonycyborg
f597494157 flatpak: pass hardening options when building static boost 2018-06-18 12:49:21 +03:00
Charles Dang
c5d6f695dd GUI2/Chatbox: limit input to 256 characters (fixes #3267)
[ci skip]
2018-06-18 20:28:33 +11:00
Iris Morelle
6b2ca32026 U does not precede G in the English alphabet
[ci skip]
2018-06-18 04:49:54 -04:00
Iris Morelle
cdc8da25ae wesnothd: Fix lobby messages and whispers not being truncated as they should
For lobby messages, there was a length cap in place already, but the
truncated message was lost in processing because it ended up in a WML
document that isn't the one relayed to listening clients.

On the other hand, whisper messages were missing the truncate logic
entirely. Oops.

(The logic for in-game messages does truncate messages correctly as far
as I can tell, and additionally the client UI doesn't allow overlong
messages.)

Thanks to Soliton for pointing me towards the faulty code.
2018-06-18 04:48:29 -04:00
Iris Morelle
be41a692fb wesnothd: Only disclose the number of online admins to admins using adminmsg 2018-06-18 00:30:16 -04:00
ln-zookeeper
a98c658742 UtBS: Cropped Kaleh's base sprite back to 72x72
[ci skip]
2018-06-17 11:05:05 +03:00
ln-zookeeper
a702674da2 EI S17b: Prevent spell breaking effect playing out twice (fixes #3254) 2018-06-17 10:53:32 +03:00
Iris Morelle
7294878745 pofix: Add rules to address typographical fixes to race descriptions
NOTE: the rule for the "true orc" case does not work. The string in
question will just have to be fuzzied.

[ci skip]
2018-06-17 02:01:58 -04:00
Iris Morelle
61e94c21a9 Fix several typographical style errors in recent race descriptions
[ci skip]
2018-06-17 01:54:10 -04:00
josteph
d95efd3409 Preferences: Improve label and tooltip of 'Accelerated speed' slider. 2018-06-17 10:42:48 +11:00
josteph
e126e5ba36 Preferences: Keep the acceleration speed slider enabled even when the checkbox is disabled.
Apparently, this also causes the slider's value to be saved when dismissing the dialog with the checkbox disabled.

Fixes #2741
2018-06-17 10:42:47 +11:00
Pentarctagon
2771582222 Fixup hardening options for Windows. 2018-06-16 13:29:15 -05:00
doofus-01
41adc41093 UtBS S08: mostly cosmetic changes to map 2018-06-17 00:32:40 +11:00
doofus-01
13ec0493fc UtBS S06b and S07b: cosmetic changes to maps, to make them more fitting with dialogs 2018-06-17 00:32:39 +11:00
doofus-01
ea3ee2a336 UtBS S06b: make sure dwarf sergeant is facing the right way in comic-relief dialog 2018-06-17 00:32:39 +11:00
doofus-01
a3294cd04d change sun-sylph halo to be warmer, sunny color, instead of clean, holy color 2018-06-17 00:32:38 +11:00
doofus-01
f0b963a2b1 slight tweak to Kalehs base sprite 2018-06-17 00:32:37 +11:00
doofus-01
5fbd494244 UtBS S05: replace troll camps with actual troll camps instead of orc castles 2018-06-17 00:32:36 +11:00
doofus-01
4b1a06a82d UtBS S04 and S05: some variations in scenery items 2018-06-17 00:32:36 +11:00
Nils Kneuper
37ccd83215 updated Slovak translation 2018-06-16 11:15:34 +02:00
Charles Dang
30121aeb9c Select Orb Colors: cleaned up dialog implementation
Also fixes #2958 in the process since the entire setup process isn't repeated
when resetting selections.
2018-06-16 19:58:00 +11:00
Charles Dang
ea2ae55159 Attempt to fix console spam about images not drawing when running the tests
I don't think there's really any point drawing the UI in non-interactive mode.
2018-06-16 15:20:23 +11:00
Charles Dang
f54b3f7225 GUI2/Multimenu Button: fixed maximum_shown defaulting to 0 instead of 1
Fixes the campaign selection dialog's modification dropdown saying "1 other" for
the first mod you select.
2018-06-16 15:06:49 +11:00
Charles Dang
23740ea3cf GUI2/Multimenu Button: store max shown count as an unsigned int
A negative count here makes no sense...
2018-06-16 15:03:45 +11:00
Charles Dang
f95dc40f13 Cleaned up two emplace_back calls 2018-06-16 14:56:12 +11:00
Charles Dang
e8bd3c26d2 GUI2/Menu Button: store selected index as an unsigned int
Also initialized it to 0 in the ctor instead of relying on that being set
via set_values().
2018-06-16 14:54:58 +11:00
Charles Dang
3526aa8e86 Fixup unused parameter 2018-06-16 14:26:07 +11:00
Charles Dang
c2c613325b Faction Select: fixed changes persisting even if you cancel the dialog 2018-06-16 14:03:01 +11:00
Charles Dang
0632f91bd6 Faction Select: declared an execute() helper 2018-06-16 13:47:25 +11:00
Charles Dang
a5169f7c50 GUI2/Menu Button: allow changing selections with the scrollwheel (closes #3251)'
The changelog entry is under 1.14.3+dev since this is going to be backported.
2018-06-16 13:43:42 +11:00
Charles Dang
55f14ff22c GUI2/Menu Button: changed callbacks to NOTIFY_MODIFIED ones
menu_button doesn't even actually inherit from clickable_item. The only reason
[dis]connect_click_handler was declared in this class is the original implementation
was copied extensively from the Button widget.

Using NOTIFY_MODIFIED also means callbacks can fire if set_value/set_selected is used
on a menu_button.

The [dis]connect_click_handler functions were also removed from multimenu_button. All
callbacks for this widget type already used NOTIFY_MODIFIED signals.
2018-06-16 13:26:29 +11:00
Charles Dang
2d9b7d82c6 GUI2/[Multi]Menu Button: removed retval handling
Retvals are only relevant for widgets that are supposed to trigger something
like a window closure, and that makes sense for neither of these widgets. The
only reason the Menu Button widget has it is its original implementation was
largely copied from the Button widget, and the Multimenu Button widget copied
from the Menu Button widget.
2018-06-16 12:53:11 +11:00
Charles Dang
d7edb83b16 GUI2: added a bunch of missing virtual specifiers 2018-06-16 12:46:42 +11:00
Steve Cotton
ad7bc19dd9 Prose: the Storm Trident's description uses "merfolk" (issue #2936)
Also update Dead Water's copy of it to use race= instead of a
list of unit types (as done for the core object in 613dd431).
2018-06-15 21:02:56 +02:00
Steve Cotton
d5f6c17239 Dead Water: Change "mermen" to "merfolk" (part of #2940)
This commit excludes changes to S05 Tirigaz, I think changing the dialogue
there is going to be more complicated, and it's better for that to have a
separate PR.
2018-06-15 21:02:56 +02:00
Steve Cotton
94dd2880c6 DW: Change the team name from Merman Forces to Merfolk 2018-06-15 21:02:56 +02:00
Pentarctagon
da6ebc7423 Fixup for osx hardening options. 2018-06-15 02:18:32 -05:00
Pentarctagon
3290961db2 Enabled hardened executables by default.
The result of running "hardening-check wesnoth" now shows:
* Position Independent Executable: yes
* Stack protected: yes
* Fortify Source functions: yes (some protected functions found)
* Read-only relocations: yes
* Immediate binding: yes
2018-06-15 01:31:31 -05:00
Charles Dang
01d37ca795 End Credits: reduced text surface size by 42%
[ci skip]

Really no reason for the text area to grow since the text is set in pre_show and
therefor the widget is always the right size. >_<
2018-06-15 13:21:11 +11:00
Steve Cotton
ce093e2290 DW S05: Add a po hint about the orc saying "mermen" (part of #2940) (#3243)
The orc calls them fish-men several times, so changing it to "merfolk"
wouldn't fit.

Also a whitespace fix from wmlindent.

[ci skip]
2018-06-13 13:55:04 +02:00
ln-zookeeper
c9bb31d1cc EI S11: Fixed missing prisoners (fixes #3237)
The problem was introduced by commit 0f511e8 due to the [modify_unit] tag apparently causing prisoners to disappear because technically they were duplicates as they had merely been unstored and still existed on the recall list as well.
2018-06-12 23:16:44 +03:00
Iris Morelle
d05de7ced8 doc/wesnoth(6): 'none' is a keyword in the --log-<level> description
[ci skip]
2018-06-12 03:40:15 -04:00
Iris Morelle
e636549497 pofix: Update with 1.14.3 -> 1.14.3a (macOS) rules for the website
[ci skip]
2018-06-11 18:14:50 -04:00
Thom Diment
b3c40498d8 DW 5 Tirigaz - Changes to orc leader death event (#3103)
DW 5 Tirigaz - Changes to orc leader death event

Fixes #3092 - Updates objectives if orc leader is killed first, and gives additional dialogue
Fixes #3903 - Gold event doesn't fire if ghosts kill the orc leader
2018-06-11 14:40:47 +02:00
loonycyborg
c78e95cf6c Update flatpak manifest 2018-06-11 12:18:20 +03:00
doofus-01
636575627d UtBS S12: Make alien central body vulnerability more visible to player 2018-06-11 16:43:36 +11:00
doofus-01
7924649319 UtBS S11: Citadel graphics, drawn over the cavewall donut 2018-06-11 16:43:35 +11:00
Iris Morelle
73680ed764 pofix: Update with 1.14.2 -> 1.14.3 rules for the website
[ci skip]
2018-06-10 22:50:42 -04:00
Charles Dang
e8d55062c4 Fixed MP admins being unable to observe private games (fixes #2851)
This was due to the change in the MP initialization process wherein the lobby wouldn't
show up until the initial gamelist was received. Since the admin auth message is sent
after [join_game] and before the initial gamelist, and the chatbox widget handled parsing
the auth message, the client was never marked as authenticated and therefor couldn't
observe private games. This fixes that by adding auth parsing to the MP initialization
process.

Note this doesn't fix the issue of the auth confirmation not showing up in the lobby chat
(issue #2920). I'll have to think of a way to fix that separately.
2018-06-11 13:05:11 +11:00
Pentarctagon
5a2d1bc992 Fix stack protection with LTO. 2018-06-10 20:23:27 -05:00
Steve Cotton
fbc74bf007 Update core/about.cfg to use "merfolk" instead of "mermen" (part of #2940) 2018-06-11 01:22:06 +11:00
Iris Morelle
a92b83e404 tools: Add steam-changelog
This is a script to take a changelog section (provided in the command
line as such: `steam-changelog changelog.md X.Y.Z`) and convert it to
BBCode for posting on Steam.

[ci skip]
2018-06-10 03:25:43 -04:00
Charles Dang
f1d2f85479 Statistics Dialog: keep the same stat selected between scenario selections
Fixes #3223, closes #3226.
2018-06-10 14:50:14 +11:00
Charles Dang
802443eaf9 Updated changelog
[ci skip]
2018-06-10 14:37:21 +11:00
doofus-01
3f3e13c0b4 peasant attack animations 2018-06-10 14:37:20 +11:00
doofus-01
c398a8fa86 change ruffian attack anim timings 2018-06-10 14:37:19 +11:00
Charles Dang
8baeb8457d Added an advanced preference for the PRNG combat option
[ci skip]
2018-06-10 14:24:02 +11:00
Celtic Minstrel
93d4a12375
Remove duplicate changelog entries 2018-06-09 22:32:57 -04:00
Charles Dang
b27d1c21f5 Changelog: moved an entry, fixed a typo
[ci skip]
2018-06-10 13:28:34 +11:00
Charles Dang
92c67f5244 Removed a duplicate changelog entry I missed
[ci skip]
2018-06-10 13:25:29 +11:00
Charles Dang
70a1cdd3e6 Removed duplicate changelog entries under the 1.15.0-dev header
[ci skip]

These were all mentioned between 1.13.13 and 1.14.3, meaning the remaining changes
are everything new in 1.15.0-dev so far. Also removed one entry that was mentioned
twice in the WML Engine section.
2018-06-10 13:21:44 +11:00
Charles Dang
142a2f20ca Statistics Dialog: merge unit name and count labels
Makes it easier for translators to do something specific with this label if needs
be. I remember the reason the count (NUMx) label was moved prior to the name had
to do with language conventions too, so this should alleviate any other such issues.

Also made the name label default size instead of small.
2018-06-10 12:57:37 +11:00
Charles Dang
b5f1e1a48a Statistics Dialog: remove mode toggle in favor of an All Scenarios menu entry
Closes #2886.
2018-06-10 12:57:35 +11:00
Charles Dang
556d088e57 Added 1.13.13 - 1.14.3 changelog sections
[ci skip]

Duplicate entry cleanup for the 1.15.0-dev section to come
2018-06-10 11:15:25 +11:00
Charles Dang
500259a7c2 DiD S6: shift the escape location slightly to account for the map redraw
[ci skip]
2018-06-10 10:57:36 +11:00
Charles Dang
b6416b8329 DiD S1/S6: new Parthyn maps
[ci skip]
2018-06-10 10:45:29 +11:00
Iris Morelle
ce8bf3cfc3 Move changelog entry around
[ci skip]
2018-06-09 19:43:45 -04:00
Charles Dang
42349651cb Fixed [scenario] map_file basically being unusable
Automatically checking the path relative to a maps/ directory without binary
path support results in an invalid path almost every single time. If I remember
correctly from my testing, the only time that worked was if I added a data/maps
folder.
2018-06-10 10:32:39 +11:00
Iris Morelle
5871557dbf Fix Lua errors when failing to set a music track on an empty playlist
Closes #3194.
2018-06-09 18:55:03 -04:00
Charles Dang
c8fc88454b Shuffled a few credits entries around
[ci skip]
2018-06-10 08:35:26 +11:00
gfgtdf
25840c8a4b fix teamchat not marked #3119 2018-06-10 07:17:43 +11:00
gfgtdf
c79e1645c8 fix issues caused by empty save id
ee50171d13 broke some codes that relied on
unique save ids, that is in particular the statistic code and
scoped_recall_unit, so now these codes fallback to the side number if
the save id is empty.
2018-06-10 07:17:42 +11:00
Charles Dang
8fea48ab85 Preferences Dialog: cleaned up advanced prefs widget setup 2018-06-10 07:14:02 +11:00
Jyrki Vesterinen
f0896bdf8c Remove game_events::wml_event_pump::wml_tracking()
The variable **always** changed when event handlers were run, and thus the
optimizations to avoid updating some status after WML/Lua has run weren't
doing anything. In addition, commit 62ec3b3951 removed the most
important optimization that relied on wml_tracking().

Resolves #2578.
2018-06-09 19:35:01 +03:00
Nils Kneuper
92816d42d5 updated Japanese translation 2018-06-09 12:58:42 +02:00
Nils Kneuper
725f6eba04 updated Czech translation 2018-06-09 12:57:18 +02:00
Iris Morelle
45ab8e5b62 Make Credits page on wiki.w.o use the new TOC markup for mobile support
[ci skip]
2018-06-09 03:07:23 -04:00
stevecotton
8d055bf038 DiD S2: When ambushed by goblins, cancel any pending attack (#3227)
This happens in a village-capture event, so the unit has finished
moving for this turn in any case.
2018-06-09 01:09:53 +03:00
Nils Kneuper
f8742ccce4 updated Scottish Gaelic translation 2018-06-08 20:29:50 +02:00
Nils Kneuper
e464082e06 updated French translation 2018-06-08 20:27:44 +02:00
Nils Kneuper
ca25c0dc5c updated Spanish translation 2018-06-08 20:26:31 +02:00
Charles Dang
00e58f12f9 Unit Attack: fixed issues arising from displayed items potentially not equally available items
Since there were weapons included that weren't shown, it was possible for the best
weapon selection to be a hidden one (in which case, the initial selection would be
wrong, and it was possible for the returned index to point to a hidden, disabled
weapon.

This resolves both issues by excluding these disabled attacks from the weapon choices
list altogether. They aren't considered when calculating the best attack either.

mouse_handler::fill_weapon_choices is also used in mouse_handler::attack_enemy_, but
I don't foresee this change should cause any issues there, since you aren't supposed
to be able to actually attack with disabled weapons anyway.
2018-06-09 03:34:22 +11:00
Severin Glöckner
18a101be66 Tutorial: show the female fighteress in the help (if she is chosen)
Uses the workaround mentioned in #3012

[ci skip]
2018-06-08 18:01:23 +02:00
Thom Diment
7feb9aee11 UtBS 5: changes to scenario locations (#3104)
* UtBS 5: changes to scenario locations

Fixes #3077:
* Moved AI leader spawns to keeps
* Changed spawn of trolls that were spawning in walls
* Sanity-checked village ownership in cavern

Fixes #3078:
* Changed spawn of Eastern Troll Flamecaster
* Fixed entry routes of Troll Flamecasters

From author notes:
* Made 'Wounded Dwarf' a wounded unit
2018-06-08 16:40:22 +02:00
Charles Dang
eade3dd494 Fixup ea5945b (fixes #3221) 2018-06-08 22:36:44 +11:00
Charles Dang
ea5945b357 Fixup 79adc68 2018-06-08 20:05:51 +11:00
Charles Dang
424e0e0ab4 Fixup this atomic_bool again
Apparently atomic types aren't copy-assignable.
2018-06-08 19:45:52 +11:00
Charles Dang
79adc68ef6 Attempt to update tests for 3d894fa 2018-06-08 19:43:07 +11:00
Charles Dang
bc0ad54ab0 Added missing <atomic> include 2018-06-08 19:28:15 +11:00
Charles Dang
58d3cad315 Merge branch 'gui2_widget_ptr_init_refactor' 2018-06-08 19:17:48 +11:00
Charles Dang
34195ae654 GUI2: removed now-redundant type parameter from build_single_widget_and_cast_to 2018-06-08 19:16:52 +11:00
Charles Dang
52f7fcf5cc GUI2: added a public static type getter to all widgets implementing get_control_type
Fixes #2400. See comment in styled_widget.hpp for details.
2018-06-08 19:16:19 +11:00
Charles Dang
3d894faf11 GUI2: made widget initialization process more secure against memory leaks
This commit is the followup to a similar one I did regarding window initialization. Instead
of widgets being created on the heap and not being managed by a smart pointer until they're
added to a grid, they are now always managed by a shared_ptr. To that end, this commit covers
bunch of things:

* builder_widget::build (both overloads) and all its overrides (which have now been marked
  as such) now return shared_ptr<widget>.
* The builder_grid::build() override now returns the same instead of grid* since you can't
  use covariant return types with smart pointers.
* The two implementation build helpers in builder_grid have been combined with an optional
  replacement map as the second parameter. Uses of the version that took a grid pointer could
  be easily converted to pass a reference instead.
* The pane, matrix, and viewport build() functions were removed in favor of making the ctor
  public. In case there was a deprecated ctor, that was removed.
* The viewport now keeps a widget shared_ptr instead of a reference that was then deleted
  by address-of. This was both better design and necessary to fix a crash.
* build_single_widget_instance_helper and build_single_widget_instance were renamed to
  build_single_widget and build_single_widget_and_cast_to to better represent their roles
  and to indicate the latter was more a convenience extension for the latter than the other
  way around.
2018-06-08 18:27:35 +11:00
ln-zookeeper
131868581d Restructured WC/Soulless bat variation defense animation (fixes #3215)
There were two overlapping problems: 1) the branching was written incorrectly (due to combining top-level and [if] filters) and 2) the first [defend] tag getting merged with the base WC/Soulless defense animation.
2018-06-08 00:38:34 +03:00
Charles Dang
b70463b6ad Ensure events::call_in_main_thread is thread-safe 2018-06-08 07:33:42 +11:00
mattsc
7afe6adbee Update changelog with Lua AI efficiency improvements 2018-06-07 06:55:10 -07:00
mattsc
7ed5b210b5 Changelog: collect AI entries in 'AI' section 2018-06-07 06:52:27 -07:00
mattsc
6c38b8ce93 Goto Micro AI: add [and] to a filter
Another efficiency improvement.  This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
2018-06-07 06:45:30 -07:00
mattsc
0dcbe1d0d0 Goto Micro AI: change order of SLF and SUF evaluation
This is for efficiency reasons, as location filters do not necessarily
change throughout a side’s turn, while fewer and fewer units have moves
left.
2018-06-07 06:45:14 -07:00
mattsc
972ecc2f56 AI helper: improve efficiency of get_unit functions
The old method is very slightly faster in some circumstances (e.g. for
simple filters and when all units have moves/attacks/etc. left), but we
are talking fractions of micro seconds. By contrast, depending on the
filter used, the new method can save large amounts of evaluation time
once some units have move or attacked.
2018-06-07 06:44:55 -07:00
doofus-01
9bb6cbb82c UtBS: Graphics update for Giant Ant (#3190)
* graphics update for giant ant unit

* slight revision to ant base sprite
2018-06-07 11:48:40 +03:00
Nils Kneuper
c9b7d5b22f updated Italian translation 2018-06-06 22:08:15 +02:00
Nils Kneuper
5e35e4e8f3 updated British English translation 2018-06-06 22:07:12 +02:00
loonycyborg
787a1a0dae wesnothd: fix prematurely adding new players to games_and_users_list_
If dc happens during asio read that would call server::add_player
then a "ghost" player will appear in games_and_users_list_. Fix works by
moving the list update into the handler, it will be called only if read is
successful.

This should prevent issue #2989 unless it has some other mechanism
2018-06-06 19:47:20 +03:00
Iris Morelle
94a85e0185 Changelog entry for the fix for issue #3206
[ci skip]
2018-06-06 04:22:08 -04:00
Iris Morelle
085236f556 gui2/unit_create: Do not exclude do_not_list units
This is a debug mode-only dialog. If I want to spawn a unit, the game
had better allow me to spawn any unit I want. do_not_list was created
for use by wmlunits anyway.
2018-06-06 03:14:07 -04:00
Jyrki Vesterinen
91afbfd586 Fix #2602: music doesn't change immediately on loading a save
This time I added an option to disable the feature to allow the currently
playing track to finish when changing the playlist. This allows more
fine-grained control of distinct use cases.

In wesnoth.cpp:do_gameloop(), I reversed the order of the title screen
music and default music because otherwise adding the default music would
enable play_once for the title screen music and prevent instant music
change when the player loads a save. I play title screen music with
immediate=yes, so it's still played first.
2018-06-05 20:45:04 +03:00
Jyrki Vesterinen
cafede479c Revert "Fix #2602: music doesn't change immediately on loading a save"
This reverts commit 94b69e0281.
2018-06-05 20:44:31 +03:00
loonycyborg
0c0bf7f91d wesnothd: fix server terminating in response to unregistered login
if unregistered logins are allowed
2018-06-05 14:27:45 +03:00
loonycyborg
a251808933 wesnothd: avoid needlessly casting pointer to long int 2018-06-05 14:27:45 +03:00
Iris Morelle
051182fa1c Fall back to the unit type name for [message] captions for nameless units
Fixes #3211.
2018-06-05 04:44:28 -04:00
Jyrki Vesterinen
b7c1007f34 Changelog entry for commit 94b69e0281 2018-06-05 08:40:06 +03:00
Jyrki Vesterinen
94b69e0281 Fix #2602: music doesn't change immediately on loading a save 2018-06-05 08:38:57 +03:00
sigurdfdragon
c9c689da66 Update changelogs 2018-06-04 23:57:53 -04:00
sigurdfdragon
85ba7797b2 DW: Fix #3207
...by preventing any allied units from moving to the sword.
2018-06-04 23:56:39 -04:00
Iris Morelle
4e37cdc713 Don't allow [kill] animate=yes to scroll to units through fog and shroud
Restores 1.12's behaviour.
2018-06-04 16:15:37 -04:00
Severin Glöckner
fc427ce58c NR S5a: more bugfixes
* now the situation can appear that spiders can attack Malifor,
  this handles it.
* add *^Xo Terrain to the filter. While there is no bug to fix,
  it looks like it belongs there too.
* work around a tile glitching with an [item] at 22,4
* remove code referring to removed variables

* and run wmlindent

[ci skip]
2018-06-04 19:42:42 +02:00
Thom Diment
913b77d79d NR5_1: Fixes to Malifor attack and secret door events (#3154)
NR S5a: bugfixes

* Fixes #3117 - Malifor damage event now occurs on defence as well on attack

* Fixes #3116: - Doors to the study can now be opened from inside

[ci skip]
2018-06-04 18:52:20 +02:00
loonycyborg
4eea1b5f0d wesnothd: restore lan server auto-shutdown functionality 2018-06-04 16:38:42 +03:00
loonycyborg
0714d488bc wesnothd: restore functionality to log stats every 5 minutes 2018-06-04 14:36:48 +03:00
loonycyborg
57da02a919 Update server to use new way of getting wesnoth version 2018-06-04 13:21:20 +03:00
loonycyborg
aaabbf2687 server: remember client's ip in player_connections_ and use it in remove_player()
this is needed so ip is properly logged even if socket is closed or invalid
2018-06-04 13:16:58 +03:00
Severin Glöckner
4b7a6a98ec remove a duplicated space in a translatable string
...thiugh, in this case it has no effect.

[ci skip]
2018-06-04 02:44:49 +02:00
Charles Dang
c7a06939ab Tutorial S2: made enemy starting gold equal to that of the player
[ci skip]
2018-06-04 06:42:32 +11:00
Gunter Labes
0362e36305 check for empty parameters before looping over all players 2018-06-04 06:08:01 +11:00
gfgtdf
0853b2718d rename mp command player_version to version 2018-06-04 06:08:00 +11:00
gfgtdf
ba6afa4d17 add player_version mp command
to tell you what wesnoth version another player is using.
2018-06-04 06:07:59 +11:00
Nils Kneuper
ad0b8bce8c updated French translation 2018-06-03 12:09:48 +02:00
Nils Kneuper
87552f083b updated Italian translation 2018-06-03 12:09:03 +02:00
Nils Kneuper
3a8343b4dd updated Chinese (Traditional) translation 2018-06-03 12:08:00 +02:00
Charles Dang
011cbfe3b8 Game Config Manager: handle clearing image cache in main thread
See comment for explanation. This was a better solution that adding mutexes to
the cache accessors; that had performance downsides.
2018-06-03 05:21:02 +11:00
Charles Dang
b8ad791a1d Revert "Fixed an occasional crash resulting from multi-thread access of the image cache"
This reverts commit 6d0b7c8424. Turns out there's
a better way to fix this problem without using mutexes, which have a noticeable
performance hit (5.2% of the execution time of game_display::draw_invalidated()
according to @jyrkive).
2018-06-03 05:20:43 +11:00
Charles Dang
bf92dbbfd2 Campaign Dialog: renamed Deterministic Mode label to "Save random seed"
[ci skip]

This better conveys its behavior, especially with the introduction of the hidden PRNG
preference.
2018-06-03 05:18:42 +11:00
Charles Dang
20af37d527 NR S10 - 14: minor cosmetic map tweaks
[ci skip]
2018-06-03 05:18:41 +11:00
Charles Dang
a46eaa2874 NR S13: further reduce enemy gold
[ci skip]

Also fixed an error in my last commit that gave your ally Dwarvish side *more*
gold on higher difficulties.
2018-06-03 00:57:35 +11:00
loonycyborg
d96d5c506c scons: add missing winapi lib dependencies to mingw build 2018-06-02 11:53:35 +03:00
loonycyborg
b347bc70b1 scons: don't let pkg-config to add prefix on msys2
This is workaround for windows style path confusing scons if they appear
in CPPATH etc. Paths without prefix still happen to be valid and they
start with "/", not "c:".
2018-06-02 11:53:35 +03:00
loonycyborg
aa925e1fc6 scons: use pkg-config on msys platform for sdl 2018-06-02 11:53:35 +03:00
loonycyborg
d8743f8e6e scons: set env["PLATFORM"] to "win32" on msys 2018-06-02 11:53:35 +03:00
loonycyborg
2bc7cc3e61 scons: workaround for msys2's build's of sdl "#define main" breaking non-sdl checks 2018-06-02 11:53:35 +03:00
Charles Dang
5adb931b2a NR S11 - 13: reduced enemy starting gold and income (resolves #3198)
[ci skip]

Also similarly reduced one of your ally's starting gold in S13.
2018-06-02 09:23:44 +11:00
loonycyborg
f53237b20f Change GL include in scons check so it actually works under mingw 2018-06-01 14:36:37 +03:00
gfgtdf
575e104ca5 fix possible 'manditory child missing' when loading mp campaign games
the error could happen a soon as you advance to the next scenario if you reload a campaign save from another player.
2018-06-01 12:54:03 +11:00
sigurdfdragon
03d0e5deee Update changelogs 2018-05-31 19:41:22 -04:00
sigurdfdragon
047ededd9e SotA S09: Fix #3192
...by making the filter more exact.
2018-05-31 19:38:23 -04:00
loonycyborg
d35f22e077 scons: fix issue #3132 2018-05-31 19:50:08 +03:00
Charles Dang
2503ac8897 MP Lobby: added translation hints for C/S markers 2018-06-01 02:00:22 +11:00
gfgtdf
9cc32ebc46 wb: fixup "fix incorrect handling of skirmisher." 2018-06-01 01:58:27 +11:00
loonycyborg
8b1a5c0dde Enable ASLR and NX bit security features for mingw builds 2018-05-31 12:07:27 +03:00
Charles Dang
3d8d38983d MP Staging: removed gender tooltip (resolves #2998)
I had only added it originally in case someone didn't know the symbols offhand,
but sevu is right that they can get a bit annoying.
2018-05-31 19:41:28 +11:00
Charles Dang
6cc91794f5 MP Lobby: display self before friends in player list (fixes #3185) 2018-05-31 19:41:27 +11:00
gfgtdf
0dd382eab3 fix seed not resetting in lua mapgen. 2018-05-31 19:21:57 +11:00
gfgtdf
84d94ca305 add mapgen debug info. 2018-05-31 19:21:56 +11:00
gfgtdf
8e3ee5c597 add mapgen debug info. 2018-05-31 19:21:24 +11:00
gfgtdf
f69af8533a add mapgen debug info. 2018-05-31 19:21:23 +11:00
gfgtdf
af6559af75 fix unit filter always evaluating [and] even if it is not needed. 2018-05-31 19:21:23 +11:00
Charles Dang
8c3673dfa0 GUI2/Chatbox: removed spurious newline from initial PM notice 2018-05-31 19:20:31 +11:00
Pentarctagon
9242a5ffd0 Fixup goblin description.
Somehow missed removing the part about the failing bloodline.
2018-05-31 03:04:39 -05:00
Pentarctagon
0b7ca63a86 Updated goblin spearman description.
See: https://forums.wesnoth.org/viewtopic.php?f=32&t=48137&start=60#p628424 and related posts.
2018-05-31 01:49:58 -05:00
Pentarctagon
d913aafc53 Add a couple missing things from the PR that added the units.
Added the elemental trait to the Jinn. Added the undead_variation key to the Jinn, Wyvern Rider, and Wild Wyvern.
2018-05-31 01:22:13 -05:00
Byteron
7f2a8f7c19 TSG: Deoran can't recruit Peasants anymore
for the whole campaign, only in the first two scenarios

closes #3051 [ci skip]
2018-05-30 21:47:42 +02:00
Charles Dang
aad64d72cf Made vgettext/vngetext internals harder to use accidentally (resolves #2716)
Also removed the two implementation function overloads that did not take a textdomain.
2018-05-30 15:15:34 +11:00
Charles Dang
a08af0c1da Fixup cc2cc29 2018-05-30 13:57:37 +11:00
Charles Dang
569d86277a GUI2/Dispatcher: added a connect_signal convenience wrapper for draw callbacks
Didn't use this in the window widget since that doesn't specify front_child as
the queue position. I need to evaluate whether draw callbacks need to be in that
position anyway. AFAIR I only started adding them there since I noticed the one
in the debug clock dialog used that.
2018-05-30 12:15:57 +11:00
Charles Dang
31c4d09528 GUI2: praise auto 2018-05-30 12:15:57 +11:00
Charles Dang
cc2cc29376 Deployed std::make_unique and std::make_shared in more places 2018-05-30 12:15:56 +11:00
Nils Kneuper
29c9f1d298 updated French translation 2018-05-29 23:41:26 +02:00
Charles Dang
4b03168fec Fixup f72f89f 2018-05-29 21:11:57 +11:00
Charles Dang
eddbaa2159 Events: minor cleanup 2018-05-29 21:01:17 +11:00
Charles Dang
f72f89f4d5 Campaign Difficulty: consolidated both lines into a single label 2018-05-29 21:00:34 +11:00
Charles Dang
61694688a8 Updated changelog
[ci skip]
2018-05-29 20:56:14 +11:00
Charles Dang
6d0b7c8424 Fixed an occasional crash resulting from multi-thread access of the image cache
This was a problem as of 52db950e94 since the loading
screen could access the image cache while the worker thread cleared it.
2018-05-29 14:00:47 +11:00
Jyrki Vesterinen
ae8baa6356 Changelog entries 2018-05-28 22:15:06 +03:00
Jyrki Vesterinen
472b0cbbfb Fix #3042: attack prediction gives wrong results for HP <= 0 units
One_strike_fight() assumed that if HP distribution hadn't been calculated,
the unit is alive. It would normally be a valid assumption, but the Wesnoth
engine allows units with negative HP (although things aren't guaranteed to
work correctly in the presence of such units).

The assumption, together with a completely wrong calculation for the
probability that the opponent will counterattack, resulted in badly
incorrect results. That, in turn, caused the calculated probability that
the opponent to kill us to become negative (I observed -75 % when
debugging), making the calculated probability to be poisoned/slowed to
exceed 100 %, and that finally caused an assert if the AI simulated another
fight for the same unit.

I have now fixed those issues. I also noticed that rounding error allowed
the probability to be killed to still become slightly negative, and thus
changed std::min() to utils::clamp() to limit the value to the allowed
range.
2018-05-28 22:13:37 +03:00
Jyrki Vesterinen
0200487aad Revert "Disallow units with negative HP"
This reverts commit ef60deaa2b.

@ln-zookeeper pointed out that units with negative HP are documented in
the wiki, and thus disallowing them is an API
change.
2018-05-28 22:12:33 +03:00
Jyrki Vesterinen
050bb3fa2c Revert "Allow modifying dead units in last_breath and die event handlers"
This reverts commit 15446acb2a.
2018-05-28 22:12:22 +03:00
Jyrki Vesterinen
58dca3a884 Revert "Throw a Lua exception when creating a negative-HP unit in a Lua context"
This reverts commit 258a0e4689.
2018-05-28 22:12:08 +03:00
Jyrki Vesterinen
70be1d2932 Revert "Allow modifying dead units in more event handlers"
This reverts commit 9110e49760.
2018-05-28 22:11:55 +03:00
Charles Dang
019848a28f Events: removed unused sdl_handler virtual functions
volatile draw had to do with drawing map labels pre-accelerated rendering. They're unused
now and I don't foresee using them again since they don't offer anything the regular draw
functions don't and they aren't needed for the map labels anymore.

Tooltips are handled by handled by GUI2. There are no more help strings since the related
interface in CVideo got removed.
2018-05-28 17:40:37 +11:00
Charles Dang
3c4da4035f Fixup 40d9b99 again (more unused variables) 2018-05-28 16:44:37 +11:00
Charles Dang
3cc8544488 Fixup 40d9b99 (unused variables) 2018-05-28 16:12:00 +11:00
Charles Dang
40d9b9953b Cleaned up some unused stuff from the display class
Namely complete_redraw_event(), recalculate_minimap(), and redraw_minimap(). I had
been keeping the last around for reference (see f5ec886cb5) but I
figure it's not really worth it since this isn't the drawing method we'll want to
be using in the end anyway.
2018-05-28 15:14:39 +11:00
Charles Dang
ed8a8a48f7 Used std::string::front() and back() in more places 2018-05-28 15:14:37 +11:00
Charles Dang
c5ba6f01a8 Cleaned up utils::apply_modifier a bit 2018-05-28 15:14:36 +11:00
Iris Morelle
0ca8227959 pofix: Update with 1.14.1 -> 1.14.2 rules for the website
[ci skip]
2018-05-27 23:02:00 -04:00
Celtic Minstrel
d03829dfd0
Fixup previous commit
Accidentally removed the third parameter for `increase_movement` instead of `increase_accuracy`. Whoops!
2018-05-27 11:27:58 -04:00
Celtic Minstrel
1413dfd4f3
Fix effects being unable to decrease weapon parry/accuracy
fixes #3181
2018-05-27 10:33:44 -04:00
Charles Dang
8ecbed0205 Fixed CVIdeo::quit being swallowed in invoked_function_data::call 2018-05-27 22:22:42 +11:00
Charles Dang
5588588b55 Fixup 86792656ae (re-add ctor) 2018-05-27 22:02:57 +11:00
Charles Dang
86792656ae Handle exceptions thrown by call_in_main_thread in the caller thread
Also removes an unnecessary ctor and adds docs.
2018-05-27 17:36:29 +11:00
Nils Kneuper
183bc272ea updated Italian translation 2018-05-26 21:41:08 +02:00
Charles Dang
99c2ed8f65 MP Staging: simplify a call 2018-05-27 03:04:09 +11:00
Charles Dang
050430460a Moved faction sorting from the FLG manager to the connect engine
This list in the connect engine was passed to each of its side engine's flg managers,
where it was then sorted by update_choosable_factions(). Basically, a whole bunch of
unnecessary sorting. This makes it so the list is already sorted when it's passed to
each side engine.

None of the post-processing of the faction list (in populating available_leaders_)
should mess with the order, as far as I can tell.
2018-05-27 03:04:08 +11:00
gfgtdf
0c3ca19e9d remove useless code in unit::advance_to
the line above does exactly the same as the line inside that if(){..} so it has no effect.

Also, what the comment says is wrong. We do not want to keep the old recall cost if it is different from the original recall cost because  doing that would break removing objects that change recall cost.
2018-05-26 23:58:11 +11:00
gfgtdf
f093341bb4 automaticially end replaymode at the end of a mp turn replay.
previously it did happen that users did not know how to 'escape'
from the replay mode in that case.
2018-05-26 14:09:54 +02:00
gfgtdf
beeb5b43e2 fix [animate_unit] freezing the game
#2970
#3084
2018-05-26 14:09:41 +02:00
Charles Dang
dab7022552 GUI2/Addon List: don't hardcode green text color for publishable addons 2018-05-26 19:04:10 +11:00
Charles Dang
107ef77e45 Used RAL 6038 (#00b51a) for font::GOOD_COLOR
This is apparently the closest RAL color to RGB 0,255,0 and it happens to look good.
2018-05-26 19:04:09 +11:00
Charles Dang
0f1029a933 Surface: restrict a workaround to SDL 2.0.6 only
It was fixed in 2.0.7.
2018-05-26 18:10:06 +11:00
Charles Dang
ff2c729991 Updated changelog
[ci skip]
2018-05-26 17:02:53 +11:00
Jyrki Vesterinen
cf2b1ed873 Changelog entry for pull request #3169 2018-05-26 09:01:30 +03:00
newfrenchy83
5386841088 Update advancement.cpp 2018-05-26 08:55:11 +03:00
Severin Glöckner
307d1d1d44 SotA: transform units in S5 instead of S18
this commit differs from the 1.14 one

[ci skip]
2018-05-26 03:52:09 +02:00
Severin Glöckner
3a103e6bbf SotA & UtBS: replace deprecated code
[ci skip]
2018-05-26 03:36:44 +02:00
Severin Glöckner
fec49a53a6 SotA S21: fix terrain filter
The map has been adjusted before, but not the filter

[ci skip]
2018-05-26 03:36:31 +02:00
Severin Glöckner
4db9f17e09 SotA: fix S20, was broken with the removal of the old gates
[ci skip]
2018-05-26 03:36:31 +02:00
Severin Glöckner
627c39a3a8 SotA S18: move DA transformation to lua
[ci skip]
2018-05-26 03:36:31 +02:00
gfgtdf
acf9a9874c
fix untranslatable string. 2018-05-26 03:16:43 +02:00
Severin Glöckner
9f37896f32 DiD S7: compensate -1 income with +1 support
[ci skip]
2018-05-25 20:51:29 +02:00
Severin Glöckner
c0d6d4ed94 DiD S7: make villages unattractive
they give no income anymore, but still support

closes #3162

[ci skip]
2018-05-25 20:34:40 +02:00
Severin Glöckner
cca5b6f776 NR Path B:
* to enable playing the path in debug mode
  * set the betrayed friend variable in S5
  * overwrite redruits and gold
* use lua for unit transformations
* clean up code in S5
* fix ellipse change having no effect (probably since 1.12)
  * work around bug 3172

[ci skip]
2018-05-25 19:50:39 +02:00
ln-zookeeper
8b467104bf NR: Gave the Rod of Justice the magical special and improved animation
The animation now uses all three bolt animations (instead of just one), and has a somewhat different color.
2018-05-25 15:33:29 +03:00
Charles Dang
47bef433a9 Campaign Difficulty: restore the description parentheses on request 2018-05-25 12:00:13 +11:00
Charles Dang
47d766d374 Bump font::GRAY_COLOR from #777 to #888
Bit brighter, looks a bit better.
2018-05-25 11:59:41 +11:00
Charles Dang
67530c4375 Campaign Difficulty: rearranged entry layout 2018-05-25 11:46:58 +11:00
Charles Dang
b24de54fb9 Removed now-unused preference getters/setters 2018-05-25 11:26:02 +11:00
Charles Dang
4300cb8263 Updated changelog
[ci skip]
2018-05-25 11:17:56 +11:00
Charles Dang
e754e64987 MP Lobby: removed manual player list sorting
It didn't make much sense to have these since there's really no situation you'd want
the "default" sorting order, which is however the server decided to send the list.
2018-05-25 11:16:40 +11:00
Charles Dang
e6183aa0d4 Campaign Difficulty: colored description column gray 2018-05-25 09:32:52 +11:00
Severin Glöckner
51db9d01bf DiD S11, Sota S18: move unit type transformation to lua
[ci_skip]
2018-05-24 23:59:57 +02:00
Severin Glöckner
a24068ad02 DiD S11 & S12: transform all Mages instead of changing their advancements
This has the advantage that they use the same help page as newwly
recruited ons, and their advancement options are correctly shown there.

The transformation code is taken from SotA S18

[ci_skip]
2018-05-24 23:17:20 +02:00
Severin Glöckner
0f511e8e55 EI S11: use same approach as in 1e58164
to simplify scenario

[ci_skip]
2018-05-24 23:17:20 +02:00
Severin Glöckner
1e58164961 DiD: fix bug for units not being loyal anymore after leveling up
fixes #3163

[ci_skip]
2018-05-24 23:16:39 +02:00
Severin Glöckner
1315c660e7 Did S5: make campaign easier to debug
by moving an important change into it's own victory event

[ci skip]
2018-05-24 23:10:16 +02:00
Nils Kneuper
cb43b894ee updated Chinese (Simplified) translation 2018-05-24 21:33:53 +02:00
Nils Kneuper
1122ea7264 updated Spanish translation 2018-05-24 21:31:24 +02:00
Jyrki Vesterinen
f5609d6911 Changelog entry for commit f861883683 2018-05-24 20:36:22 +03:00
Jyrki Vesterinen
bd5be036b7 terrain_filter::match_internal(): use std::make_shared() 2018-05-24 20:33:44 +03:00
Jyrki Vesterinen
f861883683 Fix memory leak in terrain filter matching 2018-05-24 20:33:30 +03:00
Charles Dang
27d0a6f6fe Fixed animation-wide text_color and blend_color keys being overwritten
Regression from a0199c73f9. This should fix
an issue where levein/levelout fading was sometimes black instead of white.
2018-05-24 13:36:56 +11:00
Charles Dang
c48a8e7edd Fixup 9bf7a4c (WFL comment syntax)
[ci skip]
2018-05-24 11:16:34 +11:00
Iris Morelle
f30634842e gui2/preferences: Add margin around the version info button
[ci skip]
2018-05-23 19:50:32 -04:00
Iris Morelle
2bc7be607e Add a couple of entries to players_changelog
[ci skip]
2018-05-23 19:47:40 -04:00
Iris Morelle
e8c803d426 gui2/preferences: Add version info button
Also simplifies the layout of the bottom-most row of the dialog a bit.
2018-05-23 19:39:55 -04:00
Charles Dang
9bf7a4c8fb GUI2/Message: tweaked Magic Numbers to fix layout failure with large portraits
[ci skip]

Fixes #2912
2018-05-24 10:26:31 +11:00
gfgtdf
fef4254c84 fix different carryover when loading startofscenario-save
this removes a hack in connect_engine.cpp that set save_id to a value to make sure that other connect_engine.cpp code does not chnge it later to the plyers id, (it did so at some point iirc).

Instead we update carryover.cpp to make sure that a side with no save_id  (or id since save_id defaults to id) is not carried over to the next scenario,

fixes #3152
2018-05-24 10:25:52 +11:00
gfgtdf
fb54b0376d don't autosave after using 'back to turn' in mp 2018-05-23 22:02:04 +11:00
gfgtdf
31d4579500 fix oos when using 'back to turn' in mp 2018-05-23 22:02:03 +11:00
Charles Dang
a1de152ded Game Events/Manager: formatting cleanup 2018-05-23 12:49:24 +11:00
Charles Dang
b011faa244 GUI2/Canvas: merge draw() and render() and remove commented-out blur code 2018-05-22 22:40:10 +11:00
Charles Dang
6e4327f313 GUI2/Canvas: reset size_changed_ flag after setting formula variables (fixup 02858f2) 2018-05-22 22:20:54 +11:00
Charles Dang
1a9c6a7eca Removed an outdated comment
Outdated as of b2fc0f2.
2018-05-22 22:15:08 +11:00
Charles Dang
2819f549a1 GUI2:Canvas: remove custom drawing function interface
This was only needed for the minimap since each canvas had its own texture, and the
minimap widget's canvas texture needed to be passed to image::render_minimap (that
function operated on the current render target, in this case, the canvas texture).
As of 02858f2259 we render directly to the screen instead,
so this isn't needed anymore.
2018-05-22 22:14:34 +11:00
Charles Dang
b2fc0f25e0 GUI2: removed unused offset parameters from drawing functions
These were added in 8f945cf235, but since the "new" listbox
implementation never came to be, these have just been unused clutter. There was one place
they were used as parameters in a manual call to calculate_blitting_rectangle, but that was
refactored out in 3332ae9757.

This also removes an overload of widget::draw_debug_border, since without the offsets, both
functions now did the same thing.

This affects:
* widget::draw_background
* widget::draw_children
* widget::draw_foreground
* widget::impl_draw_background (offset overload removed)
* widget::impl_draw_children
* widget::impl_draw_foreground
* widget::calculate_blitting_rectangle
* widget::calculate_clipping_rectangle
* widget::draw_debug_border
2018-05-22 21:33:21 +11:00
Charles Dang
eecc46f02f GUI2/Canvas: restored handling of immutable shapes (fixup 02858f2) 2018-05-22 20:59:29 +11:00
Charles Dang
02858f2259 GUI2/Canvas: discard individual canvas texture in favor of direct-to-screen rendering
This is a lot more efficient since it allows the GPU to parallelize draws AND it magically
fixes the bad alpha rendering we've been having!

Fixes #1568
Fixes #1744
2018-05-22 19:37:21 +11:00
ln-zookeeper
cdea2e70cf SoF S9: Removed garbage terrain code 2018-05-22 11:23:41 +03:00
ln-zookeeper
59b69288ba Updated changelogs 2018-05-22 15:14:27 +11:00
ln-zookeeper
0de4a4c706 TRoW S15: Increased the amount of lvl2 units enemies recruit
This will make enemies recruit equally many lvl1 and lvl2 units, thus decreasing the amount of units overall and making it less feasible to last indefinitely due to hordes of lvl1 units blocking better damage-dealers from reaching player units.
2018-05-22 15:12:52 +11:00
ln-zookeeper
bd23bb3253 HttT S08: Increased Li'sar's income slightly 2018-05-22 15:12:51 +11:00
ln-zookeeper
856b8ce78b TSG S03: Made the scenario very subtly harder
Increased the number of bats/undead the enemy can recruit, and made the terrain east of the enemy camp more easily passable.
2018-05-22 15:12:50 +11:00
ln-zookeeper
c0583a1842 SoF S9: Fixed some issues with the volcano eruption (fixes #3099)
This merely patches the worst problems (multiple successive [endlevel] calls, inconsistent [endlevel] contents, recursive elf die event, lava fills visually broken); ideally the whole scenario should be rewritten and redesigned.

The mask changes only consist of re-sizing them to match the map size.
2018-05-22 15:12:49 +11:00
gfgtdf
7eec132d76 don't generate a savegame snapshot unless needed
fixes #3150
2018-05-22 15:11:21 +11:00
Charles Dang
8d3f54ce7c [remove_sound_source] now accepts a comma-separated ID list
[ci skip]

Lack of this pointed out by @shikadiqueen.
This change will also throw an error if id= is missing. Not sure if it did so before.
2018-05-22 14:55:34 +11:00
Iris Morelle
8ae38ac19f Do not allow [message] to scroll to units through fog/shroud
This was a regression from 1.12.
2018-05-21 23:23:06 -04:00
Iris Morelle
df782f5401 Fix broken TC in a north-facing standing animation frame for the Revenant
[ci skip]
2018-05-21 21:32:02 -04:00
gfgtdf
29120661f4 remove 'cannot handle require_scenario=' warning
since it triggers on mainline content
2018-05-22 10:39:01 +11:00
Severin Glöckner
f291deb6cf LoW 2 S7 - fix repeated endlevel execution
[ci skip]
2018-05-21 18:31:16 +02:00
Martin Hrubý (hrubymar10)
6f2235088c Xcode Disable -Wsign-conversion and -Wshorten-64-to-32 flags 2018-05-21 18:19:27 +02:00
Charles Dang
998cf67e1a Updated changelog
[ci skip]
2018-05-22 00:52:05 +11:00
Jyrki Vesterinen
1066de1a82 Revert "Preallocate memory for image/file presence caches"
This reverts commit a3ef80853c.

Vector reallocation cost is logarithmic. Assuming that a vector
starts at a size of one and doubles its size in each allocation, the
result is 11 allocations - completely negligible compared with, you
know, loading 20 000 images from disk.
2018-05-21 16:33:50 +03:00
Charles Dang
949266b5aa Preallocate memory for image/file presence caches
Should avoid unnecessary reallocations.
2018-05-22 00:28:26 +11:00
Martin Hrubý (hrubymar10)
dee670d2b5
Switch travis Xcode to DEBUG scheme 2018-05-21 14:26:04 +02:00
Nils Kneuper
6bfc5623e7 updated Japanese translation 2018-05-21 13:07:23 +02:00
Nils Kneuper
a7dbdb4aa2 updated French translation 2018-05-21 13:03:32 +02:00
Nils Kneuper
d942bead18 updated Scottish Gaelic translation 2018-05-21 13:02:38 +02:00
gfgtdf
5dffb16d5e wb: dont resend 'bump_later' commands
these caused 'illegal whiteboard data' messages from the mp server.
2018-05-21 21:34:52 +11:00
Severin Glöckner
36026a5ff7 manpages: clarify deprecation logdomain
[ci skip]
2018-05-21 09:14:07 +02:00
Severin Glöckner
fd8473e3da GUI: add a translation prefix
Depending on the context there are different possible word
to translate 'to' with.

[ci skip]
2018-05-21 08:52:50 +02:00
Severin Glöckner
69f17c775d name generators: update translation hint
[ci skip]
2018-05-21 08:52:05 +02:00
Charles Dang
d9315199ee Remove the CMake/Scons compile-time check for IEEE 754 compliance
Now handled by a static assertion.
2018-05-21 14:38:16 +11:00
Iris Morelle
6eddc6f978 Remove door terrains that were supposed to be removed by 1.14
If someone was using these despite being hidden and everything they were
really asking to get shot in the foot at some point.
2018-05-20 23:08:43 -04:00
Charles Dang
1bfa8e363c Added a static assertion for IEEE 754 floating point compliance 2018-05-21 14:07:03 +11:00
Iris Morelle
ae127ea73a Clamp tod_color values in the [-510, 510] range instead of [-255, 255]
[color_adjust] needs to be able to use absolute values as large as
2*255 in certain edge cases to set the screen a single solid colour when
interacting with time of day colour shifts.

Fixes #3144.
2018-05-20 21:12:34 -04:00
Charles Dang
7f673dcd1f Unit Recall: select the first row after applying sorting
Reported on the forums: https://forums.wesnoth.org/viewtopic.php?f=4&t=48219
2018-05-21 10:36:53 +11:00
mattsc
ee62a75be2 Update changelog 2018-05-20 15:26:52 -07:00
mattsc
a6c0012689 Experimental AI recruiting: use math.huge instead of 9e99 2018-05-20 14:55:17 -07:00
mattsc
f810504306 Experimental AI: clear recruit cache when no recruit action found 2018-05-20 14:55:01 -07:00
mattsc
a65605c547 Fix Experimental AI not working without enemy units
An example are the first two turns of Dark Forecast.
2018-05-20 14:54:45 -07:00
ln-zookeeper
43c5b6fbb2 UtBS: Re-numbered Nym's sword animation frames
Also optimized them.
2018-05-21 00:01:29 +03:00
Pentarctagon
d02e16d712 Fixup: Vyncyn was already listed in the credits. 2018-05-20 09:35:59 -05:00
gfgtdf
0f2b4fae1d wb: fixup fix handling of extra_recruit and [filter_recall]
this was probably lost during rebasing.
2018-05-20 22:44:58 +11:00
Charles Dang
23732cf40f Removed useless Hide Help entry for debug terrain info 2018-05-20 16:02:47 +11:00
doofus-01
c585ac4462 kaleh sword animation 2018-05-20 14:55:00 +11:00
gfgtdf
5785ef7925 wb: fix handling of extra_recruit and [filter_recall]
fixes #3100
2018-05-20 13:55:20 +11:00
Iris Morelle
e82d811ab0 Fix [change_theme] crashing when theme= isn't specified
Leaving theme= unspecified ought to have the same effect as providing it
and setting it to an empty string. Without the check for a nil value,
however, it would result in a crash like this:

  20180519 22:31:54 error scripting/lua: lua/wml-tags.lua:922: bad argument #3 to '__newindex' (string expected, got nil)
  stack traceback:
          [C]: in metamethod '__newindex'
          lua/wml-tags.lua:922: in local 'cmd'
          lua/wml-utils.lua:145: in field 'handle_event_commands'
          lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
2018-05-19 22:38:06 -04:00
gfgtdf
7ef9f9a18f fix require_resource in [resource]
previously 918cdfcb36/src/saved_game.cpp (L293) would fail for [resource] because cfg["addon_id"] was empty.
2018-05-20 12:19:04 +11:00
Celtic Minstrel
c9d5832845 Fix preprocessor error with deprecated macros intended to be used as an attribute value 2018-05-19 20:52:08 -04:00
Charles Dang
91150f2504 THoT S2: fixed misspelled event name (fixes #3131)
[ci skip]
2018-05-20 10:25:46 +11:00
gfgtdf
a10287c5c2 fix require_scenario=yes not working with map_generation
this fixes require_scenario=yes for scenarios that use map_generation or
scenario_generation, the problem was that create_engine does not call
saved_game::expand_scenario for random maps, (which is the function that
checks require_scenario=yes)

fixes #3105
2018-05-20 10:09:48 +11:00
Pentarctagon
16bfab0b0a Add new units as discussed on the forums.
See https://forums.wesnoth.org/viewtopic.php?f=32&t=47721&start=450#p625660

All images but the young roc/roc would remain under the GPL, since Kwandulin based them on images by Sleepwalker and I wasn't able to contact him about using the CC BY-SA for them.  The young roc base and attack sprites are under the CC BY-SA, and are by Vyncyn(forum username).
2018-05-19 15:28:42 -05:00
Celtic Minstrel
691435ed4c Documentation for the translation completeness command-line flags 2018-05-19 16:19:13 -04:00
Celtic Minstrel
51f6f52709 Update changelog 2018-05-19 16:07:29 -04:00
Celtic Minstrel
b28c61c6dc Remove now-obsolete compile flag for disabling translation completion filtering 2018-05-19 16:03:49 -04:00
Celtic Minstrel
fc74e782b7 Add a command-line option to show incomplete translations in the language list 2018-05-19 16:02:04 -04:00
Celtic Minstrel
5e28c13b87 Sort command-line options so the comment isn't lying 2018-05-19 15:58:23 -04:00
Martin Hrubý (hrubymar10)
d19a82801f Xcode enable all warnings in DEBUG scheme 2018-05-19 21:36:55 +02:00
Nils Kneuper
132f67395a updated Spanish translation 2018-05-19 20:07:50 +02:00
Nils Kneuper
71a6488419 updated Chinese (Simplified) translation 2018-05-19 20:06:16 +02:00
Jyrki Vesterinen
a388c2d891 Fix build with -Werror=unused-variable 2018-05-19 16:41:15 +03:00
Jyrki Vesterinen
c68a7ba5f6 Changelog entry for commit 3deef64439
[ci skip]
2018-05-19 15:37:26 +03:00
Jyrki Vesterinen
3deef64439 Listbox: don't try to keep the selected item visible (#3016)
@Vultraz stated in Discord that list box should keep the scroll position
instead.

Resolves #3016.
2018-05-19 15:34:03 +03:00
Celtic Minstrel
4a3508f13f
Support [break], [continue], and [return] in [random_placement] 2018-05-19 00:42:23 -04:00
Nils Kneuper
1b7d8b2f60 updated Chinese (Simplified) translation 2018-05-19 01:30:17 +02:00
Nils Kneuper
63bac52b71 updated Italian translation 2018-05-19 01:28:52 +02:00
Nils Kneuper
7877bc3ef4 updated Italian translation 2018-05-17 21:23:28 +02:00
Nils Kneuper
83e1f6ad1c updated Galician translation 2018-05-17 21:22:28 +02:00
Nils Kneuper
20f92c3838 updated French translation 2018-05-17 21:21:00 +02:00
Nils Kneuper
2efd2c1d30 updated British English translation 2018-05-17 21:18:51 +02:00
Nils Kneuper
20532e3382 updated Czech translation 2018-05-17 21:17:41 +02:00
doofus-01
29f97cd2fe Nym sword attack animation 2018-05-17 16:41:34 +11:00
Severin Glöckner
3730ff9738 NR S2: let Hammel not take part in combat
All this trouble is about keeping him alive after all.
And fix a spelling mistake resuling in always false.

[ci skip]
2018-05-17 03:04:30 +02:00
Charles Dang
80e0463131 Begone, MENU_IMG_TXT!
[ci skip]

This utilized the deprecated DescriptionWML syntax.
2018-05-17 11:28:50 +11:00
Charles Dang
505d6264ac Removed deprecated objective text macros
[ci skip]

These are incorporated into the objectives dialog automatically. They lack a deprecation
notice, but they should be given level 3 status on the 1.14 branch.
2018-05-17 11:09:18 +11:00
Charles Dang
fc6825fcd5 Removed deprecated put_unit arg orders
x, y, unit and plain unit
2018-05-17 11:08:01 +11:00
Wedge009
e161d59536 Revert "Revert "'moreso' isn't a word in any dialect of English.""
This reverts commit 4d5a3de4e6.

Restoring correction at @Vultraz's request.

[ci skip]
2018-05-16 15:39:18 +10:00
Jyrki Vesterinen
9110e49760 Allow modifying dead units in more event handlers
Namely attacker_hits, attacker_misses, defender_hits and defender_misses.
2018-05-16 05:13:40 +03:00
Charles Dang
e0beff6615 Rename gettext_boost.cpp to gettext.cpp
Since there isn't another version anymore.
2018-05-16 12:06:48 +11:00
Aaron Winter
77fd148f06 SotBE: Changed a few dates to fit the tweaked timeline from the forums
Discussed in detail in https://forums.wesnoth.org/viewtopic.php?f=12&t=46460
2018-05-16 01:30:22 +03:00
Pentarctagon
fd34fe8497 Don't require SDL2 or OGL for building the servers.
Requiring SDL2 was masking needing to add -lpthread explicitly.
2018-05-15 16:16:09 -05:00
Charles Dang
ba6fa1e46b Convert a few remaining cases of boost::uint32_t to uint32_t 2018-05-16 07:38:47 +11:00
Charles Dang
1097bad28c Revert "Save custom options data in a more concise way"
This reverts commit e3db7cc225. Turns out the
id = value syntax did not work for options in an array since '.' is not a
valid config key name.
2018-05-16 07:21:19 +11:00
Nils Kneuper
2d9e02cffa updated Spanish translation 2018-05-15 22:20:23 +02:00
Jyrki Vesterinen
258a0e4689 Throw a Lua exception when creating a negative-HP unit in a Lua context
Instead of throwing a WML error. This allows the UMC author to get a stack
trace if the unit creation was triggered from Lua.

Requested by @gfgtdf in a comment of #3042.
2018-05-15 20:23:14 +03:00
Severin Glöckner
ddaf9f5a87 NR S2: fix filters for Micro AIs
and allow L2 recruits if the dwarves are under attack in late game.

[ci skip]
2018-05-15 16:44:15 +02:00
Charles Dang
2d600d10dc Wesnothd: minor code cleanup 2018-05-15 21:49:48 +11:00
Charles Dang
9a2d09f97e Wesnothd: formatting cleanup 2018-05-15 21:49:48 +11:00
Charles Dang
b623e7a647 Wesnothd: dropped a giant block of commented-out code
This is a relic from the old pro-Boost ASIO implementation.
2018-05-15 21:49:48 +11:00
Charles Dang
946e9c31b4 Fixup 2a585118d8 (forgot to bump defines on all configurations)
[ci skip]
2018-05-15 19:08:18 +11:00
Charles Dang
10e43a6642 GUI2/Canvas: simplify clear_shapes logic 2018-05-15 19:03:56 +11:00
Charles Dang
3d73dfdb15 Campaign Difficulty: cleaned up a few things left over from 50a3960
Also a small logic cleanup.
2018-05-15 19:03:40 +11:00
Charles Dang
50a3960abd Removed a bunch of things deprecated at level 3
* Legacy campaign difficulty syntax
* [combo] in [modification]s
* Support for legacy DescriptionWML in the MP Faction Select dialog
2018-05-15 11:53:24 +11:00
Charles Dang
3e9424fa33 Removed macros deprecated at level 2 and 3
[ci skip]
2018-05-15 11:38:49 +11:00
mattsc
66b9e11a2d Replace remaining uses of FOREACH macro 2018-05-14 17:13:42 -07:00
Severin Glöckner
fd9fc26ca0 NR S2: balance imporvements between AIs
* castle of the southwestern leader has been moved down a bit
* fixup for  gate event and troll die event not properly working
* give dwarves more gold if they are in trouble, increased income of trolls
* added micro AIs, currently not working as expected
* other minor map edits
* removed patch 9b9aa13 for #3073, the village had been moved down one hex
  for visual reasons

[ci skip]
2018-05-15 00:28:18 +02:00
Jyrki Vesterinen
15446acb2a Allow modifying dead units in last_breath and die event handlers
Fixes an unintentional API change from commit 3c344e8da5, discussed in
comments of #3042.
2018-05-14 22:07:48 +03:00
Severin Glöckner
ed46bc1d2b wmllint: add campaign abilites & specials
So far only stun was in the list

[ci skip]
2018-05-14 06:11:29 +02:00
mattsc
4b6681a300 Do not load helper.lua where it is not used any more 2018-05-13 20:53:01 -07:00
mattsc
1684e2f5da Remove unnecessary inclusions of helper.set_wml_action_metatable {} 2018-05-13 20:52:51 -07:00
mattsc
08a000a7da Lua code: remove deprecated helper.set_wml_var_metatable() call
It’s not needed here.
2018-05-13 20:52:40 -07:00
mattsc
3c792fc7d7 Lua code: replace deprecated helper.[gs]et_variable_array() calls 2018-05-13 20:52:17 -07:00
mattsc
7c137e1a33 Lua code: replace deprecated helper.child_range() calls 2018-05-13 20:52:08 -07:00
mattsc
f0bb40590f Lua code: replace deprecated helper.get_child() calls 2018-05-13 20:51:56 -07:00
mattsc
f153279e87 Lua code: replace deprecated helper.get_variable_proxy_array() call 2018-05-13 20:51:35 -07:00
mattsc
64f7ad2560 Lua code: replace deprecated wesnoth.get_all_vars() calls 2018-05-13 20:50:49 -07:00
Charles Dang
8f93d0a7c6 Saved Game: reame "starting pos" to "starting point" to avoid confusion
The old name was too easy to confuse with a side's map staring position, something
I've done several times.
2018-05-14 14:45:54 +11:00
mattsc
ce7faae4f4 Lua code: replace deprecated wesnoth.set_variable() calls 2018-05-13 20:35:20 -07:00
mattsc
0f157bff27 Prevent definition of wml.variables to cause deprecation warnings 2018-05-13 20:20:43 -07:00
Charles Dang
ba0a12b918 Clarify the Dunefolk are human
[ci skip]
2018-05-14 14:17:00 +11:00
mattsc
f1764d182f Lua code: replace deprecated wesnoth.get_variable() calls 2018-05-13 20:03:34 -07:00
mattsc
138107c8f6 Lua code: replace deprecated wesnoth.tovconfig() calls 2018-05-13 19:54:14 -07:00
doofus-01
16d5bc5028 clean-up of unit cfg 2018-05-14 13:51:20 +11:00
doofus-01
90fefabc4e quenoth fighter attack animation 2018-05-14 13:51:19 +11:00
Thom Diment
b7b6ff34df changed SE path to remove 1-hex bottlenecks
This allows player 3 to send more enemies against the human player sooner. If this is an issue, may be necessary to  consider changing the scenario wml to delay this player spawning by a turn.
2018-05-14 11:56:18 +11:00
doofus-01
a943e1c55d outrider defense animation 2018-05-14 11:42:04 +11:00
doofus-01
fc639f6cc0 pathfinder defense animation 2018-05-14 11:42:04 +11:00
mattsc
5e5a9e69e5 MAI test scenarios: remove uses of deprecated MESSAGE macro 2018-05-13 15:41:10 -07:00
ln-zookeeper
9c65035075 Fixed a remaining glitch with off-map<->water transitions 2018-05-14 00:24:15 +03:00
catagent101
743be1522c TSG S07a: Fix dialogue not triggering in TSG 'Into the Depths' (#3048) 2018-05-14 00:00:43 +03:00
doofus-01
fa59b1084c [UtBS] replacing horses with dustboks (#3049)
* removing horses from text strings - replaced with dustboks

* adding a riderless dustbok to monsters race, needs description and probably other adjustments

* removing disengage ability and translation mark from dustbok unit file

* adding #po translation hint for name
2018-05-13 23:42:02 +03:00
gfgtdf
e88a73fc2a fix uncaught stoi exception 2018-05-13 16:14:06 +02:00
gfgtdf
fd48bad8d9 wb: fix segfault when ending the game
fixes #3008

This is not the prettiest fix, but in particular for 1.14 stable it's
less risky than some big refactor.
2018-05-13 16:11:35 +02:00
gfgtdf
eaabf1648d wb: fix incorrect handling of skirmisher.
fixes #3014
2018-05-13 16:11:26 +02:00
gfgtdf
6a9e2c260d wb: add a assertion 2018-05-13 16:11:07 +02:00
gfgtdf
5884aa27ea wb: don't clear undo stack when dsu is active
since that might lead to assertion failures&oos later, fixes #3029
2018-05-13 16:09:09 +02:00
gfgtdf
5c278a3936 editor: don't allow bad location id strings
in particular using spaces or commas here results in invalid map files when the map is written to disk. (repoted on the forum)
2018-05-13 16:06:03 +02:00
Charles Dang
0d15c1e19e Formatting cleanup: convert remaining cases of > > to >> 2018-05-14 00:09:23 +11:00
Charles Dang
2c57dc3705 Convert a bunch more C-style casts I missed in 0dc5656 to static_cast 2018-05-14 00:07:27 +11:00
Charles Dang
cc86502700 Fixup ccbb736 2018-05-14 00:03:50 +11:00
Charles Dang
0dc5656c32 Convert C-style casts to static_cast 2018-05-13 22:36:50 +11:00
Charles Dang
36e83e646c Use std::tm instead of plain C tm 2018-05-13 22:28:12 +11:00
Charles Dang
00bea6494f Use std::localtime() instead of plain C localtime() 2018-05-13 22:26:10 +11:00
Charles Dang
d26824901d Use std::time() instead of plain C time() 2018-05-13 22:22:07 +11:00
Charles Dang
ccbb736a18 Use std::time_t instead of plain C time_t 2018-05-13 22:13:33 +11:00
Martin Hrubý (hrubymar10)
e16373bada
Fix Xcode project after e0192b1b1f 2018-05-13 13:09:33 +02:00
Charles Dang
1e84ec2b94 Added the appropriate check to enable std::filesystem when using GCC 8 2018-05-13 21:46:54 +11:00
Nils Kneuper
f9b9d5018f remove executable flag from italian translation images 2018-05-13 11:27:29 +02:00
Nils Kneuper
4918a6234e updated Italian translation (images) 2018-05-13 11:23:45 +02:00
Nils Kneuper
adb4c511e2 updated French translation 2018-05-13 11:20:58 +02:00
Jyrki Vesterinen
91e60267ba MP lobby: don't attempt to restore player list scroll position too early
Fixes error messages in the log when joining the lobby.
2018-05-13 12:16:33 +03:00
Iris Morelle
c8c3625e3a wesnothd: Fix typo introduced recently causing build errors
Fixes commit 2bf4d68c87.
2018-05-13 04:06:23 -04:00
Iris Morelle
ba64a502e1 bi: Refactor report headers generation 2018-05-13 01:45:59 -04:00
Charles Dang
0d1571a0b2 MP Lobby: used "not installed" instead of "missing" 2018-05-13 16:17:09 +11:00
Charles Dang
2bf4d68c87 Catch all exceptions (where possible) as const references
A few catch blocks modify something in their exceptions, so those are kept non-const.
2018-05-13 15:48:14 +11:00
Charles Dang
74f86aea1d Mark wml_exception::show const and formula_ai::handle_exception's argument const 2018-05-13 15:46:31 +11:00
Jyrki Vesterinen
c3d711632e Fix compiler warning about unreferenced variable 2018-05-13 07:32:47 +03:00
Fernando Carmona Varo
026ea6ee78 tutorial: add labels to villages and keep
Prevents new players from mistaking the graphics
2018-05-13 14:02:21 +11:00
mattsc
7d0d9e19a5 Lua random map generator: fix off-by-one error in flip transforms
Among other things, this gave HttT S17 (Sceptre of Fire) a 50% chance
of crashing at scenario start.
2018-05-12 18:43:16 -07:00
Severin Glöckner
1b1762cdf2 UtBS utils: add female string (fixup)
[ci skip]
2018-05-13 01:23:52 +02:00
Charles Dang
f34db1b8ac MP Lobby: removed "illegal map" error (see #3095)
There's still the "Error while loading the map:" error emitted by the minimap
widget, but this at least curbs the duplicates.
2018-05-13 08:53:56 +11:00
Severin Glöckner
9baee77e4a NR S2: fixup prose
[ci_skip]
2018-05-12 22:08:02 +02:00
Severin Glöckner
41298d76c7 NR S2: better conditional for victory event
previousl one could trigger victory while being at
the other side of the cave wall

[ci skip]
2018-05-12 21:42:27 +02:00
Severin Glöckner
1d288355b0 Change Death Knights axe icon to fitting axe
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
682a84ffec NR S2: improve balancing
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
0ad223ab85 NR S2: flavor event: fix coordinates
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
255e77115d Nr S2: edited map:
* make north gate obvious to players
* mitigate bridges transition
* use less human castles
* don't break northern train line
* move the bridges in the Trolls keep farther behind, to be less
  vulnerabe to the northern leader

[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
401eba49e2 NR S2: show message for northern border too
[ci skip]
2018-05-12 20:32:23 +02:00
Charles Dang
e0192b1b1f Renamed filesystem_boost.cpp to filesystem.cpp 2018-05-13 00:10:56 +11:00
Charles Dang
231d97c27f Filesystem: added (currently incomplete) support for using std::filesystem
Not usable until I figure out how to convert the return value of std::filesystem::last_write_time
to time_t, but this lays the groundwork.
2018-05-13 00:06:19 +11:00
Nils Kneuper
0b8c90e752 updated Ukrainian translation 2018-05-12 10:54:04 +02:00
Nils Kneuper
ecedf14aa7 updated Italian translation 2018-05-12 10:52:53 +02:00
Nils Kneuper
488c587f8e updated British English translation 2018-05-12 10:51:14 +02:00
Jyrki Vesterinen
ab0d3747aa Changelog entry for commit a3658473c9 2018-05-12 09:55:06 +03:00
Jyrki Vesterinen
a3658473c9 MP lobby: fix player list scrolling to top when it changes 2018-05-12 09:51:44 +03:00
Charles Dang
36c0b6b648 MP Lobby: removed "Registered Users Only" from settings list in info tooltip
This isn't really relevant anymore since everyone is registered on the official server.
2018-05-12 15:33:30 +11:00
Charles Dang
c20eab0a5e MP Lobby: sort mods list alphabetically and color "missing" text 2018-05-12 15:33:29 +11:00
Charles Dang
ee90182886 Actions/Create: formatting cleanup 2018-05-12 14:30:22 +11:00
Severin Glöckner
1f75c5b14d NR S2: remove second endlevel event for hamels death
This level has it's own event to handle this situation.

closes #3091
[ci skip]
2018-05-11 21:38:42 +02:00
Severin Glöckner
52d8cef080 NR S2: refactor objectives
[ci skip]
2018-05-11 20:32:07 +02:00
Severin Glöckner
76134436fc NR S2: Avoid Tallin talking to himself
(part of #3086)
[ci skip]
2018-05-11 20:32:07 +02:00
Pentarctagon
34965741bd Fix FindGLEW being incorrectly named.
It was .make, it should be .cmake.
2018-05-11 11:22:20 -05:00
Pentarctagon
8582ce1044 Mark OpenGL and GLEW as required in cmake. 2018-05-11 11:22:20 -05:00
Pentarctagon
7a3fb8815b Fix missing SDLMain.mm. 2018-05-11 11:22:20 -05:00
Pentarctagon
f5d74cd5ed Fix building with osx+cmake on travis. 2018-05-11 11:22:20 -05:00
Pentarctagon
f53c6b84cd Add osx+cmake support to travis. 2018-05-11 11:22:20 -05:00
mattsc
9b9aa13a3d Northern Rebirth S02_01: keep side 8 leader from wandering off too far
If he ends up on the tiny keep in the south, he can only recruit one
unit per turn, which affects the intended balance of the scenario.
Fixes #3073
2018-05-11 09:09:36 -07:00
Severin Glöckner
4873f1a41e UtBS S1: change terrain code of the death tree hex
Visually it has no effect since the embelishment is
covered by the tree image.
In the help it is now not only displayed as grass.

[ci skip]
2018-05-11 14:07:53 +02:00
Severin Glöckner
8ac1518884 UtBS: add female variations for all ability names
including the ones which do not require it,
to make it easier to reuse them

[ci skip]
2018-05-11 14:07:23 +02:00
Charles Dang
f279ad5fc0 Whiteboard: avoid the use of a deprecated C++17 function
shared_ptr::unique() is equivalent to use_count() == 1. A few of these checks should probably
be > 1 to account for 0, but this is a direct logical translation.
2018-05-11 16:10:56 +11:00
Charles Dang
1c575f59fa Work around some weird compiler bug with VS using C++17
Without this, I get the error "syntax error: '<'" and a reference to the function's
opening bracket... No idea why. It build fine on VS 15.7.1 with C++14.
2018-05-11 16:08:42 +11:00
Charles Dang
0f9a0fac5e Filesystem/Boost: don't import boost::fileystem::path class to global namespace
This makes it a *lot* clearer that we're using the bfs class and not some function
or class defined elsewhere in our code.
2018-05-11 12:08:56 +11:00
Charles Dang
c643b765dd Filesystem/Boost: range-for 2018-05-11 11:54:37 +11:00
Charles Dang
32111ae5e9 Filesystem/Boost: made use of std::make_unique 2018-05-11 11:54:36 +11:00
Charles Dang
f105fa2036 Filesystem/Boost: formatting cleanup 2018-05-11 11:54:35 +11:00
David white
3886228447 added use_prng preference which adds a new experimental pseudo-RNG for casual campaign play 2018-05-11 11:23:01 +11:00
Charles Dang
b89b89abea Only redefine VOLUME_NAME_NONE if it's not previously defined 2018-05-11 11:22:25 +11:00
Charles Dang
41b436abd3 Fixup 497d58d (forgot to free the doc path) 2018-05-11 11:15:40 +11:00
Charles Dang
2a585118d8 Bump min required Windows version to 7
Technically, all this code should work on Vista, (including the recent switch to using
SHGetKnownFolderPath), but since we're also considering requiring Visual Studio 2017
for building, we need Windows 7.
2018-05-11 10:56:11 +11:00
Charles Dang
497d58df6f Convert use of deprecated SHGetFolderPathW to SHGetKnownFolderPath 2018-05-11 10:29:12 +11:00
Jyrki Vesterinen
9db47334a9 Changelog entry for commit 8fa3f6a6d4 2018-05-10 11:09:41 +03:00
Jyrki Vesterinen
8fa3f6a6d4 Fix #3065: unit halo remains after undoing a recall 2018-05-10 11:07:24 +03:00
Iris Morelle
fc002f49a9 pofix: Update with 1.14.0 -> 1.14.1 file size rules for the website
[ci skip]
2018-05-09 18:38:31 -03:00
Iris Morelle
c517abb122 pofix: Update with 1.14.0 -> 1.14.1 rules for the website
[ci skip]
2018-05-09 17:53:51 -03:00
Jyrki Vesterinen
ef60deaa2b Disallow units with negative HP
Damage calculation code can't tolerate presence of such units.

Fixes #3042.
2018-05-09 21:38:55 +03:00
Charles Dang
05774a3df5 Changelog: fixed inaccuracy
[ci skip]
2018-05-09 23:58:41 +11:00
Charles Dang
4c937c10c7 Fixed a crash when using certain invalid color= values
The specific case that brought this to our attention was color=100. In case such values
are used, the color reverts back to the default color for that side, as before.

The new codepath (team::get_side_color_id_from_config) is essentially the same as the old
one but more robust (range checking, for example, the lack of which was causing the crash
before).
2018-05-09 23:58:40 +11:00
Charles Dang
6a7bd05250 Revert "MP Lobby: reduced frequency of network polls (100ms -> 1000ms)"
This reverts commit 5fd833a91a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
2018-05-09 23:58:40 +11:00
Charles Dang
fd86d1ff8c UtBS: wmlindent run
[ci skip]
2018-05-09 23:58:39 +11:00
Iris Morelle
92812588b3 Add changelog entries for the workaround for issue #3050
[ci skip]
2018-05-09 04:57:59 -03:00
Pentarctagon
96b43a9af4 Warn about use of trampolines for nested functions.
Use of this feature with GCC in particular causes the stack to become marked as executable.
2018-05-09 10:38:23 +03:00
gfgtdf
a3decde67f more debug information in icompare 2018-05-09 03:32:10 -03:00
Iris Morelle
4335bedeff wam: Allow using embedded data URIs as add-on icons
[ci skip]
2018-05-08 02:26:34 -03:00
Iris Morelle
c92b9de1db Update own credits entries
[ci skip]
2018-05-08 02:25:30 -03:00
ln-zookeeper
f8a02e5e6d Updated changelog 2018-05-08 00:53:52 +03:00
ln-zookeeper
083066bff2 UtBS: Fixed a bug in the formation ability
If a unit had for example 3 other formation units adjacent but only needed 1 to reach 70% defense, it didn't receive any benefit at all (as the corresponding [chance_to_hit] tag remained inactive).

Spotted and fix provided by beetlenaut.
2018-05-08 00:42:08 +03:00
Nils Kneuper
add4ea3d95 updated German translation 2018-05-07 23:04:05 +02:00
Nils Kneuper
de2b3d186e updated Chinese (Simplified) translation 2018-05-07 19:45:06 +02:00
Nils Kneuper
6d0f7c3a62 updated Japanese translation 2018-05-07 19:44:05 +02:00
Nils Kneuper
587c280d41 updated Italian translation 2018-05-07 19:39:59 +02:00
Nils Kneuper
7290b1b3ab updated Galician translation 2018-05-07 19:38:22 +02:00
Nils Kneuper
6c01d8494b updated Scottish Gaelic translation 2018-05-07 19:37:01 +02:00
Nils Kneuper
255be2e003 updated Spanish translation 2018-05-07 19:35:35 +02:00
Jyrki Vesterinen
057e53a463 Partial case insensitivity for translation::icompare() fallback 2018-05-07 19:46:42 +03:00
Iris Morelle
871189cc36 i18n: Blind fix attempt for std::bad_cast being thrown on Windows
Several reports on Steam and our forums point at std::bad_cast being
thrown when accessing Preferences and the Multiplayer menu amongst
others. It's possible that the locale configuration on those systems is
not quite right, and compare() and icompare() are able to throw
std::bad_cast when this happens as they both use std::use_facet().

Note that much like the macOS/iOS version of icompare(), this stopgap
patch doesn't attempt to provide any form of case-insensitive fallback
and just uses a case-sensitive comparison instead.
2018-05-07 19:46:31 +03:00
Charles Dang
26c8860b6c Preferences Dialog: fixed inconsistent label sizes in hotkeys list 2018-05-07 13:56:45 +11:00
Charles Dang
58ebc064e9 MP Lobby: bunch of small UI and text formatting tweaks 2018-05-07 11:42:11 +11:00
doofus-01
21708d8add [UtBS]-Graphics Update, mostly defense animations (#3035)
* quenoth ranger defense anim

* youth leading animations

* Kaleh bolas anim

* quenoth flanker defense anim

* quenoth druid defense anim

* quenoth archer defense anim
2018-05-07 11:42:09 +11:00
Nils Kneuper
69bc5b614f updated Slovak translation 2018-05-06 23:05:16 +02:00
Nils Kneuper
58bfca286a updated Czech translation 2018-05-06 23:03:19 +02:00
sigurdfdragon
a67e068178 Help: Add wolves race description
From https://forums.wesnoth.org/viewtopic.php?f=32&t=43721&start=75#p597028

[ci skip]
2018-05-06 12:44:07 -04:00
sigurdfdragon
e9ab1ce8d1 Help: Add falcons race description
From https://forums.wesnoth.org/viewtopic.php?f=32&t=43721&p=593757#p593757

[ci skip]
2018-05-06 12:44:07 -04:00
Wedge009
d85e2a2886 Update text to match game-play changes (fixes #2950).
[ci skip]
2018-05-06 18:40:35 +02:00
Wedge009
f1bcdc7f1b Update text to match changes in dialogues (fixes #2882).
[ci skip]
2018-05-06 18:40:35 +02:00
Nils Kneuper
d0ebbbb7c3 updated Chinese (Simplified) translation 2018-05-06 17:13:12 +02:00
Charles Dang
79c9862129 MP Lobby: reduced frequency of network polls (100ms -> 1000ms)
This also affects MP Staging and MP Join Game.
2018-05-06 22:59:21 +11:00
Charles Dang
6d84ee70c5 MP Lobby: rearrange player list nodes and have Selected Game also expanded by default 2018-05-06 22:59:20 +11:00
Charles Dang
be580a1973 GUI2/Chatbox: attempt to send roomless messages to the active room first
Fixes #2775. Server messages in particular are roomless, so now they should appear in
whatever tab (PMs included) you have open.
2018-05-06 22:59:19 +11:00
Charles Dang
2769345f55 Increased in-game chat size. This makes it render more smoothly
Thanks to @ProditorMagnus for the suggestion. Note that here on master, this code isn't
really used right now, so it's mostly here for completeness if it turns out to be needed.
2018-05-06 22:59:18 +11:00
Charles Dang
fe10bc0315 MP Lobby: removed Refresh button
I'm not 100% sure about this change, but I think its presence was rather confusing and
it (hopefully) shouldn't ever be needed.
2018-05-06 22:59:17 +11:00
Nils Kneuper
d98d711e24 updated British English translation 2018-05-06 13:44:26 +02:00
Lipka Boldizsár
7b5cf85461 Fix excessive mp lobby refreshing. 2018-05-06 22:42:33 +11:00
Nils Kneuper
0dda29b238 updated Czech translation 2018-05-06 13:32:14 +02:00
Lipka Boldizsár
8bd6646182 Revert "Fix excessive mp lobby refreshing."
This reverts commit 590fd3c4d5.
2018-05-06 13:02:56 +02:00
Lipka Boldizsár
590fd3c4d5 Fix excessive mp lobby refreshing. 2018-05-06 12:55:29 +02:00
Iris Morelle
9850d3fa9c Update changelog for #3019
[ci skip]
2018-05-06 07:14:40 -03:00
Alexander van Gessel
6444ebde60 Reject bad data URIs 2018-05-06 07:13:21 -03:00
Iris Morelle
622b1936bc Update changelog for MP server stuff from me and loonycyborg
[ci skip]
2018-05-06 05:29:05 -03:00
Iris Morelle
c0f160b351 fuh: Add NOTE on the status of glob bans
[ci skip]
2018-05-06 05:25:23 -03:00
Iris Morelle
80d6dbbaf9 mp: Add client-side localization support for user_handler bans 2018-05-06 05:25:16 -03:00
Iris Morelle
d48c84236c wesnothd/fuh: Check IP address bans before everything else
There isn't much point in doing more expensive ban look ups first.

(Also, yes, I am aware that as it is there's still two SELECT queries
that could be coalesced into a single one -- namely, the ones for the
user_email and user_id columns.)
2018-05-06 05:25:10 -03:00
Iris Morelle
749e684f03 wesnothd: Report different user_handler ban types
This enables reporting back to the client the specific type of ban that
affects the account. This information is already normally provided by
phpBB when trying to view a page while banned, so we are not leaking any
new information here.

There isn't an API to retrieve the (user-visible) ban reason from the
ban list yet. It's probably not worth worrying about it since affected
users can see it when navigating to forums.wesnoth.org anyway.
2018-05-06 05:25:06 -03:00
Iris Morelle
f2c06f0a4e wesnothd: Initial support for checking forum bans during login
This adds a user_is_banned() method to the user_handler classes that
returns whether a given username (and optionally IP address) is banned
by the user_handler platform. Obviously right now this is only intended
to work with forum_user_handler and phpBB.

Forum bans are checked against entries in the banlist table using
username (actually user id), IP address, and email address where
applicable. A user matching a ban on any of those three items will not
be permitted into the server *unless* they have the moderator flag set.
It might be worth making an exception for board founders as well,
although that is probably orthogonal to this patchset.

Right now there are a few missing items:

 * The server sends clients an error that allows them to try again with
   a different username/password combination immediately. Nothing stops
   them from causing noise in the server logs this way, so we probably
   need to ensure this counts as an authentication failure for the
   purpose of temporarily and automatically banning the IP address.

 * The user handler doesn't allow retrieving details about the ban, so
   all that the main server code can do is report back to the client as
   their nickname being banned, when this is not necessarily the case
   (email or IP address bans). I need to figure out a better API for
   retrieving this info.

 * Likewise, the server does not log the specifics about the matched ban
   yet unless the mp_user_handler log domain is set to the info log
   level.

 * There's no i18n support on the client side for the error message sent
   by the server -- which is going to change anyway.

 * Testing this patch uncovered an issue with the MP client not
   displaying messages sent during the login sequence, including the mod
   authentication notice.
2018-05-06 05:25:02 -03:00
Charles Dang
851b28e24b * MP Method Selection: clarified the account requirement for the official server
Also sets the tooltip type for this dialog back to bottom-of-the-screen ones instead
of floating ones. And some formatting cleanup to the C++.
2018-05-06 16:39:31 +11:00
Iris Morelle
d39d1b87fd pofix: Add 1.14 announcement typo fix
[ci skip]
2018-05-06 02:38:14 -03:00
Iris Morelle
d727cf2c99 gui2/unit_attack: Only display active specials on the weapons list
This fixes issues reported on the forums where the weapons list now
includes weapon specials even when they aren't active, a regression from
1.12.x.

Closes #3033.
2018-05-06 00:40:11 -03:00
Celtic Minstrel
ebf3866132
Update credits
* Add @neoedmund, @fujimo-t, and Zoomo
* Add @singalen's alias
* Correct @GregoryLundberg's alias
2018-05-05 21:13:30 -04:00
mattsc
a82971e48d changelog entry for custom AI for AToTB S2 2018-05-05 13:58:51 -07:00
mattsc
bbb151fa71 AToTB Chase: add custom AI controlling Muff Toras 2018-05-05 13:54:49 -07:00
Charles Dang
a8ce08fc23 UtBS: wmlindent pass
[ci skip]
2018-05-06 06:39:10 +11:00
gfgtdf
775f3ec995 wb: prevent unit id conflics
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
2018-05-06 06:30:55 +11:00
gfgtdf
8b745095ab add a comment 2018-05-06 06:30:53 +11:00
gfgtdf
cdb98f75a4 wb: fix 'insufficient movement' wanring when a move is interrupted 2018-05-06 06:30:52 +11:00
gfgtdf
2635c7014f wb: more detailed error message 2018-05-06 06:30:51 +11:00
gfgtdf
4725ba9f35 add todo 2018-05-06 06:30:50 +11:00
gfgtdf
aa3a357bfc wb: fix planned units under fog cannot be selected 2018-05-06 06:30:49 +11:00
gfgtdf
51189881dc wb: silence "Unable to build future map" warning 2018-05-06 06:30:48 +11:00
gfgtdf
5a3eec5398 fix comment 2018-05-06 06:30:47 +11:00
gfgtdf
14a0e3744f wb: fix rare OOS caused by recall action
previously having a planned recall action could change the order of
units in the recall list, which might for example change which unit is
recalled by a [recall].
2018-05-06 06:30:46 +11:00
gfgtdf
19e123e38b wb: fix recall actions changing gamestate
The firstproblem was that:
apply_temp_modifier adds the temp_unit_ to the map, then
remove_temp_modifier adds the temp_unit_ from the map to the recall
list, which resulted in the original recall unit beeing replaced by the
temp_unit_ of the recall_action We fix that by making sure that
temp_unit_ is always the same as athe recall unti not just a copy.

The second problem was that remove_temp_modifier reset the unit mp/ap to
a value differnt form the original mp/ap which could casue OOS later
since the ap/mp might be changed form that unsynced context, we fix that
by resetting the mp/ap in remove_temp_modifier
2018-05-06 06:30:45 +11:00
gfgtdf
97a5810f2d wb: fix moved becoming invalid after recruit is executed 2
turned out 8bdccca7 was not enough because the mapbuilder erroneously
reset the units movement to full directly before it was applied. Since
the `resetters_` code in mapbuilder.cpp does not apply to
recruited/recalled units, we also have to reset the units mp in
remove_temp_modifier.
2018-05-06 06:28:46 +11:00
pentarctagon
6c5fc82b1b Add option to build wesnoth with hardening options. 2018-05-05 10:05:53 -05:00
loonycyborg
10ee2b2d29 wesnothd: add a check to prevent crash from accessing game owner not in player_connections_ 2018-05-05 15:09:49 +03:00
gfgtdf
c580156716 remvoe spammy debug message. 2018-05-05 18:10:54 +11:00
gfgtdf
8bdccca7e3 wb: fix moved becoming invalid after recruit is executed 2018-05-05 18:10:53 +11:00
Charles Dang
717578b8a3 MP Lobby: kept the titles of reloaded games with vacant slots yellow 2018-05-05 14:00:21 +11:00
Charles Dang
7983b283ce Yet even more additional supplementary additive fixup 2018-05-05 13:31:16 +11:00
Charles Dang
77922e5450 Fixup 18afe08 2018-05-05 13:00:10 +11:00
Celtic Minstrel
acb48da5d2 SotA: Avoid use of 'kids' to address Carcyn and Shynal
This is intended to address concerns raised by @beetlenaut that the two are not young enough to be referred to as 'kids'.
2018-05-05 12:58:40 +11:00
Charles Dang
2f565b8e90 MP Lobby: base resolution selection on window width not height
[ci skip]

Height isn't the problem. The default lobby can display fine even at 600 px h. Width is
the problem the default layout faces at low resolutions, and it was quite odd to have a
really wide window use the low resolution layout, despite there obviously being enough
horizontal space to fit the sidebar.
2018-05-05 12:35:27 +11:00
Charles Dang
d789c2e773 MP Lobby: fixed every single user name being bold
If everyone's registered... no one is. :P
2018-05-05 12:35:05 +11:00
Charles Dang
08d0f6983f MP Lobby: decreased size of scenario/era name label
[ci skip]

Will slightly mitigate the issue of it potentially getting too long...
2018-05-05 12:35:04 +11:00
Charles Dang
0db17bbcf1 MP Lobby: shifted game info icon to the left
[ci skip]
2018-05-05 12:35:03 +11:00
Charles Dang
819947f95f MP Lobby: added status text for full games 2018-05-05 12:35:02 +11:00
Charles Dang
b17e9fa9b1 MP Lobby: restored Era info to main game display
Includes some slight spacing tweaks.
2018-05-05 12:35:00 +11:00
Charles Dang
b947e7f63d Added some changelog entries for UtBS
[ci skip]
2018-05-05 12:34:36 +11:00
Charles Dang
d9e3983e97 MP Create Game: cap custom game names at 50 characters
[ci skip]
2018-05-05 12:34:00 +11:00
Charles Dang
18afe08a7b GUI2/Size Lock: ensure formula sizes are recalculated as necessary.
This is similar to the change made for spacers in da5f00c2b6.
It also fixes an issue with the MP Lobby chat box (and other such widgets that use formulas
for their fixed dimensions) where it would stay too small after a window resize (the chat
box formulas in all three dialogs it appears in are a percentage of window height).
2018-05-05 12:33:38 +11:00
loonycyborg
6a310f0c79 wesnothd: process wml commands one at a time in handle_read_from_player
as is done in rest of wesnothd. This also fixes crash from self-kick
due to it trying to continue processing looking for further tags
after /query kick kicked the user in quesion.
2018-05-04 19:08:24 +03:00
Iris Morelle
3259ef75b9 Fixed some issues with desynced changelogs and incorrect capitalization/order
[ci skip]
2018-05-04 07:05:31 -03:00
Iris Morelle
c503c2ce35 mp: Improve display of wesnothd client errors in general
Besides replacing the "End of file" error when getting disconnected from
the server under unexpected circumstances (e.g. because the server died)
with a translatable and more intuitive message, this also makes it so
other network error messages ("Connection refused", "Host not found",
etcetera) are displayed in the UI in a slightly clearer fashion, and in
an error dialog that must be dismissed with a click on a button, instead
of a transient message that can be easily missed due to an accidental
misclick.

Closes #3005.
2018-05-04 07:05:31 -03:00
ln-zookeeper
195d5a93db UtBS: Fixed some obsolete references to old elf units, weapons and hair
In S03, also removed one extra instance of the word "champion" from the same string.
2018-05-04 12:58:40 +03:00
loonycyborg
40ae6c5356 wesnothd: fix game host kick command kicking host itself instead of intended target 2018-05-04 12:27:10 +03:00
ln-zookeeper
d217dfc13c EI S11: Fixed units incorrectly costing upkeep after leveling up 2018-05-04 11:21:27 +03:00
Pentarctagon
5fed276ad7 Fix cmake compiling with spaces in directory names. 2018-05-04 01:30:44 -05:00
Charles Dang
195eb0ce73 MP Lobby: improved low-resolution layout
[ci skip]

* Removed unnecessary spacer line.
* Increased chat area height by 10% .
2018-05-04 17:17:53 +11:00
Severin Glöckner
774471ba29 Lobby mouseover: rename Gold to Gold per Village 2018-05-04 06:54:19 +02:00
Charles Dang
3e27ccaf18 MP Lobby: highlight the titles of MP games with vacant slots 2018-05-04 15:03:17 +11:00
Charles Dang
3d158130f4 MP Lobby: used specific colors instead of pango presets
The Pango presets are usually a little darker than we want, so this makes the colors POP.
2018-05-04 15:02:52 +11:00
Charles Dang
65a554f41d GUI2/Chatbox: fixed close button being shown for lobby tab when reloading log
Fixes #2992.
2018-05-04 13:09:32 +11:00
Charles Dang
ffe71c5157 MP Lobby: removed individual Join/Observe buttons for each game 2018-05-04 13:09:30 +11:00
loonycyborg
b0cbe3adf7 wesnothd: fix crash from using reference to deleted object 2018-05-04 02:58:46 +03:00
gfgtdf
04d0dcdf65 wb: fix moves for planned recruits
the for those moves get_unit() might return nullptr when it is
when the future map is not applied and some codes deduced from
that that the action is invalid. So we make sure that code does
not rely on get_unit().
2018-05-04 10:51:03 +11:00
gfgtdf
c9df4bf02a wb: add debug info 2018-05-04 10:50:39 +11:00
gfgtdf
6cfe64e4da wb: cleanups & add debug message 2018-05-04 10:50:38 +11:00
gfgtdf
4f161d889c wb: fix crash when using planning mode mode with dsu
fixes #1599 . we now automaticllay disable dsu when enabling planning mode
2018-05-04 10:50:37 +11:00
gfgtdf
2174bfc215 wb: update following moves when a recruit is executed
After a recruit action was executed the id of the unit was changed so we
need to update the unitid of all following actions on that unit
2018-05-04 10:50:36 +11:00
gfgtdf
5847615a77 wb: refactor out get_unit() calls
there have been reported many assertion failures due to get_unit()
returning nullptr, so we try not to rely on get_unit() whenever
possible.
2018-05-04 10:48:57 +11:00
gfgtdf
00f90eabe6 wb: fix nullptr assertion when log is enabled 2018-05-04 10:48:56 +11:00
gfgtdf
195913fc4b wb: more robust side_actions_container::erase
i don't really know why the old code had a special case for
`get_turn(next) != turn_of_position`, from what i see `turn_end(0)`
would basicially return the same value as `next`. The new code removes
that special case which resulted in assertion failures before (#1841)
and also consiers the case where `position` appears multiple times in
`turn_beginnings_`
2018-05-04 10:48:55 +11:00
gfgtdf
ba6495c96a wb: more robust side_actions_container::get_turn
the assumption

(turn_beginnings_[num] == it) => (get_turn(it) == num)

might be wrong in case that we have a turn with no actions, in which
case turn_beginnings_ contains duplicates and we actually want the upper
bound of (x <= it) in turn_beginnings_
2018-05-04 10:46:45 +11:00
gfgtdf
9277a6cf53 wb: fix future unit sprite missing
fixes #2124
2018-05-04 10:46:44 +11:00
Nils Kneuper
c19590fc45 updated Galician translation 2018-05-03 21:22:12 +02:00
Iris Morelle
006bd4d099 Fix wesnoth(6) claiming the default log level is error
It's been warning since version 1.9.0.

[ci skip]
2018-05-03 14:08:14 -03:00
loonycyborg
688ae150cc wesnothd: Fix remaining incorrect uses of simple_wml::get_attr instead of get_attr_dup 2018-05-03 12:14:34 +03:00
doofus-01
f880f40254 fix TOD lighting for sleeping Kaleh, and make sure Zhul is facing the right way in opening scene 2018-05-03 05:34:34 +11:00
doofus-01
ee04db61eb Bolas animations for Nym 2018-05-03 05:34:33 +11:00
doofus-01
de25b87924 defense animations for shaman 2018-05-03 05:34:32 +11:00
doofus-01
ad8bc76144 update to flanker and ranger base sprites 2018-05-03 05:34:32 +11:00
doofus-01
6ceedb4053 quenoth shaman and druid sprites 2018-05-03 05:34:31 +11:00
doofus-01
961bcb861d edit first scenario to remove female gender specifications for units that have no such variation. 2018-05-03 05:34:30 +11:00
doofus-01
faee9b7f3f smashed tree is no longer a terrain, just a scenario graphic 2018-05-03 05:34:28 +11:00
doofus-01
23e6481389 adding smashed tree terrain for first scenario 2018-05-03 05:34:26 +11:00
doofus-01
2e62fc22ec dead elf image requested in issue #2962 2018-05-03 05:34:25 +11:00
doofus-01
966c2205c8 adding minimal bow frames for quenoth youth Kaleh 2018-05-03 05:34:24 +11:00
doofus-01
9fd0286a65 minor orcish flag update 2018-05-03 05:34:23 +11:00
galegosimpatico
bbd83f17ed Bump program version. 2018-05-03 05:28:33 +11:00
Charles Dang
8582240d79 Slightly less harsh unknown map terrain code error message 2018-05-03 05:24:28 +11:00
Charles Dang
eacc1e0f6b Ditch the "titlescreen" nomenclature for player-visible strings 2018-05-03 05:24:27 +11:00
Jyrki Vesterinen
f074f812ca Changelog entry for commit 93f956ed4c 2018-05-02 14:55:26 +03:00
Jyrki Vesterinen
93f956ed4c Error message when trying to save a screenshot in an unsupported format 2018-05-02 14:51:55 +03:00
Charles Dang
f33111e86b Changelog entry for the misleading tooltip text fix
[ci skip]
2018-05-02 18:57:13 +11:00
Severin Glöckner
c8e3856f51 TRoW: readd leaderhip
(as 1st ability)

[ci skip]
2018-05-02 07:25:30 +02:00
Severin Glöckner
a96c9ac7aa TRoW: Remove leadership from Lvl. 1 Wesfolk leader
as there are no Lvl. 0 units.
2018-05-02 07:06:51 +02:00
Severin Glöckner
be221b5ef0 UtBS: remove submerge ability from Skeleton Rider
since he can't move onto deep water.
(and there is no deep water in the relevant scenario either)
Supposed to look better in the help.

[ci skip]
2018-05-02 07:06:51 +02:00
Charles Dang
2064e1e16c Threw out the extraneous default core description
[ci skip]
2018-05-02 15:48:54 +11:00
Charles Dang
6f057d8b02 MP Method Selection: removed text saying registered nicknames are optional
[ci skip]

This is currently only the case on the 1.14 server, but it's easiest just to
remove the line completely rather than constantly adding or re-adding it based
on whether you're using a or dev series.
2018-05-02 12:33:35 +11:00
Charles Dang
7d3d9daf0c Added trailers credits section
[ci skip]
2018-05-02 11:20:59 +11:00
Nils Kneuper
4f85e158c6 updated Spanish translation 2018-05-02 00:02:07 +02:00
Martin Hrubý (hrubymar10)
f217062116
Use pango and cairo from MCS until #2859 will be fixed 2018-05-01 19:02:00 +02:00
Charles Dang
f37f235b3e Attempt to fix build
I *think* the problem is the downcasting...but I don't know.
2018-05-01 13:48:49 +11:00
Charles Dang
c06810876d Clean up utils::parse_ranges 2018-05-01 13:44:22 +11:00
Charles Dang
6dca50ac10 AI/Contexts: simplify range check 2018-05-01 13:20:03 +11:00
Charles Dang
b5cb4b2bcc AI/configuration: minor code cleanup
Mostly involving avoiding unnecessary config copying.
2018-05-01 12:41:20 +11:00
Charles Dang
cc1b4825d9 AI/Configuration: formatting cleanup 2018-05-01 12:40:23 +11:00
Charles Dang
1c744875d3 AI/Actions: avoid inline ternaries in place of if blocks 2018-05-01 12:05:42 +11:00
Charles Dang
18d597e374 AI/Contexts: deployed std::make_shared in a place I missed 2018-05-01 12:00:34 +11:00
Charles Dang
691276a0b7 AI: removed duplicate composite AI typedef used a unique_ptr for it 2018-05-01 11:59:43 +11:00
Charles Dang
18b50f06fb AI: made use of unique_ptrs for action results
I had to move the implementations of certain context-related functions into the cpp
file since the result types were incomplete in the header, which doesn't work with a
unique_ptr (you get errors about being unable to delete an incomplete type).
2018-05-01 11:51:44 +11:00
Charles Dang
9756847d3b AI/Contexts: formatting cleanup 2018-05-01 11:28:45 +11:00
Charles Dang
81aba251fc AI/Actions: formatting cleanup 2018-05-01 10:51:58 +11:00
Charles Dang
344d7c6799 AI/Actions: use an initializer list for the error code name map 2018-05-01 10:37:47 +11:00
Charles Dang
64bd866ef2 AI/Lua: formatting cleanup 2018-05-01 10:11:01 +11:00
Victor Sergienko
dbffb51394 #2971 Scrolling with arrow keys can get stuck 2018-04-30 20:16:40 +03:00
pentarctagon
5e36a90039 Updates cmake and scons to be able to compile with OGL.
Scons OpenGL/GLEW test taken mostly verbatim from 3e2eba22a9
2018-04-30 17:14:18 +03:00
Nils Kneuper
9db34c2170 updated French translation 2018-04-30 13:48:12 +02:00
Charles Dang
e17b79cbee Repair 7db83e3 in the upwards direction
[ci skip]
2018-04-30 22:23:45 +11:00
Charles Dang
7db83e3a0e GUI2: removed unnecessary spaces and newlines from color macros
[ci skip]

Since these are usually used inline or as key values, we don't need the extra padding.
2018-04-30 22:20:40 +11:00
Charles Dang
604dcd8008 MP Create Game: keep background image width proportional to its height
[ci skip]
2018-04-30 21:21:19 +11:00
Charles Dang
09f7237631 Skeletal Dragon: discarded colored background full-alpha pixels I noticed
[ci skip]
2018-04-30 13:02:59 +11:00
Charles Dang
71d7f6a237 TRoW: new Lord Logalmier sprite by Kasdel with minor tweeks by @doofus-01
[ci skip]

See https://forums.wesnoth.org/viewtopic.php?p=625519#p625519
Resolves #2985.
2018-04-30 12:10:54 +11:00
Charles Dang
a6adb1a4b1 AI/Manager: deployed formatter() 2018-04-30 11:03:11 +11:00
Charles Dang
ffee80aa1f AI/Manager: formatting cleanup 2018-04-30 11:02:41 +11:00
gfgtdf
2e5d7139b9 fixup 2018-04-29 20:53:19 +02:00
gfgtdf
7751b790eb fix [on_undo] in menu items and custom_command
also fixes menu items beeing marked as undoabel even if they used the
synced rng.

#2979
2018-04-29 20:25:38 +02:00
Celtic Minstrel
5795892649 GUI.pyw: Fix wmlxgettext run failing if the output file already exists 2018-04-29 14:04:12 -04:00
Jyrki Vesterinen
33fa7d8b76 Fix possible null pointer dereference in display::init_flags()
Regression from commit 69d7413a75.

Found by Coverity.
2018-04-29 17:23:27 +03:00
gfgtdf
06ebcebed5 improve side drop message fixes #2820 2018-04-29 14:19:34 +02:00
Nils Kneuper
ce35c7b7bf update Slovak translation 2018-04-29 11:30:17 +02:00
Nils Kneuper
f677e3f2ad updated Italian translation 2018-04-29 11:28:24 +02:00
Nils Kneuper
64fe3988d8 fixed issues with building translation via cmake
commit 3effecd added an "if" block in CMakeLists with a variable that
does not exist ("NLS"). This breaks running translation updates for
every cmake user. Changed the variable to the existing "ENABLE_NLS".

@Pentarctagon I don't know if the travis script has to be adjusted as
well. Please test.
2018-04-29 11:26:01 +02:00
Celtic Minstrel
07e465e57b Support male_voice and female_voice in [message] 2018-04-28 23:09:29 -04:00
ln-zookeeper
ab1de53b4a UtBS: Include both Kaleh and Nym in Quenoth Youth unit description 2018-04-29 12:56:16 +11:00
ln-zookeeper
cd00b55d2a UtBS S09: Avoid random gender and traits for Hekuba
The simplest if not the most elegant fix.
2018-04-29 12:56:15 +11:00
ln-zookeeper
4956bfcbba UtBS: Avoid random traits for Eloh's appearances 2018-04-29 12:56:14 +11:00
ln-zookeeper
9113478690 UtBS: Use core portraits for Esanoo, Rogrimir and Grog
These were the only remaining character portraits in the old style, so they would stick out among the new ones.
2018-04-29 12:56:14 +11:00
Charles Dang
69d7413a75 Display: some code cleanup
* Consolidate reinit_flags_for_side and init_flags_for_side_internal
* Made use of the team/map/unit getters.
2018-04-29 12:56:13 +11:00
gfgtdf
d31e74aee0 improve mp sync waiting message 2018-04-28 23:02:16 +02:00
Charles Dang
b47837b3c0 GUI2/Dialogs: cleaned up a bunch of unnecessary forward declarations 2018-04-29 06:52:36 +11:00
Charles Dang
78ea6db7e8 Cleaned up a few unnecessary AI-related includes outside ai/ 2018-04-29 06:45:41 +11:00
Charles Dang
ba150c0298 AI: deployed std::make_shared in a whole bunch of places
Also simplified a few instance of shared_ptr assignment. No need to create a temp ptr
just to immediately assign them.
2018-04-29 06:09:51 +11:00
Charles Dang
1e846aced2 AI: deployed typesafe_aspect_ptr consistently
No reason this couldn't have used aspect_type<t>typesafe_ptr before, so this just
makes uses of this specific type easier to find.
2018-04-29 05:58:44 +11:00
Charles Dang
1b8bfa6ab4 AI: simplify some typedefs with template aliases 2018-04-29 05:53:41 +11:00
Charles Dang
78e8ac51d7 Fixed Boost header deprecation warning on 1.67 and later
Also removed one unnecessary inclusion of the header of the same.
2018-04-29 05:34:56 +11:00
Charles Dang
1af08fb58e AI/Game Info: formatting/forward declaration cleanup 2018-04-29 05:25:36 +11:00
gfgtdf
6c802b5016 fix a %->$ in german translation 2018-04-28 13:07:29 +02:00
gfgtdf
41d7df970c fix segfault on area= filter.
areas_ might be empty, so areas_[0] might crash, also returning areas_[0].hexes didn't really make sense in the first place
2018-04-28 13:07:28 +02:00
Gregory A Lundberg
092f8f325c
Fix doccomment error
Remove lame doccomments.
2018-04-27 23:17:56 -05:00
pentarctagon
3effecdb06 Don't copy the po/ directory into the docker image for non-NLS jobs. 2018-04-27 16:00:04 -05:00
pentarctagon
ea4d85a06e Running the translations is short, so do them through scons and cmake. 2018-04-27 16:00:04 -05:00
pentarctagon
eb0a290ca1 Put the docker image on its own line. 2018-04-27 16:00:04 -05:00
Steve Cotton
f259976659 Make CMake error-out if required libraries aren't found
It seems that FIND_PACKAGE_HANDLE_STANDARD_ARGS is doing a case-sensitive
search for whether the find_package flags included REQUIRED.
2018-04-27 15:58:03 -05:00
gfgtdf
15c331281f editor: don't write default values when saving a scenario 2018-04-27 21:45:44 +02:00
Iris Morelle
ae5ab22b1a gui2/log_settings: Permit disabling logdomains (log level -1) 2018-04-27 01:52:40 -03:00
pentarctagon
2aed8af606 Adds lld to the 1804 docker image.
The gold linker is available already, but lld is not installed along with clang.
2018-04-26 23:44:13 -05:00
Charles Dang
6dfb87103c Made use of config_attribute_value::to_time_t 2018-04-27 13:15:07 +11:00
Nils Kneuper
c1f3cffa1c updated Italian translation 2018-04-26 22:55:18 +02:00
Charles Dang
f5626ddc30 Campaignd: made use of vector::at
This work since vector::at throws if i < size(), and the current check was for
> size() - 1, which equated to >= size(), which is equivalent to not < size().

It does lose the error message, though.
2018-04-26 20:55:45 +11:00
Wedge009
817f612f29 Update VC project files.
* Add missing project configurations.
* Remove remaining OpenMP support.
* Tidy filters.

[ci skip]
2018-04-26 18:37:50 +10:00
Matthias Krüger
29089a4736 cmake/scons: if sanitizers are enabled, also add -fno-omit-frame-pointer and -fno-optimize-sibling-calls.
Otherwise, if we build with sanitizers and optimizations, the sanitizer stacktraces can become quite hard to read.
2018-04-25 19:08:14 -05:00
pentarctagon
07e01cd9b8 Fix a header file being in a source list. 2018-04-25 18:45:10 -05:00
Charles Dang
23c2c2e2ae UtBS: removed existing story images
[ci skip]

Not up to current standards, and besides, one of them uses the old Kaleh portrait.
2018-04-26 04:34:54 +11:00
Severin Glöckner
f1e2e8ce7f Adjust the weapon names of the heroes to better fit their portraits
[ci skip]
2018-04-25 19:29:39 +02:00
Charles Dang
45b4bb5b27 UtBS: final set of updated character portraits by LordBob
Elyssa no longer has a Silver Mage portrait variant.
2018-04-25 23:45:46 +11:00
Charles Dang
9c5ec1c3b7 Better cordoning off of translation completion filtering 2018-04-25 16:58:37 +11:00
Charles Dang
6d09f702a5 Fixup 301fb93 2018-04-25 16:31:57 +11:00
Charles Dang
301fb933ac Cleaned up language completion filtering, but left it disabled here
We don't want this enabled on the dev branch.
2018-04-25 16:13:12 +11:00
Charles Dang
6eab44c4f3 Added and made use of a move ctor in battle_context
(and emplace_back). No reason to use the copy ctor in these cases.
2018-04-25 15:45:52 +11:00
Charles Dang
f3a77bf310 More changelog updates
[ci skip]
2018-04-25 14:25:19 +11:00
Charles Dang
4219e13ac5 Changelog entry for the Dark Forecast fix
[ci skip]
2018-04-25 14:16:33 +11:00
Charles Dang
d3e35f6c1f UtBS: new Quenoth Shyde sprite by Jetrel
[ci skip]
2018-04-25 14:09:00 +11:00
gfgtdf
438ca7bc1e fix lua error in 2p_Dark_Forecast 2 2018-04-25 14:01:46 +11:00
Jyrki Vesterinen
4c258ff550 Show chat logs (excluding lobby) also in MP Join Game 2018-04-24 19:29:53 +03:00
Jyrki Vesterinen
d628a73fab Hide lobby chat log in MP staging screen
Because updating and sending messages to lobby in staging screen hasn't
been implemented, showing lobby history there would be confusing
(it would look as if everyone had stopped talking).
2018-04-24 19:19:17 +03:00
Iris Morelle
f52828db88 pofix changes for UtBS S10 typo fix
[ci skip]
2018-04-24 09:00:06 -03:00
Iris Morelle
a2cfb3cf4c Run pofix for wesnoth-sota changes that were just fwd-ported to master
[ci skip]
2018-04-24 08:58:33 -03:00
Celtic Minstrel
3768dc687d Fix pofix
Two of these strings were not a fix, just a removed string, so no need for pofix.
The other was not specific enough for pofix to match unambiguously.
Also, someone forgot a comma somewhere, causing a syntax error.
2018-04-24 08:57:08 -03:00
Charles Dang
087d9bb5af Pofix entry for fc6c3ac04b
[ci skip]
2018-04-24 08:57:00 -03:00
Charles Dang
c638d71bf9 Pofix entry for b86a2968fe
[ci skip]
2018-04-24 08:56:53 -03:00
Charles Dang
9531e29b5d Pofix entry for ab9f29a7a4
[ci skip]
2018-04-24 08:56:40 -03:00
Iris Morelle
4d5a3de4e6 Revert "'moreso' isn't a word in any dialect of English."
This reverts commit fb866c6d13.

This fix is specific to master and translators aren't supposed to be
touching master at this time. There is no point to its existence.
2018-04-24 08:55:43 -03:00
Iris Morelle
70257c9af7 UtBS S10: Fix typo reported by zookeeper
[ci skip]
2018-04-24 08:46:51 -03:00
Iris Morelle
f6a369a1d0 THoT: Port prose punctuation fix from core
This is from commit 1340c005b3.

[ci skip]
2018-04-24 08:46:47 -03:00
ln-zookeeper
02ef3a6a99 UtBS: Remove old Naga Hunter portrait and use core Naga Fighter instead 2018-04-24 13:58:31 +03:00
ln-zookeeper
2bb16149af UtBS S08: Use Eloh's raged portrait variation when she gets angry 2018-04-24 13:58:30 +03:00
ln-zookeeper
8c2df1f18c UtBS: Wire in Nym's moody portrait variation 2018-04-24 13:58:29 +03:00
ln-zookeeper
71178e99f8 UtBS: Wire in Zhul's winged portrait variation 2018-04-24 13:58:28 +03:00
ln-zookeeper
ec63cff8fb UtBS: Fixed some missing/erroneous special notes 2018-04-24 13:58:28 +03:00
Charles Dang
a85b14cfb7 Various changelog updates
[ci skip]
2018-04-24 18:47:24 +11:00
Charles Dang
f17703a76f UtBS: initial set of new character portraits by LordBob (more to come)
[ci skip]

Nym's moody variant and Zhul's Shyde variant aren't wired in yet.
2018-04-24 18:28:23 +11:00
Nils Kneuper
28fc12ebd0 updated Slovak translation 2018-04-24 08:27:28 +02:00
Charles Dang
098bc1c0e8 Unit/Race: made use of std::array 2018-04-24 16:35:28 +11:00
Charles Dang
d2b3a25b9e Unit/Race: formatting cleanup 2018-04-24 16:05:05 +11:00
Charles Dang
c7b8694370 Unit: replace unit_ability_list::push_back with an emplace_back impl 2018-04-24 15:28:43 +11:00
Charles Dang
1749de1521 Units/Attack Type: moved the specials_context_t ctors to the more relevant file 2018-04-24 15:01:28 +11:00
Charles Dang
a1c440510c Unit/Attack Type: formatting cleanup 2018-04-24 14:57:40 +11:00
Charles Dang
0cdcfac5d3 Unit/Animation: emplace_back (mostly) ahoy
Three cases could not use emplace_back since the ctor they use is private... :(
Which sucks since unit_animation looks like it'd be a bit expensive to copy.
2018-04-24 14:56:54 +11:00
Nils Kneuper
b6f412fba1 updated Japanese translation 2018-04-23 23:40:15 +02:00
Nils Kneuper
b0f76a7d4d updated Japanese translation 2018-04-23 23:39:11 +02:00
Nils Kneuper
ff6aa075e5 updated Scottish Gaelic translation 2018-04-23 23:34:41 +02:00
Nils Kneuper
ce4d6bfea9 updated Spanish translation 2018-04-23 23:33:35 +02:00
Nils Kneuper
f3737d44ac updated Polish translation 2018-04-23 23:31:35 +02:00
Charles Dang
17da211d1f Fixup 1942627 2018-04-24 03:49:33 +11:00
Charles Dang
1942627052 Some refactoring of preferences-related hotkey info storage (fixes #2953)
This commit does a few things:

First, it moves the hotkey category names out of the preferences dialog and into
the more appropriate hotkey file. Each name is now properly mapped to its corresponding
category enum, so we don't have to worry about that anymore.

Second, it adds a new mapping of hotkey categories to commands so one can easily fetch
a list of hotkeys in a given category.

Third, it excludes categories with no hotkeys from the filter dropdown in the Prefs
dialog (this is the part that actually fixes the bug above).

This also includes a slight behavior change to hotkey type filtering. Previously, if a
hotkey's category didn't match any of the ones listed in the dropdown, that hotkey's
row visibility would be set to the toggle state of the first row in the filter dropdown.
Now it gets set to false.
2018-04-24 03:36:20 +11:00
Jyrki Vesterinen
4d569815d0 Fix rare crash in AI code
Reported in https://forums.wesnoth.org/viewtopic.php?p=626344#p626344

Regression from commit a3d5b9d603.

The crash occurred when
* the attacker had only one weapon
* the said weapon was disabled, and
    - the defender had no weapons
    - the defender had only one weapon, or
    - all defender's weapons were disabled
2018-04-23 19:30:55 +03:00
Severin Glöckner
8657fdb9a3 Dark Forecast: fix untranslatable string by
reusing the one from the Campaign Selection Menu

[ci skip]
2018-04-23 15:31:11 +02:00
loonycyborg
10122057e6 wesnothd: refuse to send whispers from observers to players in same game
wesnothd <= 1.12 did this too, this restores old behavior
2018-04-23 14:11:12 +03:00
Charles Dang
cb41d21423 UtBS: set campaign icon TC back to red
[ci skip]

Brown just didn't look great.
2018-04-23 17:10:01 +11:00
doofus-01
f871040a9d Kaleh base and two defense sprites 2018-04-23 17:08:38 +11:00
doofus-01
515af2f504 updates to Nym sprite and basic animations, and corrupt-elf sprite 2018-04-23 17:08:37 +11:00
Charles Dang
1f319e31fe Label Settings: minor code cleanup 2018-04-23 12:35:02 +11:00
Charles Dang
38e0b83cda Label Settings: formatting cleanup 2018-04-23 12:35:01 +11:00
Severin Glöckner
b8fe22877b Tutorial: fix two strings
This is one of the white on map messages
they never use punctuation characters for ending the instructions

Can't be pofixed.
[ci skip]
2018-04-23 01:11:15 +02:00
ln-zookeeper
221fe72dcb UtBS: Removed a remaining [on_redo]
Resulting problems reported on the forums, removal was apparently missed in df058356df.

[ci skip]
2018-04-23 10:04:06 +11:00
Iris Morelle
14ec9954f1 Replace a few instances of "mermen" with "merfolk" in core descriptions
These are only the ones were it's sufficiently unambiguous that the
description is referring to the merfolk race at whole. There are a few
instances I didn't touch were it's possible that the text refers
exclusively to mermen fighters (e.g. "the mermen armies").

See issue #2940.

[ci skip]
2018-04-22 17:42:44 -03:00
Iris Morelle
296894c515 Change the plural race name for merfolk to Merfolk
See issue #2940.

[ci skip]
2018-04-22 17:18:14 -03:00
Steve Cotton
eab86c3016 Tutorial: fix the overall translation hint comment
The comment at the start of 01_Tutorial_part_1.cfg wasn't immediately
before a string, so the hint for translators wasn't in the file that
goes to the translators. Fix it so that the tutorial shows working
usage of "# po:" style comments; this is probably more help to people
using the tutorial as a reference for WML, rather than the translators
themselves.
2018-04-22 15:52:43 -04:00
Severin Glöckner
3456b0a9cb Tutorial: remove forgotten bracket and superfluous space
[ci skip]
2018-04-22 20:37:14 +02:00
Celtic Minstrel
59e734615d Add translation hints for the village and terrain feature name generators 2018-04-22 14:23:19 -04:00
Nils Kneuper
25e3526a1f updated Czech translation 2018-04-22 09:21:00 +02:00
pentarctagon
5b94101975 Allow specifying a sanitizer with cmake. 2018-04-21 19:51:49 -05:00
Victor Sergienko
16cd19873d #2782 Crash when using composing like ˇ and ' in lobby on macOS.
Some backstory: https://github.com/wesnoth/wesnoth/pull/2644#issuecomment-382298822
2018-04-22 01:04:55 +11:00
Gunter Labes
616fdf3498 Detect disconnect when waiting on data from server
Fixes issue #2927.
Also shows that issue #2925 still results in a disconnect but the client
does not get stuck anymore at least.
2018-04-21 15:28:38 +02:00
Gunter Labes
6dd3223249 Fix debug message
This outputs the config not the number of read bytes.
The recv_queue_.back() call was also missing lock protection.
2018-04-21 15:28:37 +02:00
loonycyborg
99372123da wesnothd: always wait for next login attempt after login fail 2018-04-21 15:57:53 +03:00
Charles Dang
2ec5c6ee5c Cleaned up more unnecessary includes 2018-04-21 23:19:55 +11:00
Martin Hrubý (hrubymar10)
783738b2f5 Remove rest of Growl things which I forgot before 2018-04-21 13:06:08 +02:00
Charles Dang
f8b936c2d5 Revert "Attempt to fix infinite loading screen if server restarts during MP login"
This reverts commit 8a00056a22. This fix did not work,
and there's a proper one on the 1.14 branch that needs to be forward-ported
(a3243bb535).
2018-04-21 20:39:36 +11:00
pentarctagon
4157251f11 Enable building with mysql support on travis. 2018-04-21 04:31:53 -05:00
pentarctagon
96c41271d8 Print the value of STRICT and build_timeout. 2018-04-21 01:32:21 -05:00
pentarctagon
63ff641662 Adds the opt/OPT option to scons/cmake.
Travis now also makes use of this to set the optimization level for the -O0 builds, rather than extra_flags_*.  This additionally fixes an issue where using -O0 in the release build with LTO resulted in the individual *.o files being compiled with -O0, but LTO then still linked with release's default -O3.
2018-04-21 01:32:21 -05:00
Charles Dang
7241561554 Animated: simplified template stuff
Just... why was T_void_value a thing.
2018-04-21 16:04:16 +11:00
Charles Dang
8a00056a22 Attempt to fix infinite loading screen if server restarts during MP login
See #2927.
2018-04-21 14:12:25 +11:00
gfgtdf
3797837c74 fix handling of no_leader= (again)
previously, if people wanted to make use of mp leader selection in mp
campaign they had to sxplicitly set no_leader=no and faction_lock=no,
with the new code its clear that no_leader= is just an alias for
faction_lock with type
2018-04-21 04:29:33 +02:00
Severin Glöckner
8b492a3ab4 Tutorial: Button was renamed, update text accordingly
[ci skip]
2018-04-21 00:44:54 +02:00
Nils Kneuper
a8bc181b2b updated German translation 2018-04-20 23:33:50 +02:00
Nils Kneuper
7174b8e97d updated Czech translation 2018-04-20 23:32:35 +02:00
Charles Dang
d6718cd1f9 Cleaned up game_board.hpp and some related includes
Includes a minor cleanup of the Game Stats dialog to not use a game_board reference.
Dunno why I was taking a game_board reference in the show() function anyway... the
class held a display_context reference and didn't use any functions exclusive to
game_board.
2018-04-20 17:36:27 +11:00
Charles Dang
e05b1368ad Used display_context::get_team in a few places I missed 2018-04-20 17:23:03 +11:00
Charles Dang
4818312150 Display: renamed get_disp_context to current_display_context
This is to avoid confusion with filter_context::get_disp_context. display used to
inherit from filter_context, but that was refactored out a while back. I left
get_disp_context since it was used and useful, but I realize now it causes more
confusion than not.

Also converted help::load_terrain_types_data to use get_map() directly since I
noticed it.

And changed a stray use of `thedisp` to `disp` in unit_drawer. Doesn't do anything
but it was bugging me.
2018-04-20 17:00:40 +11:00
Charles Dang
a532cc4689 Unit/Abilities: formatting cleanup 2018-04-20 16:37:08 +11:00
Charles Dang
7e442cbb54 Units: refactor display_context parameter out of ability functions
This was essentially only needed for the affects_side() helper. THAT'S IT. All this code just for
one single line... Anyway...

Utilized the display singleton's display_context getter instead. This also means fewer explicit
uses of resources::gameboard as the display_context object, meaning more compatibility with the
editor (not that that's relevant for most of the changed usecases, such as the AI, but it does
affect unit::get_abilities, which might be useful there in the future).

This also removes the display_context parameter from unit::invisible() since it was only passed to
unit::get_ability_bool().

unit::is_visible_to_team() also had its display_context parameter removed. It was used once as an
argument for invisible() and the other case was replaced with display::get_map().
2018-04-20 16:06:19 +11:00
Charles Dang
882aba3349 Units/Display: minor code cleanup 2018-04-20 15:28:42 +11:00
Charles Dang
c7ad8153c7 Units/Display: formatting cleanup 2018-04-20 15:17:49 +11:00
Charles Dang
dab8498f97 Wesnothd/Player: removed unused selective_ping member 2018-04-20 14:36:08 +11:00
Charles Dang
b81a702cfa Removed unused Ping Timeout preference
It no longer had any effect. The selective_ping flag is set was ignored by the
server since it now utilizes TCP keepalive.
2018-04-20 13:07:36 +11:00
Charles Dang
6b359268f0 changelog entry for the UtBS portraits
[ci skip]
2018-04-20 12:01:04 +11:00
Charles Dang
efa798c72e UtBS: wmlindent pass
[ci skip]
2018-04-20 11:39:09 +11:00
Charles Dang
4153b6e8bc UtBS: renamed the Quenoth Sun Sylph's unit and image files to match her type
[ci skip]

Sun Sylph is the proper name, but some files were labeled Sun Shyde.
2018-04-20 11:35:35 +11:00
Charles Dang
755fe70cc9 UtBS: removed unused Quenoth Moon Singer and Quenoth Moon Shyde units
[ci skip]

These were part of an early iteration of the faction design but we decided against
the sun/moon motif.
2018-04-20 11:28:23 +11:00
Charles Dang
eec212e155 UtBS: added new Quenoth faction portraits by LordBob 2018-04-20 11:19:59 +11:00
Charles Dang
e583c470be Display: cleaned up overlay map getter interface
Instead of a pointer to a member of a derived class, used a virtual function implemented
in both derived classes (game_display and editor_display) that return an reference to the
appropriate object.

Also removed the overlay.hpp include from display.hpp. We can forward-declare the overlay
struct.
2018-04-20 10:48:39 +11:00
Severin Glöckner
f0f664b636 Fix misplaced </span> tag 2018-04-20 01:31:28 +02:00
Severin Glöckner
beaddeee64 Revert "tutorial: add translation note"
This should be addressed another way, not with a translation hint

This reverts commit 7a020c3130.
2018-04-20 01:29:35 +02:00
Charles Dang
f2a870b97c Game Display: removed unused variable
No idea what this did. It was added 11 years ago (9f11735f32)
but became unused at some point.
2018-04-20 10:23:43 +11:00
Nils Kneuper
767c9aa101 updated Scottish Gaelic translation 2018-04-19 21:41:03 +02:00
Charles Dang
3792612fb7 Removed OpenMP-related code
After some discussion, we concluded that this code was unmaintained, not even used in
some places (display.cpp, units/frame.cpp), leaving the only area that really used it
at all the image surface cache. Considering there was never really a conclusive benchmark
of its benefits and because said surface cache will be used a lot less going forward,
we're just removing it and simplifying everything for everyone.

Closes #1260 since it's now irrelevant.
2018-04-19 23:06:04 +11:00
pentarctagon
f4db76fe0f Re-add boost-thread to INSTALL and changelog. 2018-04-19 03:21:04 -05:00
pentarctagon
135921ad10 Re-add boost-thread.
Also add in opengl packages while I'm at it.
2018-04-19 02:51:58 -05:00
Nils Kneuper
5bb1089abc updated German translation 2018-04-19 08:19:21 +02:00
Charles Dang
9148ce2b99 UtBS: fixed some opaque shadows on rider units due to indexed pngs
[ci skip]
2018-04-19 11:23:43 +11:00
Iris Morelle
fa15142150 gui2/title_screen: Make Version label formatted and translatable
Closes #2914.

This doesn't break the string freeze since it reuses a format string
from the same textdomain required by gui2/game_version for the exact
same purpose.
2018-04-18 21:16:14 -03:00
Charles Dang
42e69ee483 UtBS: improved the Quenoth Flagbearer's flag
[ci skip]
2018-04-19 11:14:14 +11:00
Nils Kneuper
ef7c0a7b64 updated Slovak translation 2018-04-18 21:54:07 +02:00
loonycyborg
c51065e39c Fix build against static libboost 2018-04-18 15:42:29 +03:00
Martin Hrubý (hrubymar10)
5c8e957355
Fix Xcode project after a02100a0f1 2018-04-18 11:15:33 +02:00
Charles Dang
44feb05ae0 Attempt to fix tests
Fixup a02100a0f1.
2018-04-18 16:06:29 +11:00
Charles Dang
c085c380f6 Loading Screen: rethrow exception if worker thread creation fails 2018-04-18 15:37:39 +11:00
Charles Dang
baab5a8156 Loading Screen: temporarily disable animation rate limiter
Seems to make the loading screen progress faster and gets rid of the weird issue
where the animation sometime wouldn't show up on game launch. Odd.
2018-04-18 15:16:13 +11:00
Severin Glöckner
7a020c3130 tutorial: add translation note
[ci skip]
2018-04-18 05:40:30 +02:00
Charles Dang
be4b2c246f Random formatting cleanup I had sitting around 2018-04-18 13:52:39 +11:00
Charles Dang
86b3e6959b Loading Screen: refactor and clean up implementation
This covers several things:

Instead of creating a new worker thread manually and having it set class member state flags,
I instead utilized std::future and std::async. As far as I can tell, this should avoid the
(albeit unlikely) potential race condition wherein the ls could close before loading at all
if the thread was delayed in starting.

Removed the timer interface and split it into two components:
* A drawing callback that handles the animation. This has its granularity retained at 100 ms,
  but can be easily adjusted if we want it to go faster.
* A pump monitor that runs much more frequently (every time events::run_event_loop is called,
  technically). This handles checking the state of the std::future object and will then close
  the window. This makes the loading screen a bit speedier compared to the previous iteration
  since it no longer wastes time waiting for the next timer callback to close.

The one bit I'm not 100% sure about is the check for the future object's ready state in the dtor.
Though, relatedly, I wonder if perhaps we should wait for the worker thread to complete in that
case instead of exiting....

Also shuffled a few things around, such as immediately setting enter/esc disabled in pre_show
instead of waiting for everything there to finish.

Do note there occasionally seem to be a few odd issues with the dot animation after this commit.
Will look into that. But it may be some texture cache-related issue...

This also cleans up some unused log defines and a VS 2013 conditional include.
2018-04-18 13:52:07 +11:00
Iris Morelle
fc88cdff3b Fix segfault when trying to log into the MP server with an empty password
Probable regression introduced in commit
02ab29d2f1 (1.13.14).
2018-04-17 22:09:23 -03:00
Charles Dang
a7e1ff85ed Fixup c57a175fee
Turns out remove_const alone only removes the const from the pointer, not from the type
itself, so the expression wasn't returning true. This strips the pointer out before removing
const and matches against char instead of char*
2018-04-18 10:35:26 +11:00
Jyrki Vesterinen
fc3ca7a783 Changelog entry for commit a02100a0f1 2018-04-17 22:31:40 +03:00
Jyrki Vesterinen
a02100a0f1 Implement saving MP chat message history (#1194, #2802) 2018-04-17 22:29:26 +03:00
Charles Dang
28b1ab2861 Revert "Utilized 2x xBRZ scaling for portraitless units in game dialog"
This reverts commit 601c67d970 and 98ed802290.
2018-04-18 01:59:28 +11:00
Charles Dang
c57a175fee Lexical Cast: remove use of boost::mpl
The code was checking that the From type was either char* or const char*. Replaced it
with an equality check against char* with the const stripped from From so both match.
2018-04-18 01:40:26 +11:00
Charles Dang
1ec2de449e Revert some changes from 0b45363 I didn't mean to commit 2018-04-17 22:00:12 +11:00
Charles Dang
0b45363c95 GUI2: finished refactoring out usage of boost::mpl
dispatcher::has_event called the private find() function, which after a whole bunch of
jumping around essentially checked that the signal queue for the given event was not
empty. This was a run-time op, yet the code was set up using SFINAE in order to for
has_handler::oper() to call the event_signal function corresponding to the event's queue
(ie, the mouse queue for a mouse-type event).

Since this code was written before the era of constexpr, event type validation was done
using boost::mpl, which, in this case, resulted in a monstrous amalgamation of build-time
template specialization for a run-time check. I'm not certain, but I believe it might
have resulted in an specialization of find() (or at least, implementation::find()) for
every single event type (each member of the ui_event enum).

This converts the code to a purely run-time check and throws out all the template stuff.
It also removes the relevant event_signal overload dealing with events in a set. The
version dealing with function types is preserved as it's used in the fire_event()
implementation and is a fairly standard usecase of SFINAE.

The has_handler class has also been converted to a static function since it's no longer
needed for template specializations in find().

And finally, is_raw_event had to be renamed to is_raw_event_event to allow simple name
completion in IMPLEMENT_RUNTIME_EVENT_SIGNAL_CHECK. I could have also renamed the raw event
queue to signal_raw_queue but I figured keeping the name as signal_raw_event_queue made
its purpose clearer.
2018-04-17 21:52:28 +11:00
pentarctagon
dd4b525c40 Make the C++17 build fail on warnings. 2018-04-17 02:36:14 -05:00
pentarctagon
fed813ef34 Revert "String View: use std::string_view on C++17 (untested)"
This reverts commit 00d87f8fe4.
2018-04-17 02:36:14 -05:00
pentarctagon
479d5fd01f Revert "Expand and fixup 00d87f8"
This reverts commit 52a516cfb7.
2018-04-17 02:36:14 -05:00
pentarctagon
298f1dc9c1 Attempt to fix UNUSEDNOWARN travis+gcc warnings. 2018-04-17 02:36:14 -05:00
pentarctagon
5dd5b6ec0b Attempt to fix travis error. 2018-04-17 02:36:14 -05:00
pentarctagon
33ad6be326 Adds a c++17 build using the pre-release Ubuntu 18.04.
Though given 00d87f8fe4 I would say this is better than nothing.
2018-04-17 02:36:14 -05:00
Iris Morelle
6d5f5d4299 campaignd: Remove last remaining trace of the master_password functionality 2018-04-17 02:42:38 -03:00
Iris Morelle
7d5d7ee7d4 campaignd: Add 'hide'/'unhide' control FIFO commands and hidden= attribute
These are used to hide an add-on from listings and deny the author the
ability to upload or delete it or change its passphrase. This is
meant to be used when enforcing add-ons server rules that do not justify
deleting all of the add-on's metadata (for example, issues with icons or
descriptions).
2018-04-17 02:42:15 -03:00
Iris Morelle
0475c349b8 campaignd: Add 'delete' control FIFO command 2018-04-17 02:42:02 -03:00
Iris Morelle
957be8b53e campaignd: Refactor add-on deletion code into its own method
This changes the order in which the hook_post_erase hook (currently
unused in production and fully untested) is fired so it will be run
*before* displaying the confirmation message to clients. This might need
to be changed at a later point if the hook functionality ever gets used
again, but for now it'll do.
2018-04-17 02:39:56 -03:00
Charles Dang
98ed802290 Fixup 601c67d970
Turns out that commit broke TC on unit images in messages since it broke the equality
check in lua_unit.cpp. Added the XBRZ IPF as part of the Lua unit portrait attribute
instead.

I *think* this is the proper place to do it.
2018-04-17 10:15:55 +11:00
Charles Dang
54cacf815d Changelog entry for 30257af
[ci skip]
2018-04-17 05:07:07 +11:00
Jyrki Vesterinen
76ed49a45f [heal_unit]: ensure that heal amount is an integer 2018-04-16 20:55:23 +03:00
Jyrki Vesterinen
f2284e2e79 Revert "Display amount healed as an integer in [heal_unit]"
This reverts commit 0294bd81b2.

Changing display is unnecessary when the healed amount itself is forced
to be an integer (next commit).
2018-04-16 20:54:20 +03:00
Charles Dang
601c67d970 Utilized 2x xBRZ scaling for portraitless units in game dialog 2018-04-17 03:03:09 +11:00
Severin Glöckner
ae0420108f finish renaming of the Horseman to Pathfinder
forward ported from 1.14, but without unit type alias

[ci skip]
2018-04-16 15:40:19 +02:00
Charles Dang
30257afd3f Drop Down Menu: allow right clicks to dismiss the window (fixes #2910) 2018-04-16 21:10:30 +11:00
Celtic Minstrel
0294bd81b2
Display amount healed as an integer in [heal_unit] 2018-04-16 01:27:12 -04:00
Celtic Minstrel
7821f470c2 fixup! Support location_id in [recall] and [unstore_unit] 2018-04-16 00:55:55 -04:00
Celtic Minstrel
ea6578a87a fixup! Support location_id in [recall] and [unstore_unit] 2018-04-16 00:49:28 -04:00
Celtic Minstrel
ecc8785edb Support location_id in [recall] and [unstore_unit] 2018-04-16 00:00:51 -04:00
Celtic Minstrel
ceea173eb4 Remove redundant unused column in stats 2018-04-15 14:04:31 -04:00
Celtic Minstrel
ddd3222b3d Swap count and name columns in statistics (fixes #2893) 2018-04-15 13:58:01 -04:00
Nils Kneuper
6e85da54bc updated French translation 2018-04-15 19:49:54 +02:00
Nils Kneuper
c359b7a829 updated Galician translation 2018-04-15 11:20:32 +02:00
loonycyborg
2e24d20236 wesnothd: Fix UB caused by incorrect use of simple_wml::set_attr 2018-04-15 10:34:58 +03:00
Celtic Minstrel
0327085d99 Fix two of the dialog functions not accepting translatable strings 2018-04-15 02:03:31 -04:00
Iris Morelle
0720065d7a Remove stale include in test scenario causing errors 2018-04-15 02:50:37 -03:00
Iris Morelle
529e551d9e Changelog entry for MP lobby message fixes
[ci skip]
2018-04-15 02:49:19 -03:00
Iris Morelle
47b6b7f2a4 wesnothd: Use actual username when sending lobby messages too 2018-04-15 02:42:25 -03:00
Charles Dang
03d80a0b2b Better changelog entry for the MP password fix
[ci skip]
2018-04-15 15:16:16 +11:00
ln-zookeeper
cc4171e207 UtBS: Removed obsolete slows note from Quenoth Scout
[ci skip]
2018-04-15 13:49:01 +11:00
Celtic Minstrel
0f267d0ede Fix #2894 2018-04-14 21:09:40 -04:00
loonycyborg
f5ab654760 wesnothd: made server fill in sender when forwarding whispers 2018-04-15 03:40:32 +03:00
Severin Glöckner
5e1f6af8dd utbs: replace true by yes
[ci skip]
2018-04-14 21:25:32 +02:00
Severin Glöckner
2e8f6c2a79 utbs: change traits for higher unit types too,
because they are nowadays displayed in the help.
Also keep them sorted the same way as usual.

[ci skip]
2018-04-14 21:25:32 +02:00
Severin Glöckner
ea656a8cc7 remove movetypes and abilities only used by old desert elves
[ci skip]
2018-04-14 21:25:32 +02:00
ln-zookeeper
33e924dc35 Updated changelog
[ci skip]
2018-04-14 19:24:51 +03:00
Celtic Minstrel
8e4de9db67 Editor: Refresh named locations list when map context changes (fixes #1023)
This solution is a bit of a hack, but odds are this code will be
majorly refactored in 1.15 anyway. The important thing is that
this works.
2018-04-14 12:05:41 -04:00
Charles Dang
35590fd842 Lobby Info: filter on game name first
It's more common to want a name.
2018-04-15 02:53:01 +11:00
Charles Dang
227c8ba20c Changelog entry for ab54b62
[ci skip]
2018-04-15 02:40:30 +11:00
Charles Dang
ab54b62553 Attempt to fix non-required era being flagged for download
See #2747.
2018-04-15 02:02:14 +11:00
Charles Dang
29fcbd053d Replaced round_double and round_portable with std::round
std::round(double) uses the desired half-away-from-0 method.
2018-04-15 01:45:18 +11:00
newfrenchy83
606981bd22 Update wesnoth.cbp (#2890) 2018-04-14 14:58:08 +03:00
Charles Dang
7621719c9a CVideo: added a macOS codepth for DIP fetch in screen_area() 2018-04-14 22:12:58 +11:00
Charles Dang
dbb56599c5 GUI2/Canvas: consolidate set_width and set_height into a single function
This is to enable me to do some testing with high DPI support.
Also there's never a situation where you'd only want to set one of these.
2018-04-14 21:15:53 +11:00
Charles Dang
c43f801aff Fixup 66dc671 (fixes #2887)
These changes somehow got lost in rebase...
2018-04-14 20:45:29 +11:00
Charles Dang
66dc67140f CVideo: removed "help string" interface
These will be handled by GUI2 tooltips once we get the editor all converted to
the new UI system.
2018-04-14 20:25:36 +11:00
pentarctagon
7aeca70cb0 Allow setting c++17 in scons. 2018-04-14 11:39:20 +03:00
pentarctagon
5d970e40cd Add a check to fail the job if compiling takes too long.
The intent behind this is that, if there most likely wouldn't be enough time left to complete the unit tests anyway, then just fail the job after compiling so the cache can be updated.  Otherwise, if the unit tests were run and the job timed out, then the cache would not be uploaded at all and the next time the job ran it would be from scratch again.
2018-04-14 11:39:20 +03:00
pentarctagon
92f74c39f6 Allow setting a sanitizer to use.
Note: UBSan at least does seem to take a fairly significant amount of extra time to compile and run the WML tests with.
2018-04-14 11:39:20 +03:00
pentarctagon
2ed9d2c0c4 Allow setting EXTRA_FLAGS_RELEASE to something other than -O0. 2018-04-14 11:39:20 +03:00
pentarctagon
66caa190f6 Make LTO controllable via travis env variable. 2018-04-14 11:39:20 +03:00
Charles Dang
52a516cfb7 Expand and fixup 00d87f8 2018-04-14 17:25:19 +11:00
Charles Dang
9977addd64 Removed duplicate config_key_type alias
This isn't used in config_attribute_value.*pp but rather in config.*pp.
2018-04-14 17:25:14 +11:00
Martin Hrubý (hrubymar10)
9329daf0da
Fix Xcode project after d384b96d97 2018-04-14 07:19:37 +02:00
Charles Dang
96681151f0 Expand NORETURN, enable C99 unconditionally on MSVC
[[noreturn]] is supported on all the compilers we support. Still need to decide
the exact minimum versions and figure out what to do with DEPRECATED and FALLTHROUGH,
so leaving those for now.

And since we require VS 2015 and up we can enable C99 unconditionally.
2018-04-14 16:04:16 +11:00
Charles Dang
00d87f8fe4 String View: use std::string_view on C++17 (untested) 2018-04-14 16:04:03 +11:00
Charles Dang
17fc9d71db Removed bind_void
This is no longer needed with the compilers we support. It is needed on VS 2013, but
we dropped that. Don't know when GCC or Clang stopped needed it (if they ever did).

I'm guessing the "function that returns a value cannot be bound in a function type
that returns void" behavior wasn't an intentional design. Additionally, I don't believe
point 1 raised in the accompanying comment has ever been true... if so, pretty sure
we wouldn't have been able to build at all.

Also removed unnecessary global.hpp include from functional.hpp.
2018-04-14 15:53:13 +11:00
Charles Dang
07b69bdd32 Updated VS projectfile
[ci skip]
2018-04-14 15:17:00 +11:00
Charles Dang
164b6af766 Cleaned up even more joystick-related code... 2018-04-14 14:56:34 +11:00
Charles Dang
50407c1e8e Cleaned up some joystick-related code I missed (fixup d384b96) 2018-04-14 14:33:56 +11:00
Charles Dang
d384b96d97 Removed joystick code
This was never fully implemented and has been essentially abandoned. If we want to
add this again, we should look to adding full game controller support (Steam controller,
for example), though I don't know how suited this game is for controller support. As for
as I can tell, the only working part was ever map scrolling.

Includes a sqrt -> std::sqrt conversion I forgot in this file awhile back.
2018-04-14 14:16:18 +11:00
pentarctagon
52f8e8233c Remove boost-thread from dockerfile. 2018-04-13 17:14:08 -05:00
Martin Hrubý (hrubymar10)
6314c6ab05
Remove Boost thread from Xcode project 2018-04-14 00:09:25 +02:00
Martin Hrubý (hrubymar10)
68c1dbeab2
Update link to new MacCompileStuff repo 2018-04-13 22:51:34 +02:00
Nils Kneuper
cff478f9d3 updated Polish translation 2018-04-13 22:49:56 +02:00
Nils Kneuper
6034cc50d1 updated Italian translation 2018-04-13 22:48:49 +02:00
Jyrki Vesterinen
c5802cdcda Changelog entry for commit 82e04ab761 2018-04-13 22:51:15 +03:00
Jyrki Vesterinen
82e04ab761 Fix #2850: [modify_side] share_vision=yes doesn't do anything
Thanks to @gfgtdf for the suggested fix that works well.
2018-04-13 22:49:51 +03:00
Charles Dang
9de7aff904 Removed Boost Thread as a built-time dependency
We use std::thread now.
2018-04-13 23:55:25 +11:00
Charles Dang
7cf9341379 Removed last boost/thread.hpp include
Locale doesn't rely on boost, so it must have been some other issue in Boost 1.60
that was incidentally fixed by including that file. If anyone ever happens to build
with 1.60 again we can revisit this.

For the record, there are no issues with VS 2017 and Boost 1.66.
2018-04-13 23:52:56 +11:00
loonycyborg
846bf8f208 Fix "host networked game" option
It was broken by b95c9996bf because
ignoring SIGCHLD makes it impossible to query exit status of wesnothd
subprocess. Fix this by spawning a thread to wait for the browser
instead of ignoring SIGCHLD.
2018-04-13 15:45:19 +03:00
Charles Dang
593e673734 Shot-in-the-dark attempt to fix the tests 2018-04-13 23:28:44 +11:00
Charles Dang
802bbe8cdc Game Load: added a convenient button in Load Game to open your saves folder 2018-04-13 18:21:35 +11:00
Severin Glöckner
469488d981 update 2nd stunned event as well with additions from 1.13.2
[ci skip]
2018-04-12 22:27:26 -04:00
Charles Dang
90d45dcf07 ANL: removed unused macro (closes #2878)
[ci skip]
2018-04-13 11:49:57 +11:00
Charles Dang
fee641516b Fixup 7767902 2018-04-13 10:49:38 +11:00
Charles Dang
7767902261 Update tests for acc3fe8
We can just use a wesnothd_connection object directly here.
2018-04-13 10:42:39 +11:00
Charles Dang
acc3fe8906 Refactor out custom wesnothd_connection_ptr class again
I originally did this in 699047766a and then reverted it in
08a866dc20 due to @gfgtdf pointing out the object was never
actually destroyed since io_service::stop was never called (issue #1927).

This new method foregoes the custom wrapper class and instead waits for the worker thread
to terminate in the wesnothd_connection dtor. The use of the wrapper class is also why using
thread::detach alone worked (@jyrkive) and using join did not.

Additionally, the ptr alias is now of a unique_ptr instead of a shared_ptr.

I have verified that the connection dtor is actually called. This new method makes it clearer
what's actually going on.
2018-04-13 10:24:25 +11:00
Severin Glöckner
533c7e9822 remove unneded keys
[ci skip]
2018-04-12 22:10:08 +02:00
Severin Glöckner
7d427aedee INSTALL had been renamed to INSTALL.md
[ci skip]
2018-04-12 21:43:39 +02:00
Jyrki Vesterinen
8667e5bbdd Hotkey manager: drop duplicate commands
We use both SDL_KEYDOWN and SDL_TEXTINPUT events for hotkeys. It's possible
for both events (caused by the same keypress) to trigger the hotkey command
and we don't want that. Hence, let's drop duplicate commands.

Fixes #1736.
2018-04-12 19:46:56 +03:00
Charles Dang
2edcbdced8 Convert uses of boost::thread to std::thread
Also covers uses of boost::this_thread.

Turns out std::thread calls std::terminate if it's destroyed while still joinable.
thread::detach needs to be called or else the program will crash.

There's also no standard library equivalent of boost:🧵:timed_join so I just
replaced it with the is_worker_running_ variable.
2018-04-13 01:08:41 +11:00
loonycyborg
19d9e150e1 Fix issue #1757: prevent abnormal termination if failed to bind address 2018-04-12 14:30:45 +03:00
Iris Morelle
cfd5d5289d Update changelog
[ci skip]
2018-04-12 06:15:19 -03:00
Iris Morelle
8c97458a76 Add team colouring to some Aethermaw props missing it
[ci skip]
2018-04-12 06:04:29 -03:00
Celtic Minstrel
191c23c194
Update changelog.md 2018-04-11 22:51:32 -04:00
Celtic Minstrel
b062b19e10 Add [move_unit]clear_shroud= as an attempt to clear shroud as the unit moves (untested) 2018-04-11 22:46:48 -04:00
Celtic Minstrel
68b33cf6bd Allow [move_unit]dir= to perform relative movements 2018-04-11 22:46:48 -04:00
Celtic Minstrel
622db9d08b Allow [move_unit]to_location to take a list of waypoints 2018-04-11 22:46:48 -04:00
Charles Dang
3d71caff38 TRoW: removed old, now-unused story art
[ci skip]
2018-04-12 13:19:01 +11:00
ln-zookeeper
eaf186e021 TRoW: New set of story art by LordBob
In scenarios 06 and 14 I turned the opening narrator message into story text instead. The image for 03 isn't used yet as there's no text to accompany it.
2018-04-12 12:21:51 +11:00
Iris Morelle
0610b48d7e Fix test scenario references to Kaleh's WML
This is required after commit cbedd09ec2.
2018-04-11 22:06:40 -03:00
Celtic Minstrel
8f6613ea09 Fix #2745 2018-04-11 21:05:31 -04:00
Celtic Minstrel
bf70d50b80 Fix #2875 2018-04-11 21:03:24 -04:00
Iris Morelle
7f8cb13bd3 help: Use new attack stats separator in unit descriptions
Closes #2873.

(This is part of a commented-out block in master because Vultraz hasn't
updated the code yet. He said I could forward-port the patch into it
anyway. For the time being unit descriptions are just completely missing
because of this.)
2018-04-11 22:02:14 -03:00
Nils Kneuper
90dba93784 updated Czech translation 2018-04-11 21:39:25 +02:00
Nils Kneuper
7ab1da24a5 updated Galician translation 2018-04-11 20:33:02 +02:00
Nils Kneuper
5f201e17f0 updated Chinese (Simplified) translation 2018-04-11 20:27:59 +02:00
Jyrki Vesterinen
934f0326d8 Revert "Fix #1736: on GNU/Linux, a hotkey can trigger multiple commands"
This reverts commit c42401a8de.

As @CelticMinstrel pointed out, that commit made it impossible to input characters which require
AltGr to type (e.g. @, € and $ in Finnish keyboard).

Reopens #1736.
2018-04-11 18:58:15 +03:00
Jyrki Vesterinen
2562a7e3b0 Revert "Changelog entry for commit c42401a8deb92acc16039fbeed0acf16287e286c"
This reverts commit c23fc2b666.
2018-04-11 18:57:59 +03:00
Charles Dang
607bc4c935 Fixup 4b6e547 because apparently I cannot write
[ci skip]
2018-04-11 17:43:47 +11:00
Charles Dang
4b6e5478be Fixup a1810bde32 (better comment)
[ci skip]
2018-04-11 17:40:58 +11:00
Charles Dang
1068ca128c UtBS: removed old Desert Elves and accompanying scenarios and loading code
[ci skip]

Also fixed the campaign icon to use the new Kaleh sprite instead of the old one.
2018-04-11 14:38:02 +11:00
Celtic Minstrel
7661c655b0 Fix gender-dependent strings in SotA involving the kids 2018-04-10 22:23:04 -04:00
Celtic Minstrel
04d51a4b17 Fix #2848 2018-04-10 22:23:02 -04:00
Celtic Minstrel
b46381c83a Fix #2857 2018-04-10 22:23:01 -04:00
Charles Dang
a1810bde32 Game Events/Manager: skip disabled assertion if write_events is called mid-event
This reverts afaa75842c and replaces it with a more general
no-assert-during-events check. This is because there are other instances besides [inspect]
where this function can be called mid-event, and it wouldn't be convenient to add nested
'strict' parameters to multiple functions just to handle them.

Fixes #2750.
2018-04-11 13:08:27 +11:00
Charles Dang
b0f767bdb5 Changelog entry for 79072b7c3d
[ci skip]
2018-04-11 11:52:01 +11:00
Charles Dang
1c8b508777 Connect Engine: attempt to fix fallback user team name not being translated
See #2863.
2018-04-11 10:46:51 +11:00
Charles Dang
275057df59 Gettext: used [[maybe_unused]] for UNUSEDNOWARN on C++17 2018-04-11 10:46:45 +11:00
Charles Dang
a4dd74c32a MP Create Game: fixed campaign player numbers label being untranslatable
Fixes #2861.

Also changed the logic for when the "min to max" label is shown from != to >.
2018-04-11 10:14:45 +11:00
Jyrki Vesterinen
c23fc2b666 Changelog entry for commit c42401a8de 2018-04-10 19:08:10 +03:00
Jyrki Vesterinen
c42401a8de Fix #1736: on GNU/Linux, a hotkey can trigger multiple commands
SDL_TEXTINPUT events aren't generated on Windows when Alt is held down.
Let's ensure that the behavior is the same on all platforms.
2018-04-10 19:05:40 +03:00
Charles Dang
15fdabbac9 Removed now-unused storage of team colors in the image namespace
Was used by ~TC(). That now uses the team class color helpers.
2018-04-10 21:20:36 +11:00
Charles Dang
c446e679f0 IPFs: simplify ~TC() implementation
This results in the same behavior as before (default color outside a scenario, side's
chosen color during one) and is more consistent with other places in the code. They
both end up accessing `game_config::team_rgb_range` anyway, this is just in a slightly
more roundabout way.
2018-04-10 21:02:48 +11:00
Charles Dang
325691107a Spritesheet Generator: implemented multi-thread image loading
This results in a rough performance increase of anywhere from 30% - 50%.
2018-04-10 17:00:23 +11:00
Charles Dang
f9e44ea282 Spritesheet Generator: simplified intermediate surface data storage 2018-04-10 13:48:12 +11:00
Charles Dang
d6ee95c763 Spritesheet Generator: simplified sheet height calculation 2018-04-10 13:19:38 +11:00
Jyrki Vesterinen
134a51204b Convert README for manual images to Markdown
I also updated the filenames for the images, changed the recommended
format for screenshots other than "fullscreen" screenshots to PNG,
and removed the (no longer true) claim that the example places to create
the screenshots match where the English screenshots were taken.

Resolves #2856.

[ci skip]
2018-04-09 21:53:09 +03:00
Nils Kneuper
fd4f36e3c9 updated Chinese (Simplified) translation 2018-04-09 20:11:23 +02:00
Charles Dang
f7d2924b27 Added initial implementation of a dynamic spritesheet generator
This isn't used anywhere yet. Right now it only takes a directory and generates one
sheet for all the images in that directory and its sub-directories. The sheets are
fully-functional textures, and a path -> rect mapping exists, but I haven't added anything
that uses it yet.

This will definitely need some improvements and changes to properly integrate with @jyrkive 's
OGL work.
2018-04-10 03:03:56 +11:00
Sofartin
769f102f2e Add new packager 2018-04-09 10:35:17 +02:00
Celtic Minstrel
81b4ef1d7c Update changelog
[ci skip]
2018-04-08 14:00:23 -04:00
Celtic Minstrel
46c46b5548 Add u and v variables to pixel_callable
It's currently calculated from x,y and w,h, but with the switch to shaders
this situation could be reversed to calculate x,y from u,v and w,h
2018-04-08 13:56:25 -04:00
Charles Dang
dba3d409fc MP Staging: made the faction select button about as prominent as you can get
[ci skip]

Thanks to grzywacz for pointing out the possible use of the unit icon.
2018-04-09 00:22:42 +11:00
Charles Dang
7942b53ee8 Changelog entry for recent SotA fixes
[ci skip]
2018-04-08 22:30:32 +11:00
Charles Dang
57c797d516 SotA S8: fixed inconsistent Ghost name (fixes #2846)
[ci skip]

The dashed version is used in prior scenarios.
2018-04-08 22:25:09 +11:00
Charles Dang
565c4dbf60 SotA S7: fixed inconsistent town name (fixes #2845)
[ci skip]

The two r's version is used in two other locations.
2018-04-08 22:21:17 +11:00
Charles Dang
1f0588883c MP Staging: make Faction Select button's purpose more clear
[ci skip]
2018-04-08 21:04:14 +11:00
Charles Dang
77863cc526 SotA S2: fixed inconsistency between unit name and dialog (fixes #2844)
[ci skip]
2018-04-08 13:34:47 +11:00
Charles Dang
48010f514e SotA S2: fixed units with translatable IDs........
[ci skip[
2018-04-08 13:33:21 +11:00
Charles Dang
ccce10511a Unit Create: fixed unit selection not persisting between uses (fixes #2822)
I had been unconditionally selecting the first entry after setting the active
sorting option. This overrode the previous unit selection.

Regression from 6b52d16fae.
2018-04-08 13:11:27 +11:00
Celtic Minstrel
8581637b51 Update changelog 2018-04-07 12:26:16 -04:00
Celtic Minstrel
4b2dd68595 Support alignment= in SUF 2018-04-07 12:24:21 -04:00
Celtic Minstrel
62d39d6532 Support usage= in SUF 2018-04-07 12:24:11 -04:00
Celtic Minstrel
46f4b51482 SWF: Support lists for special= and special_active= 2018-04-07 12:23:06 -04:00
Celtic Minstrel
c62a4820fc Deprecate [replace_map]map= in favour of [replace_map]map_data=
This gives greater consistency between similar APIs, and allows macros
intended to drop a map into [scenario] to also work in [replace_map].
2018-04-07 12:22:52 -04:00
loonycyborg
0e5463fd81 nsi script: update expected extensions of changelogs 2018-04-07 13:20:08 +03:00
Jyrki Vesterinen
e7ed3cbbb9 Fix linking of C++ unit tests with CMake
The problem with them is that the "libraries" into which Wesnoth is split
have circular dependencies, and linking of the game succeeds only by chance
(everything just happens to be used by the time the linker encounters it).

Fixed by allowing the linker to use multiple passes over the libraries
until all references are resolved.
2018-04-07 13:15:01 +03:00
Martin Hrubý
165349104d
Merge pull request #2840 from newfrenchy83/patch-11
Update wesnoth.cbp
2018-04-07 12:01:22 +02:00
newfrenchy83
2c65dff722
Update wesnoth.cbp 2018-04-07 11:18:05 +02:00
Sofartin
d27e359d6e Add l10n-track to macOS Package - #2825 2018-04-07 10:54:26 +02:00
Charles Dang
d786fd6622 Image: handle case where l10n-track file is not present
Resolves #2825.
2018-04-07 19:34:10 +11:00
Nils Kneuper
6be41f51a5 updated French translation 2018-04-07 09:55:11 +02:00
stevecotton
2b406a37ec LoW S09 Lua cleanup: fix a line that was missed in 3783693cb (#2835)
3783693cbe was a general rename of
'V' to 'vars', and this line was missed. It caused an error at the
start of S09.

[ci skip]
2018-04-07 12:23:47 +11:00
Sofartin
83c0fc5073 Bump wesnoth version 2018-04-07 01:11:34 +02:00
Iris Morelle
3967fd190e gui2/log_settings: Make log options tooltips translatable
Fixes #2837.
2018-04-06 14:04:00 -03:00
loonycyborg
c955416ef2 flatpak-builder manifest: cleanup a buildtime only dependency 2018-04-06 11:23:15 +03:00
Charles Dang
3e7159e78e Minimap: removed old surface-based drawing implementation
Also cleaned up a minimap.hpp include.
2018-04-06 15:53:41 +11:00
Charles Dang
f5ec886cb5 Display: removed minimap drawing code
I kept some helper code (mainly the redraw_minimap function so I know where it needs
to be called) around for references.
2018-04-06 15:52:21 +11:00
Charles Dang
24d787c593 Minimap: added support for drawing unit markers
This moves the logic from the display class here. Will be utilized by the upcoming
interactive minimap widget I'm working on.
2018-04-06 15:39:50 +11:00
Charles Dang
e7a8af0c40 Renamed two t-prefix typedefs
[ci skip]
2018-04-06 12:20:35 +11:00
Celtic Minstrel
2afb40e3e9 Remove ai.synced_command stub 2018-04-05 19:45:36 -04:00
Sofartin
756f24d85e Remove libpng headers 2018-04-05 19:21:15 +02:00
Martin Hrubý
31192cb44b Fixed typo 2018-04-05 16:00:41 +03:00
Sofartin
0d4bd9f908 Update Xcode project after 3922a48c5c 2018-04-05 12:59:17 +02:00
Charles Dang
3c5eb48601 Removed unused image::set_pixel_format
Its use was dropped when I got rid of the window framebuffer surface.
Also removed the image.hpp include from video.hpp.
2018-04-05 13:01:31 +11:00
Charles Dang
3922a48c5c Removed GUI1 formatting deliminator definitions 2018-04-05 12:45:21 +11:00
Charles Dang
b82516ffe6 Team: cleaned up some redundancy in color getters
* The one case of get_side_color_range().mid() was converted to get_side_color();
  These are equivalent
* get_side_rgb() was removed. Before color_range was refactored to use color_t
  (f2ab245e8d), the only difference between it and
  get_side_color() was that the former used to return uint32_t (the color they returned
  was the same.
* get_side_rgb_min() and get_side_rgb_max() were renamed to get_side_color_min() and
  get_side_color_max(), respectively. Both were unused in any case.
* get_side_highlight_pango() was renamed get_side_color_pango() and now takes a 1-indexed
  side like the other color functions instead of taking 0-indexed and adding 1.
2018-04-05 12:27:33 +11:00
Charles Dang
594877aaaa Game Config: removed unused UI sound variables
These were used by GUI1. GUI2 doesn't need them; it defines its sounds elsewhere
(see data/gui/default.cfg);
2018-04-05 11:40:39 +11:00
gfgtdf
0f756b8189 fix [message] side_for= not working for the last side.
fixes #2776
2018-04-05 10:39:52 +11:00
Nils Kneuper
b45b0a3cbd updated Polish translation 2018-04-04 21:36:11 +02:00
Charles Dang
1deacd89f6 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.
2018-04-04 18:54:29 +03:00
Charles Dang
cc78bb3b1c Preprocessor: cleaned up an unnecessary header include
enum classes can be forward-declared. Also removed redundant version.hpp include
and did some include re-ordering.
2018-04-04 22:20:54 +11:00
Charles Dang
b8d051cb72 Moved game version stuff from game_config.hpp to version.hpp
They're still in the game_config namespace but are now in a more logical header.

game_config::version has been replaced with wesnoth_version.str(), save for one case
where it was replaced with wesnoth_version directly (it was a comparison against another
version_info object; no need to compare against a string...).

Also cleaned up a bunch of game_config.hpp includes.
2018-04-04 22:08:18 +11:00
Charles Dang
6babb773d2 Fixed images with no alpha channel rendering incorrectly
See https://forums.wesnoth.org/viewtopic.php?p=625159#p625159

Since this problem can also be solved with make_neutral_surface, and is_neutral already
check a surface's alpha mask, I moved the is-not-indexed check to is_neutral and made use
of it for the on-load standardization check.
2018-04-04 20:16:43 +11:00
Charles Dang
464f7ce628 GUI2: minor refactoring of window construction to guard against memory leaks
This ensures the window object is managed by a smart pointer from the moment of its
creation, instead of being passed around as a raw pointer first. If an exception were
thrown during window creation, it would have resulted in a memory leak.

* Moved window_ member assignment to build_window() in both modal_dialog and modeless_dialog.
* Added an assertion after window creation in modeless_dialog.
* Renamed the global build() function to build_window_impl() to avoid confusion with
  builder_widget::build.
2018-04-04 17:05:51 +11:00
Charles Dang
f4fb2a6dcc Changelog entry for c4cf0c9
[ci skip]
2018-04-04 10:52:37 +11:00
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
newfrenchy83
596f3f1bda Update wesnoth.cbp 2018-04-03 08:46:36 -05: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
Sofartin
2ae6c9e4d0 Fix Xcode Project after 23e78abb20 2018-04-03 10:27:15 +02: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
1903b05ab1 GUI2/Label: tweaked link color
[ci skip]
2018-04-03 15:25:44 +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
Martin Hrubý
bca6203bf4 Updated changelog style (#2680)
* Updated changelog style

I have to do that because maximum size for textfield is 1000x1000 so full changelog doesn't fit there

* Disaled Spell Checking and bumped to 1.13.13
2018-04-02 23:38:30 -04: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
Steve Cotton
2caed06cdb THoT S12 Fix some "x=" tests that should be "x,y=" tests
Taking the chest south of the start hid the door and chest that are
north of the start.

The sneak-door opened much earlier in the level, allowing the undead
from the south-east lich to go north to the spider room.  The ghosts
and nightstalkers that are supposed to ambush the player's forces in
the south (after opening the 3-hex door) instead go north and end up
joining the spider fight.  The slower-moving undead also go north,
and are easily fought one-by-one in the sneak passage instead of the
south-east.

[ci skip]
2018-04-03 07:59:26 +11:00
Nils Kneuper
65f690d905 updated Polish translation 2018-04-02 10:42:00 +02:00
Charles Dang
4ae9278eb0 Units: convert header and italic help markup to Pango markup
[ci skip]
2018-04-02 15:40:06 +11:00
Charles Dang
838ef5761f MP Factions: converted bold help markup to Pango markup
[ci skip]
2018-04-02 15:33:37 +11:00
Charles Dang
fb2c76d301 I missed a case of <header>
[ci skip]
2018-04-02 15:31:54 +11:00
Charles Dang
c12cbaa116 Help: explicitly sort Terrain sections
[ci skip]

This happened incidentally with the current help implementation, but that no longer happens
with my in-progress refactor. We still want these sections sorted, though.

The removal of the "sort_sections=generated" key from the Eras section is a forward-port of
6b20ccdb62 from 1.14.
2018-04-02 15:24:27 +11:00
Charles Dang
65a5216bc0 Terrains: convert italic help formatting to Pango markup
[ci skip]
2018-04-02 15:22:09 +11:00
Charles Dang
636ada65a8 Use proper bool instead of yes/no when setting config values 2018-04-02 13:36:51 +11:00
pentarctagon
3f67c2fbf0 Create travis dockerfile in the travis script step.
This allows having multiple Dockerfile-base-* files without also needing to add a separate Dockerfile-travis-* file due to the FROM line changing.
2018-04-01 15:05:20 -05:00
Celtic Minstrel
fed46ec45f Support location_id in [teleport] 2018-04-01 14:05:33 -04:00
Celtic Minstrel
d2a8c5bb32 Fix incorrect error message when encountering an unknown persistent tag 2018-04-01 14:02:51 -04:00
Steve Cotton
d6661fdb80 THoT S12 Put the sneak-passageway's door on the right hex (fixes #2804)
This matches with the "Another old caved-in passageway..." event
around line 835, the trigger is on 55,33 and the walls that open are

        [terrain]
            x=55,55
            y=34,35
            terrain=Uu
        [/terrain]

Debian bug #483893, for which the original fix in
4c473187e6 changed the wrong digit.

This is a cherry-pick from 1.14 to master (fixes #2804) of
bcaac1ef (the change) and 5b7aca97 (the changelog).

[ci skip]
2018-04-01 16:04:15 +03:00
Nils Kneuper
7f35558799 updated Spanish translation 2018-04-01 00:00:51 +02:00
Nils Kneuper
742c378361 updated Czech translation 2018-03-31 22:10:38 +02:00
Sofartin
62febff94e Remove redundand cp 2018-03-31 21:03:29 +03:00
Sofartin
2e2015b6da Enable Testability for macOS DEBUG builds 2018-03-31 20:59:43 +03:00
Sofartin
0a9b10cfa8 Fix Wesnoth's Application Support dir name 2018-03-31 20:52:50 +03: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
Nils Kneuper
a32d689c46 updated French translation 2018-03-31 14:24:10 +02:00
ln-zookeeper
d0a2fde239 ANL: Fixed scenario brokenness stemming from force_lock_settings=yes
[ci skip]
2018-03-31 14:07:40 +03:00
Sofartin
917401acaa Remove rest of Growl things and CodeSign everything after copy 2018-03-30 18:42:07 -05:00
Celtic Minstrel
8becc799c1 Update changelog 2018-03-30 18:43:41 -04:00
Celtic Minstrel
6184489a65 Fix an incorrect error message in [clear_global_variable] 2018-03-30 18:39:24 -04:00
Celtic Minstrel
ea0bcec92f Support facing in [role][auto_recall] 2018-03-30 18:39:11 -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
7a3d6f958a Support root=cube and root=int in [set_variable] 2018-03-30 18:38:47 -04:00
Celtic Minstrel
15ae9fcb0c Use wesnoth.format instead of string.format for translateable strings in [objectives] 2018-03-30 18:38:37 -04:00
Celtic Minstrel
c835e5b7e6 Nicer handling of some Pango formatting attributes in [message] 2018-03-30 18:38:25 -04:00
Celtic Minstrel
d48206bdbe Remove speaker=id support from SUF 2018-03-30 18:38:14 -04:00
Celtic Minstrel
2bd2a8b1b6 Handle speaker=id directly in [message] instead of relying on SUF 2018-03-30 18:38:03 -04:00
Celtic Minstrel
beb5dc75aa Support [set_variable]round=trunc 2018-03-30 18:37:39 -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
Vasya
2b8782923a Lua API: simplify functional.reduce (#2788)
simplify code and remove `indentity or 0` VS `indentity` inconsistency.
2018-03-30 13:23:39 -04:00
Celtic Minstrel
79bc18fe95
Fix unintended change to the semantics of [modify_side]income= 2018-03-30 11:05:31 -04:00
doofus-01
816dd075dc [UtBS] Quenoth elf animations (#2679)
* sun-shyde standing animations, draft

* additions to sun-shyde floating animation

* singer defense animation

* defense animations for sun-singer and sun-shyde

* try to make scout less leaning backwards

* champion defense animation

* fixing and rounding out basic animations (esp. wrt to floating/standing) for sun_shyde
2018-03-30 14:35:25 +03:00
pentarctagon
1bb5fdf283 Add using dockerfiles based on the LTS and BRANCH env vars
This makes it simpler in the future to have branches that have dependencies that are different from master, rather than having a single image with all necessary dependencies installed, which may at some point end up not being possible to do.
2018-03-30 12:08:56 +03:00
Celtic Minstrel
dd4f80fdd1
Fix scenario editor writing to wrong key 2018-03-29 21:48:07 -04:00
Nils Kneuper
57c1a67134 updated British English translation 2018-03-29 22:56:58 +02:00
Nils Kneuper
4bcfada88a updated Ukrainian translation 2018-03-29 22:55:14 +02:00
Nils Kneuper
f19db187fa updated Scottish Gaelic translation 2018-03-29 22:53:24 +02: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
de48b9fbb1 Don't copy the .git directory into docker. 2018-03-29 01:28:17 -05:00
Wedge009
fb866c6d13 'moreso' isn't a word in any dialect of English.
[ci skip]
2018-03-29 12:03:30 +11:00
Victor Sergienko
004d7b541b Credits for Chinese translation of iOS announcements 2018-03-28 18:43:49 -03:00
Martin Hrubý
212cb9be18
Updated Xcode's README.md 2018-03-28 14:37:55 -05: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
56470323c3 SotA: Drop UMC translations section from the campaign's credits
[ci skip]
2018-03-27 19:26:59 -03:00
Iris Morelle
9808a6a722 UtBS: Hide technical terrains in the Help browser
[ci skip]
2018-03-27 19:07:07 -03:00
Iris Morelle
0cdee6b04c Update changelog
[ci skip]
2018-03-27 18:58:23 -03: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
Nils Kneuper
065e8cc128 updated Spanish translation 2018-03-27 22:01:33 +02:00
Nils Kneuper
40d63a4a25 updated Chinese (Simplified) translation 2018-03-27 22:00:03 +02:00
Jyrki Vesterinen
706015ab85 Remove some unreachable code 2018-03-27 21:34:37 +03:00
Charles Dang
8d2244628a Updated Visual Studio projectfile readme
[ci skip]
2018-03-28 05:20:19 +11:00
Iris Morelle
139695d7b1 Sync changelogs across branches
[ci skip]
2018-03-27 05:07:15 -03:00
Iris Morelle
ecb80e607e Fix up previous commit to match 1.14
[ci skip]
2018-03-27 05:00:20 -03:00
Iris Morelle
66b60f4731 Update changelog for the synced debug command UX changes
[ci skip]
2018-03-27 04:54:21 -03:00
Iris Morelle
6b67c18d89 scons: Sort help text with a custom function that will run on Python 3 2018-03-27 03:52:43 -03:00
Iris Morelle
a31b5ebcba Sort scons --help output 2018-03-27 03:46:02 -03:00
Iris Morelle
51111db8f7 wam: Add *.ini to upload blacklist to match the engine, reorder a few items
[ci skip]
2018-03-27 03:06:51 -03:00
Hironori Fujimoto
f63ca02984 UtBS: Fix Nym's hit sound to be female 2018-03-26 22:47:05 -04:00
Celtic Minstrel
3939c332b9 Remove some uses of set_wml_tag_metatable 2018-03-26 22:42:48 -04:00
loonycyborg
abcded267b pot-update and regenerate doc files 2018-03-27 04:30:08 +03:00
loonycyborg
3221e22599 scons: look for xhtml.xsl in several dirs as its location can vary 2018-03-27 04:11:08 +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
lundberg
d322e1fb97 Suppress VC warning 4706 for campaignd 2018-03-26 10:07:20 -05:00
newfrenchy83
cf70a6bb54 Update wesnoth.cbp 2018-03-26 09:49:30 -05: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
28c35e71fa Alphabetical order, alphabetical order, alphabetical order...
[ci skip]
2018-03-26 03:40:55 -03:00
Sofartin
bc027b4fba Fixed Xcode project and removed SDL2_ttf 2018-03-26 17:33:53 +11:00
Iris Morelle
6f17695d7c Update changelog for issue #2732 and issue #2709
[ci skip]
2018-03-26 03:27:42 -03: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
Gregory A Lundberg
49ecb08338
Add fonts.uuid to .gitignore for fontconfig 2.13.0 2018-03-26 01:15:19 -05:00
lundberg
8b7eb536eb Fix missing VC project options
campaignd project did not inherit warning supression for simple_wml from project/solution options.
2018-03-26 00:37:22 -05: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
73d0bf10c3 Help: replaced custom <header> formatting tag with <big>
[ci skip]
2018-03-26 15:05:26 +11:00
Charles Dang
ecab22e6aa Help: replaced custom <bold> and <italic> formatting tags with Pango equivalents
[ci skip]
2018-03-26 15:00:04 +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
Severin Glöckner
e0c9d7b9f6 install.md: cmake version requirement had changed
[ci skip]
2018-03-26 03:25:39 +02:00
Charles Dang
b32ccb05dd Help Browser: increased window height
[ci skip]
2018-03-26 12:21:24 +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
lundberg
a8539cfca0 Fix VC warnings about upstream issues
Disable some warnings pertaining to Boost issues such as name-hides-global.
2018-03-25 20:14:54 -05:00
Charles Dang
db5abb7e63 GUI2/Text Box: refactored hint text interface
Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.

Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.

This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).

This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.
2018-03-26 12:11:34 +11:00
Charles Dang
2b9c7b1abd GUI2/Canvas: allow formula values for [text] font_size= 2018-03-26 12:03:46 +11:00
Celtic Minstrel
229d2f0483 Allow percentages in [random_placement]num_items= 2018-03-25 20:56:11 -04:00
Celtic Minstrel
e4a2c14177 Allow WFL for [random_placement]num_items= 2018-03-25 20:51:03 -04:00
Severin Glöckner
409c596fa1 remove outdated information from install.md
[ci skip]
2018-03-26 02:46:19 +02:00
Celtic Minstrel
4427ee1936
Fix typo in 1dd411a84e 2018-03-25 19:52:22 -04:00
Charles Dang
46598681b6 Fixup 76c2cbac46
Using assignment is for 1.14. We can use `boost::optional::emplace` here on master.
2018-03-26 10:46:42 +11:00
newfrenchy83
76c2cbac46 Implement [filter_weapon] in leadership and resistance abilities
Closes #2718
2018-03-25 17:16:16 -04:00
Charles Dang
e52682e07b wesnothd: removed password reminder backend (closes #2753) 2018-03-26 07:50:27 +11:00
Charles Dang
ebec4d6ce8 MP Login: removed Password Reminder functionality
Resolves #2748.

Essentially, all this did was tell users to go use the forum, so it wasn't worth
it to keep it and solve the infinite loading screen issues it was causing.

The server backend still needs to be cleaned up.

Also removed a dead reference to some "Change Username" button in the Login dialog's
code.
2018-03-26 02:15:53 +11:00
gfgtdf
f219b527e4 fix playmp_controller reading later network packages
in linger mode.

playmp_controller::play_linger_turn calls play_slice after processing
end_linger/[notify_next_scenario] which would (after 'fix chat in
[delay]' commit) then read more data from the network in particular data
for the next scenario which will then be lost.
2018-03-26 01:55:06 +11:00
gfgtdf
94aa24c5a8 fix moves sometimes not undone when control is changed.
with the 'fix chat not working during delay/animation' it could happen
that play_slice_catch would process a incoming controller change in
which case that while loop would end without the code inside that 'if
(player_type_changed_)' being executed, which woudl lead to oos errors
since that client woudl have made moves that other players don't have.
2018-03-26 01:55:05 +11:00
gfgtdf
274da80788 fix chat during [delay] and animations
fixes #1856
2018-03-26 01:55:04 +11:00
Hironori Fujimoto
6b98bbdca1 Rename variable so that it's role becomes clearly 2018-03-25 16:49:13 +03:00
Hironori Fujimoto
6212a62a98 Use is_composing() instead of raw ime_in_progress_ 2018-03-25 16:48:50 +03:00
Hironori Fujimoto
5e22b2b714 Remove private member 'ime_length_'
In order to get length of composition text, just compare text_ and
text_cached
2018-03-25 16:46:02 +03:00
Hironori Fujimoto
16a8ac7e49 Turn ime_in_progress_ off when composition text is nothing 2018-03-25 16:43:02 +03:00
Martin Hrubý
39d1476ade Drop OS X 10.7 and Growl support (#2749) 2018-03-25 15:48:23 +03:00
newfrenchy83
f8abea0de4 Update wesnoth.cbp 2018-03-25 15:31:49 +03:00
Iris Morelle
3c6bb665c6 Update credits
[ci skip]
2018-03-25 05:35:40 -03:00
Iris Morelle
84ce75af19 gui2/unit_attack: Fix damage types and ranges being displayed in English
Part of issue #2732.
2018-03-25 04:41:22 -03:00
Iris Morelle
7056ae014c gui2/unit_attack: Fix alignments being displayed in English
Part of issue #2732.
2018-03-25 04:19:42 -03:00
Charles Dang
5ddc1d9a2e Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-25 17:02:22 +11:00
Charles Dang
0e9eac9ad8 Mouse Events: removed an override that only called the base method 2018-03-25 16:48:37 +11:00
Celtic Minstrel
1dd411a84e Support to_location in [move_unit] 2018-03-24 18:32:10 -04:00
Charles Dang
11e88dd1ca Updated DejaVu Sans font files to version 2.37 (from 2.35)
[ci skip]

Source: https://dejavu-fonts.github.io/Download.html
I haven't done any codepoint list updates in data/hardwired/fonts.cfg, but that's
not relevant anymore since it's for the legacy TTF rendering system which is in
the process of being removed.
2018-03-25 09:15:28 +11:00
Celtic Minstrel
7a1ea36d39 Update changelog 2018-03-24 18:11:56 -04:00
Celtic Minstrel
4e52d62963 Support formula= in [variable] ConditionalWML 2018-03-24 18:09:04 -04:00
Charles Dang
cef0edb4ac Updated Oldania font files to version 1.007 (FFEdit)
[ci skip]

Source: http://arkandis.tuxfamily.org/adffonts.html. Previous version was 1.006 (FFEdit).
Also includes the italic and bold variants we didn't have before.

Thanks to @sevu for finding this updated version. :)
2018-03-25 09:00:57 +11:00
pentarctagon
376f2e9dbe Explicitly set osx_image for osx+scons job.
This is the current default, and even though the job uses scons this also sets the osx version to use.  Therefore it's better to set it explicitly in case the default changes at some point.
2018-03-24 15:38:05 -05:00
Charles Dang
bad574f7c8 EI: fixed another Lua syntax error from 3783693cbe
[ci skip]

I misread the intent of that line in the original. It was supposed to clear the
var, not set it.
2018-03-25 06:28:11 +11:00
Charles Dang
915dfaa399 Quick fix for "Mandatory WML child missing" error when starting MP
This isn't a proper fix since then the minimap doesn't show, but it at least allows
you to start an MP game.

Fixes #2724.
2018-03-25 06:28:02 +11:00
Charles Dang
8d3dcb109b GUI2/Window: reverted some unintentional semantic changes from 88e5c49f5d
These were never intended to go in that commit at all. I accidentally included them.
This reverts the semantic changes. The rest was just formatting so I'm leaving it.
2018-03-25 05:10:26 +11:00
Charles Dang
e4b7820ab0 Fixed infinite loading screen when logging in with an invalid nickname
Fixes #2728.
2018-03-25 04:46:02 +11:00
gfgtdf
83007d4825 remove a [on_redo]
since it was removed in 10561d3e53 this will cause errors. Please make sure it is not used in mainline before you remove something.
2018-03-25 04:20:40 +11:00
gfgtdf
7621af926b show the oos savegame dialog when receiving a debug command in mp
with a different text of course.

fixes #2683
2018-03-25 04:16:44 +11:00
gfgtdf
da2081de77 fix initial selection of mods in sp 2018-03-25 04:15:07 +11:00
Charles Dang
afaa75842c Add ability to bypass strict no-disabled-events assertion when writing events
This is since the Gamestate Inspector can be invoked mid-event (using [inspect])
and it makes use of write_events().
2018-03-25 04:06:13 +11:00
Charles Dang
ef172d47fa Exclude command console and game ui dialogs from tests
They need to be more stable and complete before we test them.
2018-03-25 04:00:15 +11:00
Celtic Minstrel
cf385537c2 Fixup last commit 2018-03-24 12:42:13 -04:00
Celtic Minstrel
f7cc1842bb Don't bother trying to standardize event name if there isn't one 2018-03-24 12:40:58 -04:00
Charles Dang
89e0d7e2ae Events: ensure the global event context is always available
The Boost unit tests have been failing since I removed the GUI2 event context since the
code expects both that A: the topmost context is the global one and B: that you can't
use join() to join the global context. Removing the UI event context meant the test's
fake_display event_context became the only (and global) context, causing an assert.
2018-03-25 03:35:47 +11:00
Celtic Minstrel
e317f346e8 Don't show a message for missing name in [event] if it has an id 2018-03-24 12:32:04 -04:00
Sofartin
00e9f4482f Add new unit_tests dependencies 2018-03-24 15:27:41 +02:00
newfrenchy83
67f2ba9767 Update wesnothd.cbp 2018-03-24 15:10:57 +02:00
Jyrki Vesterinen
fbfa82c6b1 Remove error message if creating texture for floating label fails
Textures can't be created with faked video. That's pretty much the only
reason why creating that texture can ever fail (other cases, such as
credits, stress the text rendering system much more than floating labels).
2018-03-24 11:38:19 +02:00
Sofartin
29b12782a8 Fixed Xcode Project after 5ece7ac5b7 2018-03-24 11:12:53 +02:00
Jyrki Vesterinen
2257c03771 Fix build with GCC and Clang 2018-03-24 11:11:25 +02:00
Jyrki Vesterinen
d4c9db9e35 Visual Studio: increased warning level to /W4 even for release builds
In particular, this enables C4100, the warning for unreferenced function
parameters.

I also fixed some /W4 warnings.
2018-03-24 09:41:28 +02:00
Iris Morelle
f6a128579a Revert "Revert "Bump min Boost version to 1.56.0""
This reverts commit cdf9b465c6.

May this noise be my vengeance.
2018-03-24 01:53:47 -03:00
Iris Morelle
cdf9b465c6 Revert "Bump min Boost version to 1.56.0"
This reverts commit c82c1ff905.
2018-03-24 01:46:52 -03:00
Iris Morelle
5c59fade0f Use the correct textdomain for the random faction mirror options
Fixes up commit 2e502334f2.

See issue #2709.
2018-03-24 00:37:29 -03:00
Iris Morelle
9852064ba9 Fix warning about an unused method parameter 2018-03-24 00:37:29 -03:00
Charles Dang
49d36e6eb4 Display: always draw the map in the full window
This is a temporary measure that removes reliance on the theme map rect.
I need to ponder the best design to handle displaying the full map.
2018-03-24 14:36:40 +11:00
Charles Dang
5ece7ac5b7 Split the rect_of_hexes struct into its own file
And cleaned up it a bit. Made use of std::array and gave it a default ctor using
the values from display::hexes_under_rect.
2018-03-24 13:22:54 +11:00
Charles Dang
c76bef8bb8 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-24 11:00:06 +11:00
pentarctagon
c456d4b288 Make UTF8 checks fail the build if they find anything.
Also fixes a comment typo in docker_run.sh.
2018-03-23 18:59:28 -05:00
pentarctagon
344b5c56b9 Removes a couple scripts that are not used.
utils/travis/install_deps.sh - no longer executes anything outside of the osx if block.
utils/travis/exit_wrapper.sh - I honestly don't know why this exists.
utils/travis/test_wrapper.sh - No longer used as of 7ca5a0df64.
2018-03-23 18:59:28 -05:00
pentarctagon
3b5cbc3e3c Add the updated Dunefolk race description.
See: https://forums.wesnoth.org/viewtopic.php?f=32&t=47721&start=375#p624668
[ci skip]
2018-03-23 18:42:11 -05:00
pentarctagon
994e6efa79 Remove deprecated Khalifate references. 2018-03-23 18:42:11 -05:00
Charles Dang
85dcef7fa0 Removed remaining references to window framebuffer surface 2018-03-24 10:31:04 +11:00
Charles Dang
c7367344b1 Removed surface_restorer class
This was only used in the GUI1 widget base class and isn't something we'll need
with accelerated rendering.
2018-03-24 10:28:51 +11:00
Charles Dang
3be39a98fe 0 -> nullptr in 2 places 2018-03-24 10:22:25 +11:00
Nils Kneuper
0bab3fb4d3 updated Spanish translation 2018-03-23 22:32:35 +01:00
Charles Dang
c2fd4f48f9 Cleaned up unnecessary instances of emplace_back(config {})
No need to invoke the copy ctor.
2018-03-24 00:55:28 +11:00
Charles Dang
2e502334f2 MP Create Game: attempt to fix RFM type labels being untranslated (#2709)
Since these are defined in their MAKE_ENUM enum with N_, we need to manually un-not-translate
them here.
2018-03-24 00:55:27 +11:00
pentarctagon
b801140344 Remove debugging symbols from Travis xcode build.
This removes the -g option from the xcode travis build, since debugging information isn't needed and the increased size was causing the cache to timeout when compressing and uploading it.  ccache max cache size is also decreased from 2 GBs to 200 MBs, which matches the linux+cmake builds.  Fixes #2670.
2018-03-23 03:10:27 -05:00
Charles Dang
57700090d8 GUI2: reimplemented [dis]connect_signal SFINAE using constexpr functions
This replaces the use of the boost::mpl::set lists. It replaces those damn things with simple
constexpr functions that check the template parameter against an accepted list for each event
type. This is a *lot* simpler.

These helpers are also used in the runtime checks in dispatcher::fire.

I've had to leave the mpl sets in, though, since I can't figure out how to convert the last
place where they're used. The presence of a type is required for SFINAE in
dispatcher_implementation::event_signal, and I can't figure out a new design that avoids the
need for the template parameters.
2018-03-23 18:46:20 +11:00
Iris Morelle
9d76278e71 Update the changelog
[ci skip]
2018-03-23 04:35:13 -03:00
Iris Morelle
94c5f64cc6 i18n: Remove no-op translation::init() function
This function only ever had an implementation when building the i18n API
to use libintl instead of Boost.Locale was possible, in which case its
implementation would be a std::setlocale() call specific to POSIX
systems.

I'm not backporting this to 1.14 since it's an inconsequential cosmetic
thing, or so I'd like to think. Last time someone tried to remove a
similarly empty "init" function elsewhere, things went south pretty
quickly.
2018-03-23 04:20:22 -03:00
Iris Morelle
a602391168 i18n: Make VGETTEXT()/VNGETTEXT() always require a GETTEXT_DOMAIN to be defined
This drops a preprocessor conditional branch that is dead code now that
the file pulls gettext.hpp and the GETTEXT_DOMAIN defaults with it.

See also PR #2711.
2018-03-23 04:18:46 -03:00
Iris Morelle
5c28dcaab6 i18n: Forcefully pull gettext.hpp into formula/string_utils.hpp
There are cases (deprecation.cpp for one) where string_utils.hpp is
included first, which causes the VGETTEXT/VNGETTEXT definition to use
the textdomain-less (a.k.a. forced wesnoth-lib textdomain) overloads of
vgettext() and vngettext(), because GETTEXT_DOMAIN has not yet been
defined by anything. This again results in strings being looked up in
catalogues where xgettext is not adding them.

This is a companion for PR #2711 I should've noticed sooner. Without it,
there were still cases where interpolated strings would not be
translated due to vgettext() using the wrong textdomain for them.

I ran a quick scan on the codebase to make sure there aren't any files
including formula/string_utils.hpp before defining their own
GETTEXT_DOMAIN instead of the gettext.hpp default.
2018-03-23 04:18:36 -03:00
Iris Morelle
c5b3947e4a Replace all instances of naked vgettext() calls with VGETTEXT()
The vgettext() function, while declared in src/formula/string_utils.hpp,
actually has its implementation out-of-line in
src/formula/string_utils.cpp where GETTEXT_TEXTDOMAIN is defined to
"wesnoth-lib". Because vgettext() is implemented in terms of the _()
function (an inline wrapper around translation::dsgettext()), it passes
the textdomain defined in the file where it was implemented as a
parameter.

This means that every case of vgettext() being used in other code units
where GETTEXT_TEXTDOMAIN is not defined to "wesnoth-lib", is broken if
the string being looked upon doesn't coincidentally exist in the
wesnoth-lib textdomain.

Ages ago, to work around this limitation, an overload of vgettext() that
takes the textdomain name as a parameter was introduced (see commit
0ba3d05204). Since this form of vgettext()
is rather unwieldy to use (and in particular, the xgettext message
extraction tool mistakes the first argument for the msgid, see below), a
VGETTEXT() macro was also added that uses the GETTEXT_TEXTDOMAIN symbol
defined in the file where the call is made, and thus we get the correct
string from the correct textdomain.

Switching all cases of naked vgettext() in mainline to VGETTEXT() fixes
a myriad of situations where an interpolated string that has an extant
translation does not actually get translated in practice because of the
mismatched textdomain reference (see issue #2709 for an example with MP
game titles). I couldn't find any cases of the companion vngettext()
function (which handles plurals) being used in the wild naked, but for
future reference it also has a companion VNGETTEXT() macro to pass the
correct textdomain to its textdomain-parameter overload.

One caveat is that this commit DOES break the string freeze in one
particular case -- src/units/unit.cpp has a case where the
textdomain-parameter version of naked vgettext() was in use with
"wesnoth" as the first parameter, and xgettext misidentified this as a
translation entry for a "wesnoth" string in the file's assigned
textdomain (which is the default textdomain, wesnoth). So this will
result in the next pot-update both removing the spurious "wesnoth"
string AND adding the correct string to the relevant catalogue template
("<span color=\"$color\">$number_or_percent</span> HP").
to that textdomain.

Other than that, I believe this does not break the string freeze in any
other fashion and it shouldn't result in any regressions for i18n.

It might be worth considering in the future renaming vgettext() and
vngettext() to names that make people less likely to misidentify them as
functions they can freely call directly without regard to the textdomain
assignment issue.
2018-03-23 04:18:01 -03:00
Charles Dang
7a9ed8d363 Used UNUSED macro instead of (void) where applicable 2018-03-23 12:29:56 +11:00
Charles Dang
b6c4f0f6ae Display: removed redraw observer interface
This won't be needed once we get everything sorted out and refactored.
2018-03-23 12:23:58 +11:00
Alexander van Gessel
8179c7226b Invert a conditional
Found by coverity.
2018-03-22 16:52:45 +01:00
Gregory A Lundberg
812de972ac
Fix unused parameter
If you're going to stub a function, please remember to clean up its parameters as well.
2018-03-22 10:12:52 -05:00
Charles Dang
410398a70b Used stdlib math functions instead of global C versions 2018-03-22 23:25:23 +11:00
Charles Dang
4abbb7b9f9 Display: more code cleanup, mostly of stuff I noticed while formatting 2018-03-22 23:01:52 +11:00
Charles Dang
c195ff25d9 Display: formatting cleanup 2018-03-22 22:48:25 +11:00
Charles Dang
6721c84f7e Display: minor code cleanup 2018-03-22 22:34:03 +11:00
Charles Dang
8d1ec6216b Added two missing textdomain headers
[ci skip]

Should fix two of the issues mentioned in 2709.
2018-03-22 22:08:38 +11:00
Lari Nieminen
4d86af796c
EI: Fix Lua syntax error from 3783693cbe
[ci skip]
2018-03-22 09:51:37 +02:00
Charles Dang
4ea25d5df5 Display: removed more theme handling stuff 2018-03-22 14:46:34 +11:00
Charles Dang
75954109c5 Fake Display: cleanup
* Removed now-unused reports member (as of cdb11c2)
* Formatting cleanup
* 0 -> nullptr
* Removed commented-out dtor
2018-03-22 06:45:30 +11:00
Gregory A Lundberg
cdb11c2109
Fix bad initializer 2018-03-21 14:35:15 -05:00
Charles Dang
eeffa82e2b Fixup 37dee4b (unused variable) 2018-03-22 04:51:15 +11:00
Charles Dang
db64bc7126 Command Executor: removed set_button_state()
This had to do with setting up GUI1 theme buttons.
2018-03-22 04:35:02 +11:00
Charles Dang
d6cc93be1b Font/Pango Text: added debug assertion 2018-03-22 04:25:03 +11:00
Charles Dang
37dee4b1ff Display: removed all code related to report drawing
Report drawing was handled in draw_sidebar, so that function was also removed. The display
class won't be handling sidebar drawing anymore anyway.

Also removed display::invalidate_game_status and game_display::invalidate_unit which were
both used to set a flag dealing with report drawing.

This should finally get the display class close to map drawing only.
2018-03-22 04:20:38 +11:00
Charles Dang
d0f7bfbf37 Floating Label: added text to debug output if texture creation fails 2018-03-22 03:43:25 +11:00
Charles Dang
a9afee6104 Floating Label: don't attempt to render empty text 2018-03-21 20:49:16 +11:00
ln-zookeeper
3be2ff5187 EI S03: Changed Mal-Kallat back to male
He was changed to female in f4d67031a4 even though he's addressed as "brother" in dialogue. Reported on the forums.
2018-03-21 11:25:28 +02:00
Charles Dang
94f172dbdd Display: removed unnecessary getSurface check 2018-03-21 20:18:55 +11:00
Charles Dang
f081a1c133 Revert "Convert uses of boost::regex and related functions/types to their stdlib counterparts"
This reverts commit 29ee9a7150. It broke GUI2 schema validation
for keys with formulas. Also, it seems std::regex does have a form of match_not_dot_null
(std::regex_constants::match_not_null). Will need to rethink.

StackOverflow tells me boost::regex used Perl regex, whereas the stdlib regex does not. Shall
have to confer with @celticminstrel...
2018-03-21 18:13:36 +11:00
Sofartin
00dac71a90 Fixed Xcode Project 2018-03-21 18:01:20 +11:00
Charles Dang
4cf1f8dc9d GUI2/Grid: made use of std::exchange 2018-03-21 17:52:39 +11:00
Charles Dang
1e9f2548a6 Cleaned up MSVC 2013 compatibility code
We no longer support that compiler.
2018-03-21 17:52:24 +11:00
Charles Dang
29ee9a7150 Convert uses of boost::regex and related functions/types to their stdlib counterparts
This was put off when we first transitioned to C++11 since GCC 4.8 didn't have full
regex support. Since we now support at least GCC 5, we can commit this.

This covers:
* boost::regex
* boost::regex_match
* boost::smatch
* boost::sregex_iterator
* boost::sregex_token_iterator

boost::regex_constants::match_not_dot_null doesn't have a stdlib counterpart, but according to
@celticminstrel it should be alright to remove it.
2018-03-21 17:06:29 +11:00
Charles Dang
112ada179c GUI2: added display and execute wrappers for a bunch more dialogs
Made use of them where applicable. There are a whole bunch of cases where the dialog
object only exists to check its return value, but I'll update those separately.
2018-03-21 16:47:36 +11:00
Charles Dang
5145b009a5 Display: removed code to draw theme panels/labels
Again, going to be handled by a GUI2 dialog.
2018-03-21 14:38:51 +11:00
Charles Dang
72c451d2ae Display: restored background drawing
I think we indeed want this to be handled here, since it's the gamemap background,
not the UI's background. Made it a class member.
2018-03-21 14:15:52 +11:00
Charles Dang
e1e7f65ec1 Display: removed interface that set up theme buttons
Unused now, since we're moving to GUI2 for the ingame UI. The functions to get buttons
are left, but they always return nullptr.
2018-03-21 14:15:50 +11:00
Iris Morelle
39b05dd0db wam: Update description and name for Modifications
They are no longer just for multiplayer mode (see issue #1475, commit
a09e2bb858).

[ci skip]
2018-03-21 00:14:41 -03:00
Charles Dang
9bc19d7e02 Fixup 3254bb2 (forgot to include this) 2018-03-21 13:40:29 +11:00
Charles Dang
a971af89d7 Playcampaign: formatting cleanup 2018-03-21 13:37:01 +11:00
Charles Dang
0552175693 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-21 13:14:26 +11:00
Charles Dang
3254bb2c7d Moved UI object from display to play_controller
Design change from 075a9bac34.

After discussion with @celticminstrel, we decided it better for the controller to
own the UI object as well as the display object, instead of the display owning the UI.

I've added a pure virtual function declaration to controller_base to ensure all controllers
implement this.
2018-03-21 13:13:54 +11:00
Charles Dang
a5344ae52a Play Controller: formatting cleanup 2018-03-21 12:42:28 +11:00
gfgtdf
439340ce78
update INSTALL.md for c++14 requirement
clang 3.8 is needed for "Money, Time, and hexfloat I/O manipulators (N2071)" (a c++11 feature)
2018-03-20 23:22:14 +01:00
Charles Dang
fef1310890 Attempt to fix build 2018-03-21 08:26:32 +11:00
Jyrki Vesterinen
e70a9c769d Fix size of fake screen
Unit tests (WML and C++ alike) require that the fake screen has nonzero
size. Thus, we again report a nonzero screen size with a fake screen.

Unfortunately, this didn't fix the unit test I was testing
(test_end_turn). The problem is that the null theme is returning that
the game area has zero size; however, I haven't found any differences
between 1.13 and master that would explain why the problem occurs in
master but not 1.13. I'll need to debug 1.13 separately later on...
2018-03-20 20:54:29 +02:00
Charles Dang
239fde451a Removed the old surface drawing queue implementation, except for the layer enum
Kept that since it's still used in some places and is good for reference.
Also removed display::get_screen_surface which was used in said impl.
2018-03-20 22:07:34 +11:00
Charles Dang
0b8e86df85 Help: formatting/doc/include cleanup 2018-03-20 21:40:43 +11:00
Charles Dang
28d2be4bec Removed a whole bunch of GUI1 stuff
This almost completely removes GUI1, save for the button widget (will remove once I get
all the Theme handling sorted out) and the editor's own GUI1 widgets.

This includes the GUI1 textbox, scrollbar, scrollarea, and menu widgets, as well as the
dialog_frame and dialog_manager classes. I've also removed floating_textbox. It was only
kept around for reference (it's unused as of the inclusion of the GUI2 command console).

gui::in_dialog has been replaced by GUI2's is_in_dialog directly now that we have no more
GUI1 dialogs.

\o/
2018-03-20 21:07:59 +11:00
Charles Dang
6ea405174e Updated VS projectfile for 5022a38
[ci skip]
2018-03-20 19:34:04 +11:00
Charles Dang
5022a38608 Removed GUI1 Help interface code
Not needed anymore since we're moving to GUI2 for this dialog.
2018-03-20 19:21:33 +11:00
Sofartin
1e96d9c87b Fixed Xcode Project 2018-03-20 10:16:48 +02:00
Wedge009
899b4b73b2 Update VC project files.
* Switch libeay32 to libcrypto for OpenSSL 1.1.0 update in https://github.com/aquileia/external/
* Added recent source additions not yet present in MSVC projects.
* Miscellaneous minor tidying/sorting in filters and build configurations.

[ci skip]
2018-03-20 15:16:53 +11:00
Sofartin
9e73b49d86 Fixed Xcode project 2018-03-20 06:10:06 +02:00
Charles Dang
625135eb0d Rename events::pump to events::run_event_loop
To make its purpose clearer.
2018-03-20 11:26:54 +11:00
Charles Dang
123dd952c0 Made CVideo::render_screen private
It's not supposed to be called outside events::pump.
2018-03-20 10:33:58 +11:00
Charles Dang
504d4d2ff4 Display: removed now-unused map_screenshot_surface_
Unused as of 3a768cbdbe. It was needed for get_screen_surface(), which is used in
drawing_queue, but that's going to be removed soon.
2018-03-20 10:29:42 +11:00
Charles Dang
f80fabfe30 Help: removed code to show old GUI1 help browser
Attempting to launch it crashes the game (probably to do with a null video surface),
and since it's being replaced there's no point in restoring it to functionality.

The implementation details (help_menu, etc) have been left for now. Will remove soon.

This also means the GUI2 help browser is shown by default now.
2018-03-20 10:26:09 +11:00
Charles Dang
77f2c758ca GUI2/Window: cleaned up some commented-out code 2018-03-20 09:02:25 +11:00
Gregory A Lundberg
de218da637
Bypass unused code so we still compile while the mountains crumble and smoke rises from the waters. 2018-03-19 16:47:32 -05:00
Charles Dang
f62ad8b1df Fixup 3a768cbdbe
Output is good now :P
2018-03-20 07:37:15 +11:00
Charles Dang
3a768cbdbe Display: got map screenshots working again
Output is not perfect, but that can be solved later.
2018-03-20 07:29:37 +11:00
Jyrki Vesterinen
e43d1f5430 Restore ability to recruit full keep of one unit by holding Ctrl+Alt+R 2018-03-19 20:38:25 +02:00
Charles Dang
075a9bac34 Get the GUI2 in-game UI at least appearing
I decided to go with a modular approach, where both in-game and editor UI dialogs inherit
from a single base class, a pointer of which is owned by the display class. That can be
used for common functionality that needs be shared by all in-game dialogs.

Right now the new UI is just static. It works with most stuff, but not key presses. Working
on that...
2018-03-20 04:47:42 +11:00
Charles Dang
b2d3da4a1e Removed non-functional video2::draw_layering class
Will possibly re-implement this in a different way.
2018-03-20 04:47:40 +11:00
Gregory A Lundberg
419385d934
Disable entire function
Leaving bits and pieces around leads to compiler warnings.
2018-03-19 12:13:31 -05:00
lundberg
c187f069e8 Suppress upstream variable-hide-variable errors. 2018-03-19 11:21:37 -05:00
lundberg
58f585b6e5 Fix variable-hides-variable 2018-03-19 11:21:37 -05:00
Sofartin
a766c00b7e Fixed campaignd Xcode target 2018-03-19 16:18:33 +02:00
Sofartin
d584ebded6 Fix InfoPlist.strings encoding 2018-03-19 12:28:01 +02:00
Charles Dang
d4a2ddb688 Display: disabled all in-game theme drawing
We're moving this to GUI2.
2018-03-19 17:03:45 +11:00
Charles Dang
ace03abef5 Display: removed unused redraw_everything function 2018-03-19 17:00:15 +11:00
Charles Dang
9063736fd4 Display: removed drawing_queue_ member
This was the core of the surface-based drawing engine. Unused now. The drawing_queue_add()
calls throughout the code have been left, but commented out, for reference while reimplementing
things. The actual drawing_queue code has been left to, since its layers are referenced in
places. Need to remove them.
2018-03-19 16:59:44 +11:00
Charles Dang
bb3d5b9a9d Updated VS projectfile for recent changes
[ci skip]
2018-03-19 16:14:40 +11:00
Charles Dang
fc2a58f693 Use std::size_t everywhere instead of plain size_t
Excludes:
* spirit_po/
* xBRZ/
2018-03-19 11:56:04 +11:00
Charles Dang
4225e1aa7c Small build fixup 2018-03-19 10:59:16 +11:00
Charles Dang
68f4bd14d6 Used std::exchange for a thing
Note we don't really need to set the other object's renderer ptr to null since
the canvas dtor doesn't destroy it anymore, but still. Good to do.
2018-03-19 10:48:52 +11:00
Charles Dang
1167e3e78b Some build fixups to reflect changes since the help commits were originally made 2018-03-19 10:48:48 +11:00
Charles Dang
5193c7e7bf Help Browser: removed help topic padding 2018-03-19 10:48:06 +11:00
Charles Dang
75639bafd1 Help Browser: fixup topic title layout 2018-03-19 10:48:04 +11:00
Celtic Minstrel
5d918cd5a5 Help Browser: Support arbitrary initial topic
Hidden topics still untested.
2018-03-19 10:48:02 +11:00
Celtic Minstrel
b5c0da9e37 Help Browser: Don't double-list a section's root topic 2018-03-19 10:45:11 +11:00
Celtic Minstrel
854ade5d5c Help Browser: Show topic title 2018-03-19 10:45:09 +11:00
Celtic Minstrel
f2434d6572 Help Browser: Fix back button being visible when dialog opens 2018-03-19 10:45:07 +11:00
Charles Dang
71a89de7b2 Help Browser: properly implement toggling by clicking the book icons 2018-03-19 10:45:06 +11:00
Celtic Minstrel
a96c270b32 Fix GUI1 help topics not showing 2018-03-19 10:45:04 +11:00
Celtic Minstrel
cdea534ee0 Help Browser: Implement history 2018-03-19 10:45:03 +11:00
Charles Dang
c514c95a1f Moved new help entry point to a common location 2018-03-19 10:45:01 +11:00
Charles Dang
231a8ccbf2 Help Browser: implemented viewing of sub-sections/topics 2018-03-19 10:44:01 +11:00
Celtic Minstrel
11dbcb1464 Help Viewer: Parse help markup to Pango markup... mostly.
The help parser now outputs a config rather than a vector of strings of
which some should be taken literally and others parsed as WML.
2018-03-19 10:43:59 +11:00
Charles Dang
19eee7e806 Help Browser: improved layout stability and added next/back buttons (non-functional, of course) 2018-03-19 10:43:38 +11:00
Celtic Minstrel
d61af99a9b Help: That parameter isn't really needed 2018-03-19 10:43:36 +11:00
Celtic Minstrel
178dba8284 Help Viewer: Show topics with generated text 2018-03-19 10:43:27 +11:00
Celtic Minstrel
fbd42a7378 Help Browser: Actually show the correct topics with the correct icons
This also fixes the lag when opening help and makes the topic text appear.
(The topic text is not parsed at the moment, though.)
2018-03-19 10:43:25 +11:00
Gregory A Lundberg
22f0a89a64
Fix Coverity 1386194 Initialize class member
Only a problem if stuff is not done in the expected order. Initialize to zero so at least things go wrong but they don't go wildly wrong.
2018-03-18 17:05:55 -05:00
Celtic Minstrel
9902a2df31 Add the advanced prefs entry for the deprecation setting 2018-03-18 16:55:03 -04:00
Celtic Minstrel
49ad25fc69 Document --log-none command line option
This reverts commit e1ac4298eaf5bee6c885263e179588a051de24a8.
2018-03-18 16:51:39 -04:00
pentarctagon
983045718a Stop hard-coding cmake's -std version.
Adds the CXX_STD variable which can be set.  Currently defaults to 14.  This also now makes cmake honor the CXXSTD env variable set on travis.
2018-03-18 14:59:52 -05:00
Gunter Labes
b115be99e1 Enable lobby message logging again
Also re-enable flood protection and truncating too long messages.
2018-03-18 20:16:06 +01:00
Gregory A Lundberg
54b3f51a24
Fix more doccomments 2018-03-18 13:57:43 -05:00
Gregory A Lundberg
c7416ae7d9
Un-deprecate getMinimap
We can't use deprecated functions. If you want to replace it, replace it and delete the old function. But don't do half the job and expect a clean build!
2018-03-18 13:57:43 -05:00
Jyrki Vesterinen
950d4f86e5 Attempted fix for AppVeyor build failures on VS2015
Apparently AppVeyor uses VS2013 tools by default
_even in the VS2015 image_, which makes approximately zero sense.
2018-03-18 20:35:57 +02:00
Gregory A Lundberg
f97a617a26
Fix doccomments. 2018-03-18 13:18:12 -05:00
Gregory A Lundberg
ab36c8bcc2
More missing override specifiers. 2018-03-18 12:54:30 -05:00
Gregory A Lundberg
5b371161a7
Add missing override specifier. 2018-03-18 12:07:47 -05:00
pentarctagon
503e921d2f Set travis use c++14. 2018-03-18 18:54:24 +02:00
Gregory A Lundberg
2a17ecccfc Change SCons and CMake to C++14 2018-03-18 18:29:23 +02:00
Sofartin
4764dcaf5e Fixed Xcode Project for new Wesnoth 1.15 2018-03-18 18:06:43 +02:00
Charles Dang
61f653f91a Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-19 02:16:17 +11:00
Celtic Minstrel
b27c4c6512 Update gitignore for VC project file update 2018-03-18 11:12:40 -04:00
Charles Dang
7f81fba11a Fixup build again 2018-03-19 01:54:31 +11:00
Jyrki Vesterinen
750d558cd9 Fix #2681: minimap buttons don't do anything
Regression from commit ecc0dca665.
2018-03-18 16:48:05 +02:00
Charles Dang
af4db845d6 Cleaned up more framebuffer stuff that should have been in e205e42d44
Some additional uses from master that I forgot to add to the aforementioned commit,
and at least one thing I messed up in conflict resolution.
2018-03-19 01:45:43 +11:00
Charles Dang
cbf34d2db3 Video: we don't need to record the refresh rate anymore
Once we get OpenGL rendering all set up, double buffering will limit the frame rate for us.
2018-03-19 01:42:17 +11:00
Charles Dang
b7a717ff70 Fixup build (add missing include) 2018-03-19 01:32:33 +11:00
Charles Dang
90b2a51c46 display general compilation fixes 2018-03-19 01:31:34 +11:00
Charles Dang
079ec37909 Display: removed old software blitting routines from scroll 2018-03-19 01:31:33 +11:00
Charles Dang
11054e93f1 GUI2/Canvas: some refactoring to correctly reimplement the shape caching mechanism
The purpose of the shape caching is essentially to allow multiple draws to consecutively add to
previously drawn content. It essentially adds another condition for clearing the texture prior
to rendering.

I also moved the shape list handling into the draw function itself so it's only executed once
if needed instead multiple times when calling functions like set_variable - not that it actually
would have done anything after the first call, but this allows me to keep the clearing-the-texture
code in one place.
2018-03-19 01:31:31 +11:00
Charles Dang
16842ea2a8 Game Display: formatting update 2018-03-19 01:31:30 +11:00
Charles Dang
56c733268e Game Display: reimplemented more functionality in draw_movement_info
Not completely done yet, still need to get some stuff working, but this gets rid of the old commented-out
code and puts stuff mostly in the right place.
2018-03-19 01:31:29 +11:00
Charles Dang
d5249333d4 Unit/Frame: fixed alpha mods being applied to all units of the same type 2018-03-19 01:31:28 +11:00
Charles Dang
3332ae9757 GUI2/Minimap: refactored drawing code
Instead of using the minimap surface method (which was getting converted from surface to texture every
draw cycle since the caching mechanism the canvas implemented wasn't available and the weird custom
cache the widget implemented itself didn't seem to do actually do anything) we use the new render-to-
canvas-texture method which is a lot cleaner and should be a lot faster. This also means we no longer
override styled_widget::impl_draw_background.

Do note I might use the design of the removed cache here to add some age functionality to the
font::pango_text cache.
2018-03-19 01:31:27 +11:00
Charles Dang
ae106b5091 GUI2/Canvas: allow the default draw routine (shape drawing) to be overridden
Previously widgets that wanted to implement custom drawing behavior overrode styled_widget::impl_draw_background
or impl_draw_foreground. Those functions in the base class simply called the canvas render methods. Some widgets
such as the minimap ignored that rendered the contents on their own.

This new method allows rendering directly to the canvas's texture, meaning all the caching and sizing is already
handled by the canvas and doesn't need to be done by the widget; everything's always the right size and redrawn
when necessary.
2018-03-19 01:31:26 +11:00
Charles Dang
6c09c2b269 Added new minimap drawing method that works wholly with textures
I've left the old getMinimap function alone and added a new function that will eventually replace it
that utilizes texture rendering to a given texture instead of relying on surface blits and scaling.
This has the benefit of, well, reducing surface ops, for one, as well as removing the need to create
a new texture from the minimap surface every time it's updated.
2018-03-19 01:30:38 +11:00
Charles Dang
8190d67152 Allow render_target_setter to restore the last target when destroyed 2018-03-19 01:30:37 +11:00
Jyrki Vesterinen
dde06909f0 Fix build with Visual Studio 2018-03-19 01:30:36 +11:00
Charles Dang
c7ed5559a0 GUI2/Canvas: optimized cached texture management
Instead of throwing out the cached texture every time the canvas was dirty, I've added a flag so that
only happens if its size has actually changed. There still seem to be some issues in GUI2 where canvas
objects keep getting reset, but I'm not sure why. Will have to look into that.

Anyway, the addition of the SDL_RenderClear call also seems to have fixed the weird graphics bleed-through
I was getting when running the game with the OGL driver.

I don't know if the canvas copy or move ctors are needed for anything. I added them for a test, but I'll
leave them for now in case I need them later.
2018-03-19 01:30:35 +11:00
Charles Dang
5e35f6dbfe Moved SDL_SetRenderDrawColor wrapper to utils file and added a second overload
Also renamed the function to a more colloquial version.
2018-03-19 01:30:34 +11:00
Charles Dang
028b4ee73c Halos: fixed incorrect drawing origin when at non-default zoom 2018-03-19 01:30:32 +11:00
Charles Dang
2ba020a746 Display: avoid temp vectors when rendering partial fog/shround images on hex 2018-03-19 01:30:31 +11:00
Charles Dang
eeece5e3c7 Display: exit render_scaled_to_zoom early if passed texture is null 2018-03-19 01:30:30 +11:00
Charles Dang
d9f284f926 Font/Pango Text: fixed a weird crash in Cairo
See added comment for details.
2018-03-19 01:30:29 +11:00
Charles Dang
8eba15bffc Refactored handling of window/renderer size getters
* Removed display::screen_area(), display::w(), and display::h().
* Moved the global screen_area() function into the CVideo class.
* Renamed CVideo::getx() and gety() to get_width() and get_height()
* Made those two functions return the result of screen_area() instead of the other way around.
* Added preliminary support for high-DPI rendering to screen_area()

Note on the last point: When I fixed bug #1772 (aa8f6c7e7 right now but will probably change with rebasing)
I noted that SDL_GetWindowSize and SDL_GetRendererOutputSize returned the same results for me (even with
Window's automatic scaling for non-high-DPI-enabled apps disabled) but that the SDL documentation stated the
former returned screen coordinates and the latter pixels. In that same commit I changed the dimension functions
to use SDL_GetWindowSize. I've now reversed that decision and gone back to using SDL_GetRendererOutputSize so
I can guarantee output in pixels. If use_pixels is false, the code will return coordinates in 96 DPI, so I need
to have pixel measurements for the calculations.

Again, though, I do not know if SDL_GetWindowSize returns a different value that pixel size (which it's said
to do) on macOS or iOS. I'll need to do some testing. It's possible on those platforms I won't need the 96 DPI
measurements, but it's also possible it will be needed on on platforms, since all of our code relies on pixel
measurements.
2018-03-19 01:29:41 +11:00
Charles Dang
63398733b0 Controller Base: removed unused process_focus_keydown_event event
This was used before the command console was converted to GUI2.
2018-03-19 01:29:39 +11:00
Charles Dang
0032395ccf Floating Label: keep local pango_text object static
This also means I need to set set_add_outline every time create_texture is called to make sure the
text renderer has the correct settings.
2018-03-19 01:29:38 +11:00
Charles Dang
c72ac0079d Display: fixed moving units drawing under foreground terrains 2018-03-19 01:29:37 +11:00
Charles Dang
54fd91cc55 SDL/Texture: avoid unnecessary shared_ptr creation
Made use of shared_ptr::reset instead of creating temp shared_ptrs, assigning them to the class ptr,
then deleting them.
2018-03-19 01:29:36 +11:00
Charles Dang
beae56a4ea Display: simplified a few things 2018-03-19 01:29:35 +11:00
Charles Dang
3376ef04e3 Another large batch of progress, primarily in game_display
This is primarily focused on getting various areas of the game display drawing, such as footstep images
and the terrain defense indicators.

To facilitate the last, I've refactored draw_text_in_hex to utilize floating labels instead of drawing
to hex directly with surfaces. This probably isn't the most optimal solution, since labels are continuously
created and destroyed, but since their text is usually short and cached in the rendered text cache it
does for now.

Also includes some cleanup of deprecated functions in display, and slight reordering of drawing order of
certain elements.
2018-03-19 01:29:34 +11:00
Charles Dang
92d51b866d Added RAII helper struct to manage a floating label's lifetime 2018-03-19 01:29:32 +11:00
Charles Dang
07844f471b Comment out an unused parameter
Not sure if we'll need this again (perhaps to delay draws mid-action) so I'm not removing it yet.
2018-03-19 01:29:31 +11:00
Charles Dang
f8e71f4d9a Display: avoid unnecessarily (potentially) creating millions of temp vectors
I've moved the terrain hex drawing code directly into draw_visible_hexes instead of relying on get_terrain_images
to return a vector of all the necessary images for each visible hex and then drawing them. Instead, we now draw
each hex's images immediately without any intermediary container.

With the old method, after about 10 to 15 seconds of drawing we had already allocated (and destroyed) almost 180,000
temporary vectors (a new one was created for each hex, twice per draw cycle). It's obvious how quickly that would add
up over a normal play session, and though in this case the performance hit for creating each vector was probably tiny,
creating them likely would have added up.
2018-03-19 01:29:30 +11:00
Charles Dang
e9a8813b67 Floating Labels: use new pango_text functionality for generating text outline 2018-03-19 01:29:29 +11:00
Charles Dang
9add86d745 Avoid temporary object when creating new textures from disk 2018-03-19 01:29:28 +11:00
Charles Dang
2f2adc6899 Some updates to the texture wrapper class
* Made reset() a public function
* Added an assign() function
* Don't try to destroy null textures
* Updated doc comments

I left assign() as just taking an SDL_Texture ptr since having it take a texture ref would be
functionally equivalent to operator=.
2018-03-19 01:29:27 +11:00
Charles Dang
8bb6f193a9 Font/Pango Text: add extra stroke to text outline to compensate for alpha weirdness
Also added the outline to the hash.
2018-03-19 01:29:24 +11:00
Charles Dang
1fd9a16a86 GUI2/Canvas: handle text alpha as a render-time op
This reduces the number of times the text itself needs to be rendered, especially for areas like the
story viewer where the only difference is alpha.
2018-03-19 01:26:20 +11:00
Charles Dang
3bf6768685 Floating Label: header formatting updates 2018-03-19 01:26:19 +11:00
Charles Dang
8647ff63c0 Added a texture cache for pango_text render output 2018-03-19 01:26:18 +11:00
Charles Dang
a0f8ad67a5 GUI2/Canvas: don't skip drawing if canvas texture is null 2018-03-19 01:26:16 +11:00
Charles Dang
9d90539fc7 Display: re-enable fps counter with :fps 2018-03-19 01:26:15 +11:00
Charles Dang
78bcd85d9f Display: cleaned up a bunch of now-unused/unnecessary members and functions 2018-03-19 01:26:14 +11:00
Charles Dang
cdb43343b4 Marked sdl_handler::draw overrides as final 2018-03-19 01:26:12 +11:00
Charles Dang
dadb31aadf Display: header formatting and doc updates
Appropriate functions were also marked deprecated.
2018-03-19 01:26:11 +11:00
Charles Dang
e422261518 Removed external calls to display::redraw_everything() 2018-03-19 01:26:10 +11:00
Charles Dang
35a9dc6084 Video: don't render null textures 2018-03-19 01:26:09 +11:00
Charles Dang
345fa27565 Display: work on refactoring the main drawing system
Previously, every visible hex was iterated over and every element in that hex draw. This was inefficient
for two reasons: First, it meant the performance footprint for many operations like unit drawing was O(n²),
since the list of elements had to be checked for every single hex. Second, it meant the renderer had to
switch active textures many more times than necessary.

My new system involved drawing every element of a specific type at once - ie, all background terrains at
once, all units, all items, etc. This reduces lookup time from O(n²) to O(n) and results in a noticeable
performance increase. It also reduces the number of times the renderer needs to switch active textures,
since bulk draws such as the map grid overlay are now done all at once while that specific texture is
active.

There are still some layering issues and missing elements that need to be sorted, especially in game_display.
2018-03-19 01:26:07 +11:00
Charles Dang
0d69cbad69 SDL/Texture: made info struct take a texture ptr directly
Will allow me to construct one directly from a pointer if I don't have a wrapper object.
2018-03-19 01:26:06 +11:00
Charles Dang
2cddf5e2c5 Fixed some bad drawing offsets and sizes when zoomed in
This fixes HP/XP bar size (wasn't scaled to zoom) and placement, as well as crown/orb and main sprite placement.
2018-03-19 01:26:05 +11:00
Charles Dang
a86ac0675f Display: removed old drawing code and external draw calls 2018-03-19 01:23:09 +11:00
Charles Dang
9850e47720 Removed animation invalidation code
This no longer actually does anything now that location invalidation is removed. If you follow the code
animation_component::invalidate called unit_animation::invalidate which was responsible for generating
the overlaped_hex_ set. Previously, this is what locations were invalidated. Now it didn't do anything.
2018-03-19 01:23:07 +11:00
Charles Dang
c5be598cd0 Display: removed all the invalidated locations code
This removes all the code related to invalidating locations, any functions used to set, modify, or propagate
location invalidation, and several functions that no longer serve any purpose anymore since their only purpose
was to handle invalidated locations.
2018-03-19 01:23:06 +11:00
Charles Dang
ffc064eca2 SDL/Window: throw exception if render-to-texture is not enabled
NOTE: for some reason, if I remove the `SDL_RENDERER_TARGETTEXTURE` flag from sdl::window's ctor
render_flags argument, this assertion still doesn't throw. Not sure if that means by GPU supports
it by default, or what.
2018-03-19 01:22:31 +11:00
Charles Dang
48d61611f8 Fixed halos drawing over fog and shroud (fixes #1406) 2018-03-19 01:22:29 +11:00
Charles Dang
d23d1ea338 Renamed drawing_buffer to drawing_queue
Also renamed drawing_queue::drawing_layer to just 'layer'.
2018-03-19 01:22:28 +11:00
Charles Dang
46eea05a67 Refactor and cleanup of the drawing dispatch system
Previously, drawing was handled with custom DRAW and DRAW_ALL events which individual event handlers
managed. DRAW was used for only-as-needed draws, and DRAW_ALL for drawing everything. As we've switched
to accelerated rendering, we've switched to the latter model all the time; everything is always drawn.

Both DRAW and DRAW_ALL events aren't needed anymore and have been removed. Instead, we simply call each
handler's draw() function directly from events::pump. The two main cases that handled draw events - the
display class and GUI2 - just forwarded the event handler calls to their respective draw() functions anyway.

Awhile back to unconditionally send draw events to the event queue constantly every 20 ms. However, to prevent
draw calls from becoming backed up, the queue already had code to remove all but 1 draw event from the queue
anyway, so the actual rate of drawing was still reliant on the rate at which events::pump was called. Therefor
this commit should result in no change at the rate the screen is drawn.
2018-03-19 01:22:26 +11:00
Charles Dang
b746829692 Improved console output on IPF fail
Yes, I know the duplicate code should be consolidated.
2018-03-19 01:22:24 +11:00
Charles Dang
085bd42974 Display: restrict render clip rect setter to map drawing scope only
This prevents tooltips from being cut off.
2018-03-19 01:22:23 +11:00
Charles Dang
f25a404f37 Refactored floating_label implementation
* Store label as a texture instead of creating a texture from a surface every draw cycle
* Restored expired label removal and alpha fadeout (was accidentally removed earlier in my refactoring)
* Use alpha field of bg_color member for background color
* Draw tooltip backgrounds procedurally instead of with surfaces and part of the label texture itself.
  See included comment for small caveat.
2018-03-19 01:22:21 +11:00
Charles Dang
2c9d9efb1d Floating Label: formatting update 2018-03-19 01:22:20 +11:00
Charles Dang
ed27b67f1e Port floating textbox/command console to GUI2
The old floating textbox was extremely entwined with the controller_base, play_controller, and menu_handler
classes. controller_base::have_keyboard_focus essentially controlled whether some events were executed based
on whether the floating textbox was open or not. Additionally, those events weren't even reached if a UI dialog
was open at all.

The new design features a singleton console class that can be called from anywhere, not just the game. I've also
decoupled the execution object from play_controller. The relevant functions in menu_handler are now passed to
the console as callbacks.

To work around map events such as clicking not being available if the console was open, I removed the exclusionary
is-in-dialog check from controller_base::handle_event and instead exit early out certain types of events using
controller_base::have_keyboard_focus. As mentioned in the accompanying comment, this isn't the best solution, but
it will do for now.

The new console also isn't fully feature-comparable with the old GUI1 one. The following are still missing:
* The checkbox, for use when sending messages.
* Tab completion.
* A crash occurs when existing the app if a game was exited with the console open.

I'm leaving the old floating_textbox code around for now for reference.
2018-03-19 01:22:18 +11:00
Charles Dang
770664d1f3 Added a getter for a static pango_text object
The reason I added this was so I can refactor some temporary pango_text objects out of the display class.
styled_widget doesn't use this for reasons explained in the comment.
2018-03-19 01:22:16 +11:00
Charles Dang
2dca404a63 Split texture caches into linear and NN scaled versions
With textures, you can't change render scale quality once they've been created. To rectify this, I've
made the texture caches a map of caches, sorted by scale quality. This should result in no performance
overhead, since an image is simply added to the appropriate quality cache on creation instead of in
a single cache. If a different version of a texture is needed it will be loaded later.

By default, load_texture will return images using nearest neighbor scaling. GUI2 always fetches images
using linear scaling. This is consistent with the old software rendering method. Plus, we don't have
any way (as of now) to specify the render quality on a per-image basis.
2018-03-19 01:22:14 +11:00
Charles Dang
6c04ae29b9 GUI2/Window: removed empty undraw() function
This was emptied earlier in my refactor when window unrendering was removed. I simply hadn't
removed the function yet.
2018-03-19 01:22:13 +11:00
Charles Dang
3154ab419f Restored alpha handling of unit frames
Still need to figure out the blending effects or submerge alpha.
2018-03-19 01:22:12 +11:00
Charles Dang
c406a2067f Refactored halo code to bring it in line with new drawing methods
This basically rips out all the unrendering and invalidation code. Neither is needed anymore.
Instead, we can have a simple, clean, "just draw the managed halos" interface.

Note there's an issue unrelated to this where halos aren't removed when a unit is killed with
the debug kill menu command.
2018-03-19 01:22:10 +11:00
Charles Dang
f7de368551 Added some inline wrappers for SDL_SetTexture* functions 2018-03-19 01:22:09 +11:00
Charles Dang
ca44435550 SDL/Window: removed pixel format member and promoted renderer info wholly to class member
The pixel format member was really rather useless, since SDL_RenderInfo returns an array of supported
formats and only the first one was being saved.
2018-03-19 01:22:08 +11:00
Charles Dang
855345291b GUI2: removed some unnecessary calls to canvas::set_is_dirty
The one in Outro was unnecessary since set_variable already calls set_is_dirty.
The one in the Story Viewer was there to deal with some background redraw issues which no longer appear
with the new drawing methods.
2018-03-19 01:22:06 +11:00
Charles Dang
8396b535c8 GUI2/Window: draw background image first instead of last
Originally was going to do this as workaround for the background tiling over the borders,
but I fixed the root cause of that instead. Still, this just makes more sense.
2018-03-19 01:22:05 +11:00
Charles Dang
c8f36d2758 GUI2/Canvas: set clip rect when tiling images
This fixes an issue where images could be tiled outside their desired size area.
2018-03-19 01:22:04 +11:00
Charles Dang
af861f7292 Allowed IPFs to work again when using the texture cache
See create_texture_from_sub_file doc comment for more info.
2018-03-19 01:22:03 +11:00
Charles Dang
8a82d43855 Some initial code (disabled for now) for setting up an OGL context
In the interests of getting this all done faster, I've decided to postpone work on the OGL implementation for now
and focus on the SDL_Renderer version. This contains some basic code (include-guarded) for setting up an OGL context
for the main SDL window.
2018-03-19 01:22:01 +11:00
Charles Dang
61dcb43ee6 GUI2/Canvas: refactor surface use out of image rendering
The only real reason to keep using a surface was in order to have resize mode manipulations. I've now added
texture-only handling methods (the tiling one was borrowed from display.cpp's draw_background function).
2018-03-19 01:21:12 +11:00
Charles Dang
01d78cbb7f Trim ToD images to hex 2018-03-19 01:21:11 +11:00
Charles Dang
1cb496d966 Extended implementation of the texture cache
Instead of always loading a surface at the same time, textures are now loaded directly from disk if applicable.
Instead, surfaces are only loaded if applicable to apply some effect that cannot as of now be done with texture
manipulation since we dont have shader support yet.

In that vein, I've also added two new texture caches, one for masked-to-hex images and one for ToD colored images.
2018-03-19 01:21:10 +11:00
Charles Dang
250bb0b3af GUI2/Canvas: fixed mirrored images being flipped on the wrong axis. 2018-03-19 01:21:08 +11:00
Charles Dang
d748cbcd23 Units: fixed bad HP/XP bars fill rect offset 2018-03-19 01:21:07 +11:00
Charles Dang
37bcade3a1 Removed most call to raise_draw_event
These don't seem necessary anymore since draw handling happens per-frame and doesn't rely
on calling derived class's draw() member.
2018-03-19 01:21:06 +11:00
Charles Dang
d427bf1e65 Enabled more stuff drawing
Hex overlay, map items, fog/shroud transitions.
2018-03-19 01:21:05 +11:00
Charles Dang
643ebe221f Got a bunch more components drawing
Reachmaps, attack indicators, shroud/fog (incomplete).
2018-03-19 01:21:04 +11:00
Charles Dang
66f2d3f49c Video: removed unused arguments from make_test_fake 2018-03-19 01:21:03 +11:00
Charles Dang
e205e42d44 Video: (almost) completely removed framebuffer surface
Again, useless since there's no more window surface with accelerated rendering.
getSurface() remains since it's still used in quite a lot of places. Will removed ASAP.
2018-03-19 01:21:01 +11:00
Charles Dang
ea395c1fb5 Removed draw() calls into the display class
Not needed anymore since per-frame drawing is handled within said class.
2018-03-19 01:17:07 +11:00
Charles Dang
42894f6ac3 Another huge chunk of progress 2018-03-19 01:17:05 +11:00
Charles Dang
d614c71786 Uint: fixed bad bar alpha on unit mouseover 2018-03-19 01:16:30 +11:00
Charles Dang
b8a03da847 Fixed play_controller not joining current event context
Was broken when I moved the GUI2 drawing trigger code to global scope probably.
2018-03-19 01:16:29 +11:00
Charles Dang
ba9a0f7550 GUI2/Canvas: made use of CVideo::render_copy 2018-03-19 01:16:28 +11:00
Charles Dang
6fbc2491ea Video: expand render_copy to take flip arguments
Still needs to handle rotation.
2018-03-19 01:16:24 +11:00
Charles Dang
6fdf1bcc88 Draw units under bars/orbs/etc 2018-03-19 01:16:03 +11:00
Charles Dang
c52a2a1b75 GUI2: moved event handling into main context
Not sure why I need to call join() in connect() instead of the ctor, though.
2018-03-19 01:16:02 +11:00
Charles Dang
d2087a14c4 Initial refactor for main-screen accelerated rendering 2018-03-19 01:16:01 +11:00
Charles Dang
8dc661db40 Decoupled drawing buffer code from display class 2018-03-19 01:14:02 +11:00
Charles Dang
e30a2aa520 Added static prototype for GUI2 in-game theme 2018-03-19 01:14:00 +11:00
Charles Dang
758ad0bf23 GUI2/Miniap: draw any provided canvas data before the minimap 2018-03-19 01:13:59 +11:00
Charles Dang
441ec38adf Moved GUI2's per-frame drawing trigger to global scope
This is derived from work originally done by @aginor (48bcb277d4). I cherry-picked that commit and made a few alterations.
2018-03-19 01:13:58 +11:00
Charles Dang
eaac01c9a2 Enabled drawing of minimap in-game 2018-03-19 01:13:56 +11:00
Charles Dang
e7d1c970bc GUI2/Canvas: disable surface manip w/ accelerated rendering for stretch resize mode
RenderCopy handles that automatically.
2018-03-19 01:13:55 +11:00
Charles Dang
2d39d19af9 Texture: converted internal handling to use a shared_ptr
This allows multiple texture objects to refer to the same texture without destroying them prematurely.
This is different from the SDL_Surface wrapper's implementation since surfaces have their own internal
refcounting system; textures do not.
2018-03-19 01:13:54 +11:00
Charles Dang
3e2046b5d8 Added a texture cache
Note this probably doesn't work properly yet since I haven't properly implemented shared management
of textures in their wrapper class.
2018-03-19 01:13:53 +11:00
Charles Dang
da7917955b Use get_renderer() over *get_window()
This doesn't appear to have been an issue in the rectangle drawing code at least, but it should guard
against possible segfaults in the future.
2018-03-19 01:13:52 +11:00
Charles Dang
4a0f8d9db0 CVideo: convert blit_surface to handle input as textures instead of blitting to framebuffer 2018-03-19 01:13:51 +11:00
Charles Dang
81a62bf49c Moved renderer RAII helpers to their own file and added ones for clip rect and viewport
Do note that setting an empty rect in render_raii_rect_setter_base is not the same as passing nullptr.
If an empty rect is passed to SDL_RenderGetClipRect, for example, you can end up with nothing drawing
since everything is being clipped.
2018-03-19 01:13:49 +11:00
Charles Dang
a710d6d457 GUI2/Minimap: quick fix to get the minimap drawing again 2018-03-19 01:13:48 +11:00
Charles Dang
56a793c086 Added SDL_Texture wrapper class and some utility functions 2018-03-19 01:13:47 +11:00
Charles Dang
5c430f6096 GUI2/Canvas: add error logging if canvas texture creation fails 2018-03-19 01:13:46 +11:00
Charles Dang
894e9b6b3e Small code simplification 2018-03-19 01:13:44 +11:00
Charles Dang
aa2f266e87 GUI2/Canvas: removed surface_lock objects
The canvas surface isn't even passed to these functions anymore so I have no idea how this built.
2018-03-19 01:13:43 +11:00
Charles Dang
94f9303bde Removed some debug output
[ci skip]
2018-03-19 01:13:42 +11:00
Charles Dang
48d072a02e GUI2: refactored viewport setting and re-added clip rect setting
It turns out I had removed the clip rect setting in error; it prevented items in, say, a listbox from drawing
outside the widget's boundaries. I've re-added that now.

I've also moved viewport setting to the same place. It turns out it didn't need to be set every canvas draw.
The only reason the old code was passing the blitting rect to the canvas was it was needed for the sdl_blit call.
Since I can now set the viewport independent of a canvas state, there's no longer a need to set the viewport in
the canvas.
2018-03-19 01:13:41 +11:00
Charles Dang
78271d2302 Hack to get text to render right 2018-03-19 01:13:40 +11:00
Charles Dang
eb671aec48 GUI2: removed framebuffer code from draw impl functions 2018-03-19 01:13:38 +11:00
Charles Dang
c926ce76e0 GUI2/Canvas: renamed blit function and removed surface argument 2018-03-19 01:13:37 +11:00
Charles Dang
c6ed3f018e GUI2: removed dirty widget interface
This is no longer needed since we redraw everything every frame. The dirty flag in the canvas remains
as that controls whether the cached texture is used or recreated.
2018-03-19 01:13:36 +11:00
Charles Dang
7632004979 GUI2/Modal Dialog: removed set_restore interface
This was used to set the restore argument of gui2:🪟:show. It's not needed anymore
since the window class no longer uses surface restoring.
2018-03-19 01:13:34 +11:00
Charles Dang
ec2913ab3c GUI2/Window: removed restore flag and restorer surface 2018-03-19 01:13:33 +11:00
Charles Dang
4e2b34a5f2 GUI2/Window: re-implement drawing and removed commented-out restore code
We don't need all this dirty list or handling or surface restoration anymore.
2018-03-19 01:13:24 +11:00
Charles Dang
41f921bd38 GUI2/Canvas: refactor surface blitting out of drawing routines
This entirely refactors surface blitting out of the canvas. Instead, each canvas owns a texture. This texture
is completely redrawn any time the canvas if marked dirty, else the result is cached and drawn to the screen
each draw cycle.

All windows are now redrawn every draw cycle. The use of the cached canvas textures means there's no noticeable
performance difference (likely a performance gain, actually) from using surface blitting.

There's still some code to clean up and a few things to fix.
2018-03-19 01:13:23 +11:00
Charles Dang
1a24fd5872 Video: enabled accelerated rendering with texture target access 2018-03-19 01:13:21 +11:00
Charles Dang
e558044855 SDL/Window: set render scaling method to linear
This looks better than NN scaling (default);
2018-03-19 01:13:20 +11:00
Charles Dang
aa09dec0f3 Cleaned up one remaining use of HAVE_CXX14 and removed the macro altogether 2018-03-19 00:25:02 +11:00
Charles Dang
c1fcba17b7 Removed the type trait alias wrappers
This completely removes the wrappers for aliases included in c++14. It also enables
use of the value alias wrappers, since we now have variable templates.
2018-03-19 00:25:00 +11:00
Charles Dang
a57192db28 Removed HAVE_REF_QUALIFERS, HAVE_INHERITING_CTORS, and USE_HETEROGENOUS_LOOKUPS
Any code guarded by the first or last is now enabled by default. The second was unused.
2018-03-19 00:24:59 +11:00
Charles Dang
80c2d1a405 Used std::put time everywhere
The utils::put_time wrapper was only for GCC 4.x.
2018-03-19 00:24:58 +11:00
Charles Dang
8120843b2e Used constexpr and noexcept keywords directly
We can do this now since were bumping min compiler support.
2018-03-19 00:24:57 +11:00
ln-zookeeper
3cea4790b8 UtBS: Corrected Sun Singer movetype from float to foot 2018-03-18 14:30:02 +02:00
Jyrki Vesterinen
3555b6278c Update Visual Studio project file to VS2015 toolset
I also enabled /DEBUG:FASTLINK and /LTCG:incremental to speed up compile
times. VS2015 introduces support for both switches.
2018-03-18 11:57:14 +02:00
Charles Dang
0094a19e85 Post-release version bump
The stable 1.14 branch has now diverged, and master is back in development mode for
the 1.15 series. Therefor, bumping to 1.15.0-dev here on master.
2018-03-18 18:51:11 +11:00
3635 changed files with 185081 additions and 227883 deletions

View file

@ -1,29 +0,0 @@
version: Wesnoth-VS2013-{branch}-{build}
clone_folder: C:\projects\wesnoth
image: Visual Studio 2013
configuration:
- Release
- Debug
platform: win32
skip_branch_with_pr: true
shallow_clone: true
matrix:
fast_finish: true # Stop after a build failure
before_build:
- cd ..
- ps: wget https://github.com/aquileia/external/archive/VC12.zip -O VC12.zip
- 7z x VC12.ZIP
- ren external-VC12 external
- cd wesnoth
- set PATH=C:\projects\external\dll;%PATH%
notifications:
- provider: Webhook
url: http://ai0867.net:6661/wesnoth
headers:
User-Agent: WesnothAppveyor/1.0
Version: vs2013
Num-Versions: 3
Authorization: TODO
on_build_success: true
on_build_failure: true

View file

@ -15,11 +15,6 @@ before_build:
- 7z x VC14.ZIP
- ren external-VC14 external
- cd wesnoth
- mkdir projectfiles\VC14
- xcopy /E /I /H /Y projectfiles\VC12 projectfiles\VC14
- cd projectfiles\VC14
- "\"c:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe\" wesnoth.sln /upgrade"
- cd ..\..
- set PATH=C:\projects\external\dll;%PATH%
build_script:
- msbuild projectfiles\VC14\wesnoth.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

View file

@ -17,7 +17,7 @@ before_build:
- cd wesnoth
- set PATH=C:\projects\external\dll;%PATH%
build_script:
- msbuild projectfiles\VC12\wesnoth.sln /property:PlatformToolset=v141 /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild projectfiles\VC14\wesnoth.sln /property:PlatformToolset=v141 /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
artifacts:
- path: wesnoth.exe

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.git

3
.gitignore vendored
View file

@ -49,7 +49,7 @@ projectfiles/**/*objs*
# Visual Studio
projectfiles/VC*
!projectfiles/VC12
!projectfiles/VC14
projectfiles/VC*/.vs/
projectfiles/VC*/*.vc.*db
projectfiles/VC*/*.sdf
@ -186,6 +186,7 @@ data/campaigns/**/images/**/.gitignore
[Tt]humbs.db
*Neuer Ordner*
.directory
fonts/.uuid
# extensions
*.pyc

View file

@ -11,27 +11,28 @@ cache:
matrix:
include:
- compiler: clang
env: TOOL=scons CXXSTD=11 NLS=true
- compiler: gcc
env: CXXSTD=14 NLS=true LTS=1604 BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=14 NLS=false
env: TOOL=scons CXXSTD=17 NLS=false LTS=1804 BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: gcc
env: TOOL=cmake CXXSTD=11 NLS=false
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1604 BRANCH=master
- compiler: clang
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: clang
env: TOOL=cmake CXXSTD=11 NLS=false
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1604 BRANCH=master
- os: osx
compiler: clang
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
osx_image: xcode8.3
env: TOOL=scons CXXSTD=14 NLS=false OPT=-O0
- os: osx
compiler: clang

View file

@ -1,4 +1,4 @@

# set minimum version
cmake_minimum_required(VERSION 2.8.5)
@ -56,26 +56,20 @@ option(ENABLE_SERVER "Enable compilation of MP server" ON)
option(ENABLE_MYSQL "Enable building MP/add-ons servers with mysql support" OFF)
option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of translations" ${ENABLE_GAME})
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
option(ENABLE_LIBPNG "Enable support for writing png files (screenshots, images)" ON)
option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)
if(NOT CMAKE_CROSSCOMPILING)
try_run(IEEE754_TEST_RETURN_CODE IEEE754_TEST_COMPILED ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/compile_time_tests/ieee_754.cpp
CMAKE_FLAGS "-DCMAKE_CXX_STANDARD=11" COMPILE_OUTPUT_VARIABLE IEEE754_TEST_COMPILE_OUTPUT)
if(NOT IEEE754_TEST_COMPILED)
message(WARNING "Failed to compile the IEEE 754 test. Skipping it.")
message(${IEEE754_TEST_COMPILE_OUTPUT})
elseif(NOT IEEE754_TEST_RETURN_CODE EQUAL 0)
message(FATAL_ERROR "Your platform does not represent floating point numbers in the IEEE 754 format.")
endif()
else()
message(WARNING "You are cross-compiling. Skipping IEEE 754 test.")
# set what std version to use
if(NOT CXX_STD)
set(CXX_STD "14")
endif()
find_package(SDL2 2.0.4 REQUIRED)
if(ENABLE_GAME OR ENABLE_TESTS)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SDL2 2.0.4 REQUIRED)
endif(ENABLE_GAME OR ENABLE_TESTS)
find_package(Crypto 1.0 REQUIRED)
find_package(Boost 1.56 REQUIRED COMPONENTS iostreams program_options regex system thread random)
find_package(Boost 1.56 REQUIRED COMPONENTS iostreams program_options regex system random)
# no, gettext executables are not required when NLS is deactivated
find_package(Gettext)
@ -152,6 +146,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(ENABLE_APPDATA_FILE "enable installation of an appdata file for appstream" ON)
endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(HARDEN "Whether to enable options to harden the executables" ON)
option(ENABLE_STRICT_COMPILATION "Sets the strict compilation mode" OFF)
option(ENABLE_PEDANTIC_COMPILATION "Sets the pedantic compilation mode" OFF)
option(ENABLE_DEBUG_WINDOW_LAYOUT "Add the debug option to allow the generation of debug layout files in dot format" OFF)
@ -199,7 +194,7 @@ if(NOT DEFINED CXX_FLAGS_USER)
endif(NOT DEFINED CXX_FLAGS_USER)
set(COMPILER_FLAGS "-std=c++11 -Wall -Wextra -Werror=non-virtual-dtor -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wold-style-cast")
set(COMPILER_FLAGS "-std=c++${CXX_STD} -Wall -Wextra -Werror=non-virtual-dtor -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wold-style-cast -Wtrampolines")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Qunused-arguments -Wno-unknown-warning-option -Wmismatched-tags -Wno-conditional-uninitialized")
@ -225,6 +220,14 @@ if(ENABLE_PEDANTIC_COMPILATION)
endif(ENABLE_PEDANTIC_COMPILATION)
# check for sanitizer options
if(SANITIZE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsanitize=${SANITIZE}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZE}")
# manually disable some optimizations to get better stacktraces if sanitizers are used
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls")
endif(SANITIZE)
### Set the final compiler flags.
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
@ -240,6 +243,20 @@ if(NOT "${CMAKE_CXX_FLAGS}" STREQUAL "${COMPILER_FLAGS}")
)
endif(NOT "${CMAKE_CXX_FLAGS}" STREQUAL "${COMPILER_FLAGS}")
# check for hardening options
if(HARDEN AND NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -fstack-protector-strong")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -fstack-protector-strong")
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -Wl,-pie")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie -Wl,-z,relro,-z,now")
endif()
add_definitions(-D_FORTIFY_SOURCE=2)
endif(HARDEN AND NOT WIN32)
if(UNIX AND NOT CMAKE_COMPILER_IS_GNUCXX)
# Assume the compiler is the clang compiler.
set(CMAKE_EXE_LINKER_FLAGS "-lstdc++ -lm ${CMAKE_EXE_LINKER_FLAGS}")
@ -265,14 +282,43 @@ RemoveFlag(CMAKE_C_FLAGS_MINSIZEREL CACHE "-DNDEBUG" "Default C flags for MinSiz
RemoveFlag(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS SCRIPT "-rdynamic" "")
RemoveFlag(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS SCRIPT "-rdynamic" "")
# #
# Determine optimization level
# #
if(NOT OPT)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_C_FLAGS_DEBUG "-O0")
if(PROFILER STREQUAL "perf")
set(CMAKE_CXX_FLAGS_PROFILE "-Og")
set(CMAKE_C_FLAGS_PROFILE "-Og")
else(PROFILER STREQUAL "perf")
set(CMAKE_CXX_FLAGS_PROFILE "-O0")
set(CMAKE_C_FLAGS_PROFILE "-O0")
endif(PROFILER STREQUAL "perf")
else(NOT OPT)
set(CMAKE_CXX_FLAGS_RELEASE "${OPT}")
set(CMAKE_C_FLAGS_RELEASE "${OPT}")
set(CMAKE_CXX_FLAGS_DEBUG "${OPT}")
set(CMAKE_C_FLAGS_DEBUG "${OPT}")
set(CMAKE_CXX_FLAGS_PROFILE "${OPT}")
set(CMAKE_C_FLAGS_PROFILE "${OPT}")
endif(NOT OPT)
# #
# Start determining options for Release build
# #
# reset the base Release build option
MESSAGE("Replacing default flags used for Release build with -O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
MESSAGE("Replacing default flags used for Release build with ${OPT} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE)
# set the arch to use for Release build if provided
if(ARCH)
@ -369,9 +415,9 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_SOURCE_
# replace the default Debug flag of -g with -O0 -DDEBUG -ggdb3
# this matches the flags of scons' debug build
MESSAGE("Replacing flags used for Debug build -O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
MESSAGE("Replacing flags used for Debug build ${OPT} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_DEBUG}" CACHE STRING "" FORCE)
# adds GLIBCXX_DEBUG definitions
@ -388,29 +434,29 @@ endif(GLIBCXX_DEBUG)
if(PROFILER STREQUAL "gprof" OR NOT PROFILER)
MESSAGE("Profiler is gprof")
set(CMAKE_CXX_FLAGS_PROFILE "-pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "gcov")
MESSAGE("Profiler is gcov")
set(CMAKE_CXX_FLAGS_PROFILE "-fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "gperftools")
MESSAGE("Profiler is gperftools")
set(CMAKE_CXX_FLAGS_PROFILE "${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-Wl,--no-as-needed,-lprofiler ${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "perf")
MESSAGE("Profiler is perf")
set(CMAKE_CXX_FLAGS_PROFILE "-ggdb -Og ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-ggdb -Og ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -ggdb ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -ggdb ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
@ -443,12 +489,6 @@ if(DEFAULT_PREFS_FILE)
endif(NOT DEFAULT_PREFS_FILE MATCHES "^/")
endif(DEFAULT_PREFS_FILE)
if(ENABLE_OMP)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_C_FLAGS}")
endif(ENABLE_OMP)
if(ENABLE_DEBUG_WINDOW_LAYOUT)
add_definitions(-DDEBUG_WINDOW_LAYOUT_GRAPHS)
endif(ENABLE_DEBUG_WINDOW_LAYOUT)
@ -463,7 +503,6 @@ endif(ENABLE_GAME OR ENABLE_TESTS)
if(ENABLE_GAME OR ENABLE_TESTS)
find_package( SDL2_mixer 2.0.0 REQUIRED )
find_package( SDL2_ttf 2.0.12 REQUIRED )
find_package(VorbisFile REQUIRED)
find_package( PkgConfig REQUIRED )
pkg_check_modules( CAIRO REQUIRED cairo>=1.10 )
@ -497,13 +536,6 @@ if(ENABLE_GAME)
unset(LIBDBUS_FOUND CACHE)
endif()
find_package( PNG )
if(ENABLE_LIBPNG AND PNG_FOUND)
add_definitions(-DHAVE_LIBPNG)
else(ENABLE_LIBPNG AND PNG_FOUND)
message("Could not find lib PNG. Disabling support for writing PNG images.")
endif(ENABLE_LIBPNG AND PNG_FOUND)
find_package( History )
if(ENABLE_HISTORY AND HISTORY_FOUND)
add_definitions(-DHAVE_HISTORY)
@ -520,9 +552,11 @@ if(ENABLE_POT_UPDATE_TARGET)
endif(ENABLE_POT_UPDATE_TARGET)
# get languages
file(READ po/LINGUAS LINGUAS)
string(REPLACE "\n" "" LINGUAS ${LINGUAS})
separate_arguments(LINGUAS)
if(ENABLE_NLS)
file(READ po/LINGUAS LINGUAS)
string(REPLACE "\n" "" LINGUAS ${LINGUAS})
separate_arguments(LINGUAS)
endif(ENABLE_NLS)
#
# Include subdirectories

View file

@ -38,7 +38,7 @@ PROJECT_NAME = "The Battle for Wesnoth"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.13.12
PROJECT_NUMBER = 1.15.0-dev
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View file

@ -10,8 +10,8 @@ Contents
## 1. Prerequisites
Wesnoth requires a compiler with sufficient C++11 support such as GCC 4.8 and
later, or Clang 3.3 and later.
Wesnoth requires a compiler with sufficient C++14 support such as GCC 5.0 and
later, or Clang 3.8 and later.
You'll need to have these libraries and their development headers installed in
order to build Wesnoth:
@ -30,7 +30,6 @@ order to build Wesnoth:
* SDL2 >= 2.0.4
* SDL2_image >= 2.0.0 (with PNG and JPEG support)
* SDL2_mixer >= 2.0.0 (with Ogg Vorbis support)
* SDL2_ttf >= 2.0.12
* Fontconfig >= 2.4.1
* Cairo >= 1.10.0
* Pango >= 1.22.0 (with Cairo backend)
@ -52,17 +51,11 @@ features:
Bidirectional text support for RTL languages (Hebrew, etc.) in some parts
of the user interface.
* Growl
Desktop notifications on OS X, particularly on 10.7.
Although not recommended, you may use libintl on platforms other than Windows
instead of Boost.Locale. For scons, set the `libintl` option to `true`.
## 2. Build Environment
You can obtain the source code tarball for the latest version from
<http://www.wesnoth.org/downloads>.
<https://www.wesnoth.org/downloads>.
Before building, make sure to untar the package and change into the newly
created directory:
@ -79,7 +72,7 @@ The following build systems are fully supported for compiling Wesnoth on Linux,
*BSD, and other Unix-like platforms:
* SCons >= 0.98.3
* CMake >= 2.6.0
* CMake >= 2.8.5
You will also need to have a working installation of GNU gettext to build the
translations.
@ -182,13 +175,10 @@ Some of the most important options follow.
CMAKE_BUILD_TYPE=<build type> (CMake)
Selects a specific build configuration when compiling. `release` produces
the default, optimized (-O2) build for regular use. `debug` produces a
the default, optimized (-O3) build for regular use. `debug` produces a
slower and larger unoptimized (-O0) build with full debug symbols, which is
often needed for obtaining detailed backtraces when reporting bugs.
NOTE: By default, CMake will produce `debug` builds unless a different
configuration option is passed in the command line.
* ENABLE_GAME=<boolean> (CMake)
Whether to build the game client binary. Use command line target selection

View file

@ -23,7 +23,7 @@ Please see the wiki for information regarding The Battle for Wesnoth's licensing
Installing
----------
See INSTALL for instructions on how to build the game from source code.
See INSTALL.md for instructions on how to build the game from source code.
More Information

View file

@ -69,6 +69,5 @@ KNOWN BUGS
[list]
[*]Trackpad tap clicking is sometimes not recognized ([url=http://forums.wesnoth.org/viewtopic.php?f=4&t=39788]forum post[/url]).
[*]Unofficial builds with OpenMP support enabled randomly freeze (bug [issue]1260[/issue]).
[/list]
[/raissue]

View file

@ -55,6 +55,8 @@ opts.AddVariables(
('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""),
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', False),
('arch', 'What -march option to use for build=release, will default to pentiumpro on Windows', ""),
('opt', 'override for the build\'s optimization level', ""),
BoolVariable('harden', 'Whether to enable options to harden the executables', True),
BoolVariable('glibcxx_debug', 'Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC for build=debug', False),
EnumVariable('profiler', 'profiler to be used for build=profile', "gprof", ["gprof", "gcov", "gperftools", "perf"]),
EnumVariable('pgo_data', 'whether to generate profiling data for PGO, or use existing profiling data', "", ["", "generate", "use"]),
@ -79,7 +81,6 @@ opts.AddVariables(
PathVariable('python_site_packages_dir', 'sets the directory where python modules are installed', "lib/python/site-packages/wesnoth", PathVariable.PathAccept),
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
BoolVariable('png', 'Clear to disable writing png files for screenshots, images', True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', "", PathVariable.PathAccept),
PathVariable('default_prefs_file', 'default preferences file name', "", PathVariable.PathAccept),
@ -108,8 +109,7 @@ opts.AddVariables(
BoolVariable('ccache', "Use ccache", False),
('ctool', 'Set c compiler command if not using standard compiler.'),
('cxxtool', 'Set c++ compiler command if not using standard compiler.'),
EnumVariable('cxx_std', 'Target c++ std version', '11', ['11', '1y', '14']),
BoolVariable('openmp', 'Enable openmp use.', False),
EnumVariable('cxx_std', 'Target c++ std version', '14', ['14', '17']),
('sanitize', 'Enable clang and GCC sanitizer functionality. A comma separated list of sanitize suboptions must be passed as value.', ''),
BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False),
BoolVariable("lockfile", "Create a lockfile to prevent multiple instances of scons from being run at the same time on this working copy.", False),
@ -182,6 +182,9 @@ if env['ccache']: env.Tool('ccache')
boost_version = '1.56.0'
def SortHelpText(a, b):
return (a > b) - (a < b)
Help("""Arguments may be a mixture of switches and targets in any order.
Switches apply to the entire build regardless of where they are in the order.
Important switches include:
@ -232,7 +235,7 @@ specifying --option-cache=FILE command line argument. Current option values can
If you set CXXFLAGS and/or LDFLAGS in the environment, the values will
be appended to the appropriate variables within scons.
""" + opts.GenerateHelpText(env))
""" + opts.GenerateHelpText(env, sort=SortHelpText))
if GetOption("help"):
Return()
@ -305,7 +308,7 @@ def Warning(message):
from metasconf import init_metasconf
configure_args = dict(
custom_tests = init_metasconf(env, ["ieee_754", "cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua"]),
custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua", "gl"]),
config_h = "$build_dir/config.h",
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")
@ -335,13 +338,6 @@ if env["prereqs"]:
conf.CheckLib("m")
conf.CheckFunc("round")
def CheckIEEE754(conf):
if not env["host"]:
return conf.CheckIEEE754()
else:
Warning("You are cross-compiling. Skipping IEEE 754 test.")
return True
def CheckAsio(conf):
if env["PLATFORM"] == 'win32':
conf.env.Append(LIBS = ["libws2_32"])
@ -355,12 +351,13 @@ if env["prereqs"]:
def have_sdl_other():
return \
conf.CheckSDL(require_version = '2.0.4') & \
conf.CheckSDL("SDL2_ttf", header_file = "SDL_ttf") & \
conf.CheckSDL("SDL2_mixer", header_file = "SDL_mixer") & \
conf.CheckSDL("SDL2_image", header_file = "SDL_image")
if sys.platform == "msys":
env["PKG_CONFIG_FLAGS"] = "--dont-define-prefix"
have_server_prereqs = (\
CheckIEEE754(conf) & \
conf.CheckCPlusPlus(gcc_version = "4.8") & \
conf.CheckLib("libcrypto") & \
conf.CheckBoost("iostreams", require_version = boost_version) & \
@ -368,9 +365,9 @@ if env["prereqs"]:
conf.CheckBoostIostreamsBZip2() & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
CheckAsio(conf) & \
conf.CheckBoost("thread", require_version = boost_version) & \
conf.CheckBoost("filesystem") \
and Info("Base prerequisites are met")) \
or Warning("Base prerequisites are not met")
@ -378,6 +375,9 @@ if env["prereqs"]:
conf.CheckBoostLocaleBackends(["icu", "winapi"]) \
or Warning("Only icu and winapi backends of Boost Locale are supported. Bugs/crashes are very likely with other backends")
if env['harden']:
env["have_fortify"] = conf.CheckFortifySource()
env = conf.Finish()
client_env = env.Clone()
@ -387,6 +387,8 @@ if env["prereqs"]:
conf.CheckOgg())) & \
conf.CheckPNG() & \
conf.CheckJPG() & \
conf.CheckOpenGL() and \
conf.CheckGLEW() and \
conf.CheckCairo(min_version = "1.10") & \
conf.CheckPango("cairo", require_version = "1.22.0") & \
conf.CheckPKG("fontconfig") & \
@ -407,10 +409,6 @@ if env["prereqs"]:
if client_env['fribidi']:
client_env.Append(CPPDEFINES = ["HAVE_FRIBIDI"])
env["png"] = env["png"] and conf.CheckLib("png")
if env["png"]:
client_env.Append(CPPDEFINES = ["HAVE_LIBPNG"])
env["history"] = env["history"] and (conf.CheckLib("history") or Warning("Can't find GNU history, disabling history support."))
if env["history"]:
client_env.Append(CPPDEFINES = ["HAVE_HISTORY"])
@ -473,10 +471,7 @@ for env in [test_env, client_env, env]:
env.AppendUnique(CXXFLAGS = Split("-Wdocumentation -Wno-documentation-deprecated-sync"))
if "gcc" in env["TOOLS"]:
if env['openmp']:
env.AppendUnique(CXXFLAGS = ["-fopenmp"], LIBS = ["gomp"])
env.AppendUnique(CCFLAGS = Split("-Wno-unused-local-typedefs -Wno-maybe-uninitialized"))
env.AppendUnique(CCFLAGS = Split("-Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wtrampolines"))
env.AppendUnique(CXXFLAGS = Split("-Wold-style-cast"))
if env['strict']:
@ -486,12 +481,45 @@ for env in [test_env, client_env, env]:
env.AppendUnique(CXXFLAGS = Split("-Wctor-dtor-privacy -Wuseless-cast -Wnoexcept"))
if env['sanitize']:
env.AppendUnique(CCFLAGS = ["-fsanitize=" + env["sanitize"]], LINKFLAGS = ["-fsanitize=" + env["sanitize"]])
env.AppendUnique(CCFLAGS = Split("-fno-omit-frame-pointer -fno-optimize-sibling-calls"))
# #
# Determine optimization level
# #
if not env["opt"]:
if env["build"] == "release":
env["opt"] = "-O3 "
elif env["build"] == "profile" and env["profiler"] == "perf":
env["opt"] = "-Og "
else:
env["opt"] = "-O0 "
else:
env["opt"] = env["opt"]+" "
# #
# Add options to provide more hardened executables
# osx doesn't seem to support RELRO
# windows' tdm-gcc doesn't seem to provide good support for the hardening options in general
# #
if env['harden'] and env["PLATFORM"] != 'win32':
env.AppendUnique(CCFLAGS = ["-fPIE", "-fstack-protector-strong"])
if not env["have_fortify"] : env.AppendUnique(CPPDEFINES = ["_FORTIFY_SOURCE=2"])
if env["enable_lto"] == True:
env.AppendUnique(LINKFLAGS = ["-fstack-protector-strong"])
if env["PLATFORM"] == 'darwin':
env.AppendUnique(LINKFLAGS = ["-fPIE", "-Wl,-pie"])
else:
env.AppendUnique(LINKFLAGS = ["-fPIE", "-pie", "-Wl,-z,relro,-z,now"])
# #
# Start determining options for debug build
# #
debug_flags = "-O0 -DDEBUG -ggdb3"
debug_flags = env["opt"]+"-DDEBUG -ggdb3"
if env["glibcxx_debug"] == True:
glibcxx_debug_flags = "_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC"
@ -504,7 +532,7 @@ for env in [test_env, client_env, env]:
# #
# default compiler flags
rel_comp_flags = "-O3"
rel_comp_flags = env["opt"]
rel_link_flags = ""
# use the arch if provided, or if on Windows and no arch was passed in then default to pentiumpro
@ -543,25 +571,29 @@ for env in [test_env, client_env, env]:
rel_comp_flags = rel_comp_flags + " -flto=thin"
rel_link_flags = rel_comp_flags + " -fuse-ld=lld"
# Enable ASLR and NX bit support on mingw
if "mingw" in env["TOOLS"]:
rel_link_flags += "-Wl,--dynamicbase -Wl,--nxcompat"
# #
# End setting options for release build
# Start setting options for profile build
# #
if env["profiler"] == "gprof":
prof_comp_flags = "-pg"
prof_comp_flags = env["opt"]+"-pg"
prof_link_flags = "-pg"
if env["profiler"] == "gcov":
prof_comp_flags = "-fprofile-arcs -ftest-coverage"
prof_comp_flags = env["opt"]+"-fprofile-arcs -ftest-coverage"
prof_link_flags = "-fprofile-arcs"
if env["profiler"] == "gperftools":
prof_comp_flags = ""
prof_comp_flags = env["opt"]
prof_link_flags = "-Wl,--no-as-needed,-lprofiler"
if env["profiler"] == "perf":
prof_comp_flags = "-ggdb -Og"
prof_comp_flags = env["opt"]+"-ggdb"
prof_link_flags = ""
# #
@ -580,7 +612,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "iconv", "z", "shlwapi", "winmm"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0501"])
env.Append(LIBS = ["wsock32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI
@ -746,11 +778,11 @@ if 'dist' in COMMAND_LINE_TARGETS: # Speedup, the manifest is expensive
def dist_manifest():
"Get an argument list suitable for passing to a distribution archiver."
# Start by getting a list of all files under version control
lst = subprocess.check_output("git ls-files | grep -v 'data\/test\/.*' | awk '/^[^?]/ {print $4;}'", shell=True).split()
lst = subprocess.check_output("git ls-files", shell=True).splitlines()
lst = filter(os.path.isfile, lst)
return lst
dist_tarball = env.Tar('wesnoth-${version}.tar.bz2', [])
open("dist.manifest", "w").write("\n".join(dist_manifest() + ["src/revision.hpp"]))
open("dist.manifest", "w").write("\n".join(dist_manifest() + ["src/revision.h"]))
env.Append(TARFLAGS='-j -T dist.manifest --transform "s,^,wesnoth-$version/,"',
TARCOMSTR="Making distribution tarball...")
env.AlwaysBuild(dist_tarball)
@ -803,7 +835,6 @@ env.Alias("wesnoth-bundle",
Copy("${TARGET}/Contents/Resources/English.lproj", "projectfiles/Xcode/English.lproj"),
Copy("${TARGET}/Contents/Resources/fonts", "fonts"),
Copy("${TARGET}/Contents/Resources/fonts.conf", "projectfiles/Xcode/Resources/fonts.conf"),
Copy("${TARGET}/Contents/Resources/Growl Registration Ticket.growlRegDict", "projectfiles/Xcode/Resources/Growl Registration Ticket.growlRegDict"),
Copy("${TARGET}/Contents/Resources/icon.icns", "projectfiles/Xcode/Resources/icon.icns"),
Copy("${TARGET}/Contents/Resources/images", "images"),
Copy("${TARGET}/Contents/Resources/SDLMain.nib", "projectfiles/Xcode/Resources/SDLMain.nib"),

View file

@ -1,3 +1,448 @@
## Version 1.15.0-dev
### Campaigns
* A Tale of Two Brothers
* S2 'Chase': improved behavior of undead side leader with custom AI
### Engine
* Windows 7 is now the minimum supported Windows version.
* Removed incomplete joystick support.
* Removed map scaling algorithm customization. Nearest-neighbor scaling will now
always be used.
* Removed option to disable unit and item halos.
### Language and i18n
* Updated translations: British English, Bulgarian, Chinese (Simplified),
Chinese (Traditional), Czech, French, Galician, German, Hungarian, Italian,
Japanese, Polish, Scottish Gaelic, Slovak, Spanish, Ukrainian.
### Packaging
* OpenMP support has been removed. It is no longer an optional build-time dependency.
### WML engine
* Support formula= key in [variable] ConditionalWML
* Support to_location in [move_unit], taking a special location ID
* Support dir in [move_unit] to perform relative movements
* Support location_id in [teleport], [recall], [unstore_unit] for the target location
* Support [filter_weapon] in leadership and resistance abilities,
which activates the ability only when the affected unit is using
a matching weapon.
* Support [filter_second_weapon] in leadership and resistance abilities,
which activates the ability only when the affected unit's opponent
is using a matching weapon.
* Support WFL and percentages in [random_placement]num_items=
* Support [or] in [filter_wml] and similar places
* Support globbing in [filter_wml] via glob_on_* keys
* Add trunc as a valid value for [set_variable]round=
* Remove support for speaker=id in SUF (but retain in [message])
* Support saner units for some formatting options in [message]
* Support underline=yes|no in [message]
* Support [set_variable]root=cube and root=_integer_
* Support force_scroll in [move_units_fake] (default no)
* Support facing= in [role][auto_recall]
* Support lists for special and special_active in SWF
* Support usage and alignment in SUF
* Deprecate [replace_map]map= in favor of map_data=
* Add u and v variables in ~ADJUST_ALPHA() and ~CHAN()
* Add clear_shroud in [move_unit] to clear shroud as the unit moves
* Support male_voice and female_voice in [message]
* Support [break], [continue], and [return] in [random_placement]
* [remove_sound_source] now accepts a comma-separated ID list
## Version 1.14.4+dev
### Campaigns
* Secrets of the Ancients:
* Fix dialog said by wrong unit & revert previous fix (issue #3294)
* Tutorial:
* Added more information to the Status Table prompt about how to access it (issue #2883).
* Under the Burning Suns:
* New graphics for Eloh.
### Language and i18n
* Updated translations: British English
### User Interface
* MacOS: fixed moving the mouse with a touchpad also scrolling GUI dialogs
## Version 1.14.4
### Security Fixes
* Fixed Lua being able to escape sandboxing via load/loadstring (CVE-2018-1999023).
### Add-ons server
* Made it so plain-text .po catalogues in add-ons are detected and added to
the list of translations for them.
### Campaigns
* Dead Water:
* In 'Tirigaz', take the situation into account of orcs being killed either
first or by undead.
* Delfador's Memoirs:
* Fix hero units costing upkeep (issue #3277)
* Eastern Invasion:
* Fixed missing prisoners and loss of recallable units in 'Captured'.
* Northern Rebirth:
* Level 0 units are not available anymore after scenario 5
* Secrets of the Ancients:
* Adjust gender of enemies to better match story in S11 & 21 (issue #3294)
* Simplify dialog to fix possible confusion in S16 (issue #3291)
* Have nagas be able to recruit in S21 (issue #3293)
* The South Guard:
* S4: undead leader won't leave the castle anymore
* S5: the untypical situation that one can defeat the lich before finding
Urza Afalas is now handled
* Under the Burning Suns:
* S11: added custom graphics for the citadel.
* S12: clarified the alien bodies' weaknesses.
* Various visual improvements.
### Editor
* Fixed saving a map as a scenario not enabling scenario editor tools.
### Graphics
* New attack animation for the Peasant.
* Tweaked the Ruffian's attack animation timing.
### Language and i18n
* Updated translations: British English, Bulgarian, Chinese (Simplified),
Chinese (Traditional), Czech, French, German, Hungarian, Japanese,
Scottish Gaelic, Slovak, Spanish
### Lua API
* Upgrade to Lua 5.3.5.
### Multiplayer
* Non hosts can now change their faction in the mp wait dialog.
### Multiplayer server
* Fixed lobby and whisper messages not having a maximum length.
* Partly fixed the mp server breaking translatable strings.
### User interface
* Improved the layout of the Statistics dialog.
* Allow changing dropdown menu selections with the scrollwheel (FR #3251).
* Fixed lobby chat box scrolling to top on a new message if it isn't at the
bottom (issue #2789).
* Fixed the unit preview pane not showing the default race icon when detailing
a single unit's stats.
* Sort units secondarily by XP in the unit list dialog.
* Whiteboard related bugfixes
### WML engine
* Fixed errors about WESNOTH_VERSION not being defined when trying to load
add-ons that have preprocessor errors (issues #1924, #1634).
### Miscellaneous and bug fixes
* Added an advanced preference to enable experimental PRNG combat.
* Campfires use illumination instead of a different ToD.
* Linux builds now enable security hardening by default.
* Fixed MP admins being unable to observe private games.
* Fixed MP faction, leader, and leader gender changes persisting even if the
selection dialog is dismissed.
* Fixed an issue with positioned sound sources ignoring the volume set in
Preferences after going off the audible radius and back (issue #3280).
* Fixed wmllint choking on gzipped binary files (e.g. gzipped tarballs).
* Fixed wmllint crashing on nonexistent paths provided in the command line
(issue #3286).
* Slight changes to the objectives dialogue (pr #3309)
* Greatly improved touch control support.
* Fixed wmlindent crashing on nonexistent paths provided in the command line
(issue #3346).
* [do_command][attack] can no longer invoke disabled attacks.
* [delay] is now skipped during preload events.
* Fixed wrong simulated movement points when planning to capture a village.
* Fixed attacks wrongly being disabled in the UI.
## Version 1.14.3
### AI
* Fixed crash in presence of units with negative hitpoints (issue #3042).
* Efficiency improvements to filter evaluations in the Goto Micro AI and some
AI helper functions
### Campaigns
* Dead Water:
* Fix possibility of villagers blocking pickup of sword in S10 The Flaming
Sword (issue #3207).
* Descent Into Darkness:
* New Parthyn map in S1 and S6.
* Northern Rebirth:
* Reduced starting gold and income in scenarios 10 to 13
* Secrets of the Ancients:
* Fix S09 Training Session not ending when all dark adepts die (issue #3192)
* Tutorial:
* S2: made enemy starting gold equal to that of the player.
* Under the Burning Suns:
* Added portrait and updated sprite for Giant Ant.
### Language and i18n
* Updated translations: British English, Chinese (Traditional), Czech, French,
Italian, Japanese, Scottish Gaelic, Spanish
### Multiplayer server
* Fixed lan_server option not causing the server to exit once vacated, e.g.
when using the Host Networked Game option from the Multiplayer menu in the
game (issue #3206).
* It is now possible to query the client version of other players.
### Music and sound effects
* The music now changes immediately when you load a save file (issue #2602).
* Fixed Lua errors when setting a music track that cannot be found when the
playlist is already empty, e.g. if there's no music installed for the
game (issue #3194).
### WML engine
* Removed validation to ensure units cannot have negative hitpoints. We
learned that the ability to create such units is documented, and thus
disallowing it was an API change. Since API changes aren't allowed in
the stable branch, we have reverted it.
### Miscellaneous and bug fixes
* Fixed an occasional crash at the loading screen related to multi-thread
access of the image cache.
* [kill] animate=yes no longer scrolls to units through fog or shroud, thus
matching 1.12's behavior again.
* [message] displays the unit type name when a nameless unit speaks and no
custom caption= is specified (issue #3211).
* do_not_list=yes units are no longer excluded from the debug mode-only
Create Unit dialog.
* Fixed a rare issue where disabled attacks could cause the wrong attack to
be initially selected in the Unit Attack dialog. This bug also had the
potential to cause units to the wrong attack when engaging or viewing
damage calculations.
* Fixed [scenario] map_file= being unusable in most circumstances.
## Version 1.14.2
### Campaigns
* Northern Rebirth:
* S02.1 Infested Caves: keep side 8 AI leader from wandering off too far
and ending up on a keep with only one hex for recruiting.
* S02.1 Infested Caves: AIs are less likely to kill each other in early
game, which would make it harder for the player otherwise.
* S02.1 Infested Caves: Dwarvish allies are also less likely to die.
* S02.1 Infested Caves: minor map tweaks and improvements.
* S05 The Pursuit: removed a bottleneck and tweaked Rod of Justice.
* Sceptre of Fire:
* In 'Caverns of Flame', fixed various issues with the volcano eruption.
* Under the Burning Suns:
* Various Quenoth unit graphics updates.
* Descent into Darkness:
* In 'A small Favor', disabled a not intended way to win the scenario.
* Secrets of the Ancients:
* Bats are transformed to normal ones already after S5
### Graphics
* Fixed a minor team coloring mistake in the north-facing Revenant standing
animation.
### Language and i18n
* Updated translations: British English, Chinese (Simplified), Czech, French,
Galician, German, Italian, Japanese, Scottish Gaelic, Spanish, Ukrainian
### User interface
* List boxes (MP lobby game list in particular) now keep the scroll position
when they change, instead of keeping the selected item visible (issue #3016).
* Fixed MP lobby player list scrolling to top when it changes
* Fixed the first unit sometimes not being selected when opening the Recall
dialog.
* Fixed a crash when using very large portraits in [message] (issue #2912)
* Added a button to access the version info dialog to Preferences.
* Removed player list sorting options in the MP lobby. The list is now
automatically sorted alphabetically, friends first.
* Rearranged campaign difficulty menu layout
### Terrains
* Removed hidden terrains that were not supposed to make it to 1.14: ^Prg,
^Prgo, ^Pwd, ^Pwdo
### Miscellaneous and bug fixes
* Fixed memory leak in terrain filter code. In a huge map with Silver Mages,
it could leak several gigabytes of memory in a long session.
* Fixed: unit halo remained after undoing a recall (issue #3065)
* Fixed: unit halo intensity doubled during AMLA animation
* [change_theme] no longer causes a Lua error when theme= is not specified
instead of explicitly set to an empty string.
* [change_theme] no longer requires running a separate action to update the
UI afterwards (e.g. [redraw]) and the status panels are updated immediately.
as well.
* Lua random map generator: fixed error when flipping map; specifically this
also fixes an assert at the start of HttT S7 (Sceptre of Fire) that had a
50% chance of being triggered
* Experimental AI: fixed recruiting not working on maps without enemies, such
as the first two turns of Dark Forecast
* Experimental AI: fixed recruiting evaluations sometimes not being updated
* Replaced deprecated Lua code and all remaining uses of FOREACH and MESSAGE
macros
* Fixed [color_adjust] interacting poorly with time of day color shifts and
values outside the [-255, 255] range (issue #3144).
* Fixed a regression from 1.13.10 where modification option values couldn't
be properly saved in arrays.
* Added stricter validation to ensure units cannot have negative hitpoints,
except during specific attack-related events.
* Added deprecation notices for several macros that had them missing before.
* [message] no longer scrolls to units through fog or shroud so it matches
1.12's behavior.
* Fixed animation-wide text_color and blend_color keys being overwritten. This
fixes level-in and level-out animations sometimes fading to black instead of
white.
* Fixed [animate_unit] freezing the game when observing MP games (#2970).
* Fixed carryover behaving differently when loading a start-of-scenario save
(issue #3152).
* Fixed turn replay function in MP.
* Fixed savegames being created even when not needed (issue #3150).
* Fixed handling of extra_recruit in planning mode (issue #3100).
* Fixed handling of skirmisher in planning mode.
* Fixed handling of filter_recall in planning mode.
* Fixed possible segfault at game end.
* Fixed require_resource in [resource].
* Fixed require_scenario=yes not working with map_generation (issue #3105).
## Version 1.14.1
### Campaigns
* Eastern Invasion:
* In 'Captured', fixed units incorrectly costing upkeep after leveling up.
* Secrets of the Ancients
* Fixed minor unit naming inconsistencies (issues #2844 and #2846).
* Under the Burning Suns
* Added custom graphics for the broken tree in S1.
* Various sprite and image updates.
* Fixed a bug in the formation ability causing defense bonuses not being
received in some cases.
### Language and i18n
* Updated translations: British English, Chinese (Simplified), Czech, French,
Galician, German, Italian, Japanese, Scottish Gaelic, Slovak, Spanish
* Fixed Logging Options tooltips not being translatable (issue #2837).
* Add command-line argument to disable the filtering of incomplete translations
in the language selection list.
### Multiplayer server
* Added support for matching user, IP, and email bans from a forums board
when the forum_user_handler is enabled and active. (IP and email bans with
wildcards are not supported yet.)
* Fixed various instances of the server crashing under certain conditions.
### Performance
* Added an option to disable the FPS limiter for a slight performance boost.
### Units
* Changed the plural name for the merfolk race from Mermen to Merfolk (issue #2940)
and replaced a few instances in core unit or terrain descriptions accordingly.
### User interface
* Removed individual Join/Observe buttons for each game in the MP Lobby.
* Highlight the titles of MP games with vacant slots.
* Improved MP Lobby layout on low resolutions.
* Improved reporting of network errors in the MP lobby (issue #3005).
* Ensure the chat widget remains the correct size even after a window resize.
* Custom MP game names are now capped at 50 characters.
* Restored Era info to main MP game display.
* Improved the resolution selection criteria for the MP Lobby.
* Fixed inactive weapon specials being displayed in the Unit Attack dialog
unlike in 1.12 (issue #3033).
### Miscellaneous and bug fixes
* Removed misleading tooltip text stating registered nicknames are optional for
the official MP server.
* Attempting to save a screenshot with an unsupported format now shows an error
message, instead of saving the screenshot as BMP with the requested extension.
* It is now possible to disable logdomains in the Logging Options dialog.
* Fixed the wesnoth(6) manpage claiming the default log level is 'error' when it
has been 'warning' since version 1.9.0.
* Document --log-none in the wesnoth(6) manpage.
* Avoid trying to load invalid base64-encoded data URIs.
* wesnoth_addon_manager and the addons.wesnoth.org web index can now use data URIs.
* Fixed a crash when using certain invalid color= values.
* Implemented a workaround for an unhandled std::bad_cast from string comparison
functions that caused a crash-to-desktop when opening Preferences among others
(issue #3050).
* Fixed many crashes and out-of-sync errors when using the planning mode.
## Version 1.14.0
### Campaigns
* Under the Burning Suns
* New set of Quenoth faction and character portraits by LordBob.
* Updated sprites for several Quenoth units.
* Fixed "Invalid WML found" error that can be caused by the Quenoth Youth
support ability.
### Help browser
* Temporarily hidden Editor section as it is mostly incomplete and of little
use right now (issue #2963).
### Language and i18n
* Fixed Version label on the title screen not being translatable (issue #2914).
* Updated translations: Czech, French, Galician, German, Japanese, Polish,
Scottish Gaelic, Slovak, Spanish
### Multiplayer
* Fixed regression causing a crash-to-desktop when trying to log into the
server using a registered and active account without specifying a
password.
* Fixed an infinite loading screen if the server shut down or restarted
mid-login.
* Fixed an infinite loading screen when attempting to login with an
unregistered nickname followed by a registered one.
* Dark Forecast: Fixed possible Lua error when the weather changes.
### User Interface
* Implemented MP chat message history saving (issue #1194, issue #2802).
* Fixed context menus not dismissing on right click.
### Miscellaneous and bug fixes
* Fixed an AI assertion when a unit with one disabled attack attacked a unit
with no attacks or a single disabled attack.
## Version 1.13.14
### Security fixes
* Fixed an issue allowing MP lobby and whisper message origins to be spoofed
by clients.
### Campaigns
* The Hammer of Thursagan
* S12 Fixed enemies from ai6 (south-east lich) going to the book (spider)
room
* S12 Fixed north treasure chest disappearing
* The Rise of Wesnoth
* New set of story art.
### Help browser
* Unit descriptions use the new multiplication sign format for attack lists
now (issue #2873).
### Language and i18n
* Updated translations: Chinese (Simplified), Czech, French, Galician,
Italian, Polish
### Lua API
* Fix wesnoth.show_popup_dialog and wesnoth.show_message_box not accepting
translatable strings
### Multiplayer
* Added team color to a few background units missing in Aethermaw.
### User Interface
* Swapped the position and formatting of game names and titles in the MP
lobby.
* Made Faction Select button's purpose more clear in MP Staging.
* Added a convenient button in Load Game to open your saves folder.
### Miscellaneous and bug fixes
* Removed the Font Scaling preference. It was too buggy (issues #2792 and
#1624).
* Fixed some hotkeys triggering multiple commands on GNU/Linux (bug #1736).
* Fixed [modify_side] share_vision=yes not doing anything (bug #2850).
* Fixed regression where unit filters in [disable] weapon specials would not
match the attacking unit.
* Fixed images with no alpha channel rendering incorrectly.
* Fixed unit selection not persisting between uses of Create Unit.
* Fixed assertion when undoing actions in a synced context.
* [filter_wml] no longer accepts [and] and [or] in addition to [not] since
the implementation was non-functional.
* Fixed some MP passwords being saved incorrectly (issue #2745)
* Fixed AI not recruiting in some circumstances when there are only cheap
units on the recall list.
* Fixed sometimes being unable to join MP games with non-required eras.
* Fixed locations not being added to the palette when loading a map (#1023)
## Version 1.13.13
### Campaigns
* Eastern Invasion
* Fixed some Lua errors in S05.
* The Hammer of Thursagan
* Fixed a misplaced door image in S12.
* Under the Burning Suns
* Changed Sun Singer movetype from float to foot.
* Added some Quenoth elf unit animations.
* Hide technical terrains in the Help browser (Human Ship, Lava overlay).
### Language and i18n
* Fixed many cases of interpolated strings in the engine possibly having
their translations retrieved from the wrong textdomain and falling back
to the English original if that failed (PR #2711, bug #2709, bug #2732).
* Fixed parts of the MP game setup UI having their translations ignored by
the game (bug #2709).
* Fixed certain parts of the UI displaying unit stats and trait effects
having incomplete translations (bug #2732).
* Fixed "Level" label in unit descriptions in the help being untranslatable
(bug #2732)
* Fixed "Search" placeholder text in dialog item filters not being
translatable (bug #2709, bug #2732).
* Fixed "Time of Day Schedule" heading for the index for the ToD Schedule
top-level help section, "Lawful Bonus", "Schedule" (back link to index)
and an error message not being translatable.
* Updated translations: British English, Chinese (Simplified), Czech, French,
Scottish Gaelic, Spanish, Ukrainian
### Multiplayer
* A New Land: Fixed the scenario being broken.
* Dark Forecast: Fixed possible Lua error when attempting to spawn units.
### Miscellaneous and bug fixes
* Fixed minimap buttons not doing anything (bug #2681)
* Fixed events with an id but no name being rejected
* Fixed assertion when using [inspect]
* Fixed inability to deselect modifications in single-player
* Fixed infinite loading screen when logging in with an invalid name
* Improved UX in multiplayer when synced debug commands are used during a
game.
* Updated bundled Oldania font to version 1.007 (from 1.006).
* Added bold and italic Oldania font variants.
* Updated bundled DejaVu Sans fonts to version 2.37 (from 2.35).
* Fixed [chat] not working during [delay] or animations.
* Removed the Password Reminder option from the Login screen.
* Removed (optional) requirement of libpng from SCons and CMake and the
associated options as Wesnoth now uses SDL_image to write PNG files.
* Fixed assertion when saving game events mid-event.
## Version 1.13.12
### Security fixes
* Disallowed access to blacklisted file paths such as hidden files and
@ -3265,7 +3710,7 @@
2 different guardians and a coward, healer support, lurkers,
messenger escort, patrol, protect and move a unit, and 2 alternative
recruiting strategies.
* Documentation at http://wiki.wesnoth.org/Micro_AIs
* Documentation at https://wiki.wesnoth.org/Micro_AIs
* New leader_ignores_keep AI aspect that lets AI leader take part in the same
AI moves as the non-leader units.
* Rename passive_leader_shares_keep candidate action to leader_shares_keep.
@ -5737,7 +6182,7 @@
* Event "turn refresh" is now fired at turn 1 too
### Miscellaneous and bugfixes
* Using a hotkey to reload during an attack no longer disables the mouse
(http://www.wesnoth.org/forum/viewtopic.php?f=4&t=27616)
(https://www.wesnoth.org/forum/viewtopic.php?f=4&t=27616)
* Removed some unused Drake macros from animation_utils
* Add recruitment anims for the Sky and Hurricane Drakes
* Removed the old stats code (Debian bug #555276, CVE-2007-2383,
@ -5998,7 +6443,7 @@
pre-srng or with srng disabled as well can work without OOS. This is a
testing feature that will likely be removed prior to 1.8.
* Room support via /join and /room commands, better support in the
experimental new lobby. See http://www.wesnoth.org/wiki/MultiplayerRooms
experimental new lobby. See https://www.wesnoth.org/wiki/MultiplayerRooms
for details.
### Multiplayer server
* Added server-side RNG support. Old clients can still play as normal.
@ -7189,7 +7634,7 @@
improvements.
* Built by default in scons, cmake and autotools, if building manually
see RELEASE_NOTES.
* See http://www.wesnoth.org/wiki/Editor2 for details and known issues.
* See https://www.wesnoth.org/wiki/Editor2 for details and known issues.
### Language and i18n
* updated fonts: DejaVuSans 2.26
* updated translations: Chinese (Traditional), Danish, Finnish, Galician,
@ -7608,7 +8053,7 @@
* Fix graphic artifact bug #11438
### Formula AI
* added support for Formula AI language, more info available at:
http://www.wesnoth.org/wiki/FormulaAI
https://www.wesnoth.org/wiki/FormulaAI
### graphics
* Fixed broken TC on transport-galleon and drake walking corpse graphics
* New portraits: Elvish Sorceress
@ -9520,7 +9965,7 @@
### terrain system
* The entire underlaying system has been converted to a new system,
this might render some UMC broken, read this forum thread for more details
http://www.wesnoth.org/forum/viewtopic.php?t=14910
https://www.wesnoth.org/forum/viewtopic.php?t=14910
* Terrain of the starting position can be changed in the map,
the automatic conversion to a keep is no longer done
* New definition for the maps in terrain-graphics
@ -10858,7 +11303,7 @@
* increased the holy resistance of the scuttlefoot movetype from 0% to 20%
* made Fireball, Gate, Galeons & Watch Tower unpoisonable and unplaguable
* recosting and minor stats changes for many level 2+ units:
http://www.wesnoth.org/forum/viewtopic.php?p=121154#121154
https://www.wesnoth.org/forum/viewtopic.php?p=121154#121154
* user interface:
* added font colors to theme
* reorganized side-bar information
@ -10918,7 +11363,7 @@
* various other changes:
* --with-preferences-dir configure option for coexistence of multiple versions
* experimental Python API for AI.
See http://www.wesnoth.org/wiki/ReferencePythonAPI for more information.
See https://www.wesnoth.org/wiki/ReferencePythonAPI for more information.
* various bug fixes and code cleanups
* better support for MacOSX filesystems
@ -13834,7 +14279,7 @@
* added some explanatory tooltips for some unit attributes on sidebar
* added in flag to show whose turn it currently is
* added end turn confirmation when units can still move (requires
editing preferences-file - see WesnothPreferences on http://wiki.wesnoth.org for more information)
editing preferences-file - see WesnothPreferences on https://wiki.wesnoth.org for more information)
* added 'unit list' to context menu
* restored 'save game' in the context menu (#7172)
* multiplayer improvements:

View file

@ -6,6 +6,6 @@ find_library(CRYPTO_LIBRARY crypto)
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CRYPTO DEFAULT_MSG CRYPTO_LIBRARY CRYPTO_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Crypto DEFAULT_MSG CRYPTO_LIBRARY CRYPTO_INCLUDE_DIR)
mark_as_advanced(CRYPTO_INCLUDE_DIR CRYPTO_LIBRARY)

69
cmake/FindGLEW.cmake Normal file
View file

@ -0,0 +1,69 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindGLEW
# --------
#
# Find the OpenGL Extension Wrangler Library (GLEW)
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
# if GLEW has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# GLEW_INCLUDE_DIRS - include directories for GLEW
# GLEW_LIBRARIES - libraries to link against GLEW
# GLEW_FOUND - true if GLEW has been found and can be used
find_path(GLEW_INCLUDE_DIR GL/glew.h)
if(NOT GLEW_LIBRARY)
find_library(GLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64 libx32)
find_library(GLEW_LIBRARY_DEBUG NAMES GLEWd glew32d glewd PATH_SUFFIXES lib64)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(GLEW)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
if(GLEW_FOUND)
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
if(NOT GLEW_LIBRARIES)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
if (NOT TARGET GLEW::GLEW)
add_library(GLEW::GLEW UNKNOWN IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
if(GLEW_LIBRARY_RELEASE)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_LIBRARY_RELEASE}")
endif()
if(GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_LIBRARY_DEBUG}")
endif()
if(NOT GLEW_LIBRARY_RELEASE AND NOT GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_LOCATION "${GLEW_LIBRARY}")
endif()
endif()
endif()
mark_as_advanced(GLEW_INCLUDE_DIR)

View file

@ -6,6 +6,6 @@ find_library(HISTORY_LIBRARY history)
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HISTORY DEFAULT_MSG HISTORY_LIBRARY HISTORY_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(History DEFAULT_MSG HISTORY_LIBRARY HISTORY_INCLUDE_DIR)
mark_as_advanced(HISTORY_INCLUDE_DIR HISTORY_LIBRARY)

517
cmake/FindOpenGL.cmake Normal file
View file

@ -0,0 +1,517 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindOpenGL
# ----------
#
# FindModule for OpenGL and GLU.
#
# Optional COMPONENTS
# ^^^^^^^^^^^^^^^^^^^
#
# This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and
# ``OpenGL``. There are corresponding import targets for each of these flags.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` targets:
#
# ``OpenGL::GL``
# Defined to the platform-specific OpenGL libraries if the system has OpenGL.
# ``OpenGL::OpenGL``
# Defined to libOpenGL if the system is GLVND-based.
# ``OpenGL::GL``
# ``OpenGL::GLU``
# Defined if the system has GLU.
# ``OpenGL::GLX``
# Defined if the system has GLX.
# ``OpenGL::EGL``
# Defined if the system has EGL.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module sets the following variables:
#
# ``OPENGL_FOUND``
# True, if the system has OpenGL and all components are found.
# ``OPENGL_XMESA_FOUND``
# True, if the system has XMESA.
# ``OPENGL_GLU_FOUND``
# True, if the system has GLU.
# ``OpenGL_OpenGL_FOUND``
# True, if the system has an OpenGL library.
# ``OpenGL_GLX_FOUND``
# True, if the system has GLX.
# ``OpenGL_EGL_FOUND``
# True, if the system has EGL.
# ``OPENGL_INCLUDE_DIR``
# Path to the OpenGL include directory.
# ``OPENGL_EGL_INCLUDE_DIRS``
# Path to the EGL include directory.
# ``OPENGL_LIBRARIES``
# Paths to the OpenGL library, windowing system libraries, and GLU libraries.
# On Linux, this assumes GLX and is never correct for EGL-based targets.
# Clients are encouraged to use the ``OpenGL::*`` import targets instead.
#
# Cache variables
# ^^^^^^^^^^^^^^^
#
# The following cache variables may also be set:
#
# ``OPENGL_egl_LIBRARY``
# Path to the EGL library.
# ``OPENGL_glu_LIBRARY``
# Path to the GLU library.
# ``OPENGL_glx_LIBRARY``
# Path to the GLVND 'GLX' library.
# ``OPENGL_opengl_LIBRARY``
# Path to the GLVND 'OpenGL' library
# ``OPENGL_gl_LIBRARY``
# Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import
# targets.
#
# Linux-specific
# ^^^^^^^^^^^^^^
#
# Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates
# context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
# contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
# to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
# Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
# ``OpenGL::GLX`` or ``OpenGL::EGL``.
#
# Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
# to use legacy GL interfaces. These will use the legacy GL library located
# by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or
# not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND
# ``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES``
# variable will use the corresponding libraries). Thus, for non-EGL-based
# Linux targets, the ``OpenGL::GL`` target is most portable.
#
# A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way
# to provide legacy GL interfaces in case multiple choices are available.
# The value may be one of:
#
# ``GLVND``
# If the GLVND OpenGL and GLX libraries are available, prefer them.
# This forces ``OPENGL_gl_LIBRARY`` to be empty.
# This is the default if components were requested (since components
# correspond to GLVND libraries).
#
# ``LEGACY``
# Prefer to use the legacy libGL library, if available.
# This is the default if no components were requested.
#
# For EGL targets the client must rely on GLVND support on the user's system.
# Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES*
# libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this
# module does not currently support that; contributions welcome.
#
# ``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of
# GLVND. For non-GLVND Linux and other systems these are left undefined.
#
# macOS-Specific
# ^^^^^^^^^^^^^^
#
# On OSX FindOpenGL defaults to using the framework version of OpenGL. People
# will have to change the cache values of OPENGL_glu_LIBRARY and
# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
# Provide OPENGL_USE_<C> variables for each component.
foreach(component ${OpenGL_FIND_COMPONENTS})
string(TOUPPER ${component} _COMPONENT)
set(OPENGL_USE_${_COMPONENT} 1)
endforeach()
if (CYGWIN)
find_path(OPENGL_INCLUDE_DIR GL/gl.h )
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
find_library(OPENGL_gl_LIBRARY opengl32 )
find_library(OPENGL_glu_LIBRARY glu32 )
elseif (WIN32)
if(BORLAND)
set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
else()
set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
endif()
elseif (APPLE)
# The OpenGL.framework provides both gl and glu
find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
find_library(OPENGL_glu_LIBRARY OpenGL DOC
"GLU library for OS X (usually same as OpenGL library)")
find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
else()
if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
# Handle HP-UX cases where we only want to find OpenGL in either hpux64
# or hpux32 depending on if we're doing a 64 bit build.
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(_OPENGL_LIB_PATH
/opt/graphics/OpenGL/lib/hpux32/)
else()
set(_OPENGL_LIB_PATH
/opt/graphics/OpenGL/lib/hpux64/
/opt/graphics/OpenGL/lib/pa20_64)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
set(_OPENGL_LIB_PATH
/boot/develop/lib/x86)
set(_OPENGL_INCLUDE_PATH
/boot/develop/headers/os/opengl)
endif()
# The first line below is to make sure that the proper headers
# are used on a Linux machine with the NVidia drivers installed.
# They replace Mesa with NVidia's own library but normally do not
# install headers and that causes the linking to
# fail since the compiler finds the Mesa headers but NVidia's library.
# Make sure the NVIDIA directory comes BEFORE the others.
# - Atanas Georgiev <atanas@cs.columbia.edu>
find_path(OPENGL_INCLUDE_DIR GL/gl.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
${_OPENGL_INCLUDE_PATH}
)
find_path(OPENGL_GLX_INCLUDE_DIR GL/glx.h ${_OPENGL_INCLUDE_PATH})
find_path(OPENGL_EGL_INCLUDE_DIR EGL/egl.h ${_OPENGL_INCLUDE_PATH})
find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
# Search for the GLVND libraries. We do this regardless of COMPONENTS; we'll
# take into account the COMPONENTS logic later.
find_library(OPENGL_opengl_LIBRARY
NAMES OpenGL
PATHS /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
find_library(OPENGL_glx_LIBRARY
NAMES GLX
PATHS /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
find_library(OPENGL_egl_LIBRARY
NAMES EGL
PATHS ${_OPENGL_LIB_PATH}
)
find_library(OPENGL_glu_LIBRARY
NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
)
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "")
endif()
if(NOT OpenGL_GL_PREFERENCE STREQUAL "")
# A preference has been explicitly specified.
if(NOT OpenGL_GL_PREFERENCE MATCHES "^(GLVND|LEGACY)$")
message(FATAL_ERROR
"OpenGL_GL_PREFERENCE value '${OpenGL_GL_PREFERENCE}' not recognized. "
"Allowed values are 'GLVND' and 'LEGACY'."
)
endif()
elseif(OpenGL_FIND_COMPONENTS)
# No preference was explicitly specified, but the caller did request
# at least one GLVND component. Prefer GLVND for legacy GL.
set(OpenGL_GL_PREFERENCE "GLVND")
else()
# No preference was explicitly specified and no GLVND components were
# requested. Prefer libGL for legacy GL.
set(OpenGL_GL_PREFERENCE "LEGACY")
endif()
if("x${OpenGL_GL_PREFERENCE}x" STREQUAL "xGLVNDx" AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
# We can provide legacy GL using GLVND libraries.
# Do not use any legacy GL library.
set(OPENGL_gl_LIBRARY "")
else()
# We cannot provide legacy GL using GLVND libraries.
# Search for the legacy GL library.
find_library(OPENGL_gl_LIBRARY
NAMES GL MesaGL
PATHS /opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
endif()
# FPHSA cannot handle "this OR that is required", so we conditionally set what
# it must look for. First clear any previous config we might have done:
set(_OpenGL_REQUIRED_VARS)
# now we append the libraries as appropriate. The complicated logic
# basically comes down to "use libOpenGL when we can, and add in specific
# context mechanisms when requested, or we need them to preserve the previous
# default where glx is always available."
if((NOT OPENGL_USE_EGL AND
NOT OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY) OR
( OPENGL_USE_EGL))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_opengl_LIBRARY)
endif()
# GLVND GLX library. Preferred when available.
if((NOT OPENGL_USE_OPENGL AND
NOT OPENGL_USE_GLX AND
NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
( OPENGL_USE_GLX AND
NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY) OR
(OPENGL_USE_GLX AND OPENGL_USE_EGL))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_glx_LIBRARY)
endif()
# GLVND EGL library.
if(OPENGL_USE_EGL)
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_egl_LIBRARY)
endif()
# Old-style "libGL" library: used as a fallback when GLVND isn't available.
if((NOT OPENGL_USE_EGL AND
NOT OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY AND
OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
OPENGL_gl_LIBRARY))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
endif()
# We always need the 'gl.h' include dir.
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
unset(_OPENGL_INCLUDE_PATH)
unset(_OPENGL_LIB_PATH)
find_library(OPENGL_glu_LIBRARY
NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
)
endif ()
if(OPENGL_xmesa_INCLUDE_DIR)
set( OPENGL_XMESA_FOUND "YES" )
else()
set( OPENGL_XMESA_FOUND "NO" )
endif()
if(OPENGL_glu_LIBRARY)
set( OPENGL_GLU_FOUND "YES" )
else()
set( OPENGL_GLU_FOUND "NO" )
endif()
# OpenGL_OpenGL_FOUND is a bit unique in that it is okay if /either/ libOpenGL
# or libGL is found.
# Using libGL with libEGL is never okay, though; we handle that case later.
if(NOT OPENGL_opengl_LIBRARY AND NOT OPENGL_gl_LIBRARY)
set(OpenGL_OpenGL_FOUND FALSE)
else()
set(OpenGL_OpenGL_FOUND TRUE)
endif()
if(OPENGL_glx_LIBRARY AND OPENGL_GLX_INCLUDE_DIR)
set(OpenGL_GLX_FOUND TRUE)
else()
set(OpenGL_GLX_FOUND FALSE)
endif()
if(OPENGL_egl_LIBRARY AND OPENGL_EGL_INCLUDE_DIR)
set(OpenGL_EGL_FOUND TRUE)
else()
set(OpenGL_EGL_FOUND FALSE)
endif()
# User-visible names should be plural.
if(OPENGL_EGL_INCLUDE_DIR)
set(OPENGL_EGL_INCLUDE_DIRS ${OPENGL_EGL_INCLUDE_DIR})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}
HANDLE_COMPONENTS)
unset(_OpenGL_REQUIRED_VARS)
# OpenGL:: targets
if(OPENGL_FOUND)
# ::OpenGL is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OPENGL_opengl_LIBRARY AND NOT TARGET OpenGL::OpenGL)
if(IS_ABSOLUTE "${OPENGL_opengl_LIBRARY}")
add_library(OpenGL::OpenGL UNKNOWN IMPORTED)
set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LOCATION
"${OPENGL_opengl_LIBRARY}")
else()
add_library(OpenGL::OpenGL INTERFACE IMPORTED)
set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LIBNAME
"${OPENGL_opengl_LIBRARY}")
endif()
set_target_properties(OpenGL::OpenGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_INCLUDE_DIR}")
endif()
# ::GLX is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OpenGL_GLX_FOUND AND NOT TARGET OpenGL::GLX)
if(IS_ABSOLUTE "${OPENGL_glx_LIBRARY}")
add_library(OpenGL::GLX UNKNOWN IMPORTED)
set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LOCATION
"${OPENGL_glx_LIBRARY}")
else()
add_library(OpenGL::GLX INTERFACE IMPORTED)
set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LIBNAME
"${OPENGL_glx_LIBRARY}")
endif()
set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_GLX_INCLUDE_DIR}")
endif()
if(OPENGL_gl_LIBRARY AND NOT TARGET OpenGL::GL)
# A legacy GL library is available, so use it for the legacy GL target.
if(IS_ABSOLUTE "${OPENGL_gl_LIBRARY}")
add_library(OpenGL::GL UNKNOWN IMPORTED)
if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
set(_gl_fw "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
if(EXISTS "${_gl_fw}.tbd")
string(APPEND _gl_fw ".tbd")
endif()
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LOCATION "${_gl_fw}")
else()
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}")
endif()
else()
add_library(OpenGL::GL INTERFACE IMPORTED)
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LIBNAME "${OPENGL_gl_LIBRARY}")
endif()
set_target_properties(OpenGL::GL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
elseif(NOT TARGET OpenGL::GL AND TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
# A legacy GL library is not available, but we can provide the legacy GL
# target using GLVND OpenGL+GLX.
add_library(OpenGL::GL INTERFACE IMPORTED)
set_target_properties(OpenGL::GL PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
set_property(TARGET OpenGL::GL APPEND PROPERTY INTERFACE_LINK_LIBRARIES
OpenGL::GLX)
set_target_properties(OpenGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_INCLUDE_DIR}")
endif()
# ::EGL is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
# Note we test for OpenGL::OpenGL as a target. When this module is updated to
# support GLES, we would additionally want to check for the hypothetical GLES
# target and enable EGL if either ::GLES or ::OpenGL is created.
if(TARGET OpenGL::OpenGL AND OpenGL_EGL_FOUND AND NOT TARGET OpenGL::EGL)
if(IS_ABSOLUTE "${OPENGL_egl_LIBRARY}")
add_library(OpenGL::EGL UNKNOWN IMPORTED)
set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LOCATION
"${OPENGL_egl_LIBRARY}")
else()
add_library(OpenGL::EGL INTERFACE IMPORTED)
set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LIBNAME
"${OPENGL_egl_LIBRARY}")
endif()
set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
# Note that EGL's include directory is different from OpenGL/GLX's!
set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_EGL_INCLUDE_DIR}")
endif()
if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
if(IS_ABSOLUTE "${OPENGL_glu_LIBRARY}")
add_library(OpenGL::GLU UNKNOWN IMPORTED)
if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
set(_glu_fw "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
if(EXISTS "${_glu_fw}.tbd")
string(APPEND _glu_fw ".tbd")
endif()
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LOCATION "${_glu_fw}")
else()
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}")
endif()
else()
add_library(OpenGL::GLU INTERFACE IMPORTED)
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LIBNAME "${OPENGL_glu_LIBRARY}")
endif()
set_target_properties(OpenGL::GLU PROPERTIES
INTERFACE_LINK_LIBRARIES OpenGL::GL)
endif()
# OPENGL_LIBRARIES mirrors OpenGL::GL's logic ...
if(OPENGL_gl_LIBRARY)
set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
elseif(TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
set(OPENGL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
else()
set(OPENGL_LIBRARIES "")
endif()
# ... and also includes GLU, if available.
if(TARGET OpenGL::GLU)
list(APPEND OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY})
endif()
endif()
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_LIBRARY ${OPENGL_LIBRARIES})
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
mark_as_advanced(
OPENGL_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
OPENGL_egl_LIBRARY
OPENGL_glu_LIBRARY
OPENGL_glx_LIBRARY
OPENGL_gl_LIBRARY
OPENGL_opengl_LIBRARY
OPENGL_EGL_INCLUDE_DIR
OPENGL_GLX_INCLUDE_DIR
)

View file

@ -0,0 +1,386 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPackageHandleStandardArgs
-----------------------------
This module provides a function intended to be used in :ref:`Find Modules`
implementing :command:`find_package(<PackageName>)` calls. It handles the
``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``.
It also sets the ``<PackageName>_FOUND`` variable. The package is
considered found if all variables listed contain valid results, e.g.
valid filepaths.
.. command:: find_package_handle_standard_args
There are two signatures::
find_package_handle_standard_args(<PackageName>
(DEFAULT_MSG|<custom-failure-message>)
<required-var>...
)
find_package_handle_standard_args(<PackageName>
[FOUND_VAR <result-var>]
[REQUIRED_VARS <required-var>...]
[VERSION_VAR <version-var>]
[HANDLE_COMPONENTS]
[CONFIG_MODE]
[FAIL_MESSAGE <custom-failure-message>]
)
The ``<PackageName>_FOUND`` variable will be set to ``TRUE`` if all
the variables ``<required-var>...`` are valid and any optional
constraints are satisfied, and ``FALSE`` otherwise. A success or
failure message may be displayed based on the results and on
whether the ``REQUIRED`` and/or ``QUIET`` option was given to
the :command:`find_package` call.
The options are:
``(DEFAULT_MSG|<custom-failure-message>)``
In the simple signature this specifies the failure message.
Use ``DEFAULT_MSG`` to ask for a default message to be computed
(recommended). Not valid in the full signature.
``FOUND_VAR <result-var>``
Obsolete. Specifies either ``<PackageName>_FOUND`` or
``<PACKAGENAME>_FOUND`` as the result variable. This exists only
for compatibility with older versions of CMake and is now ignored.
Result variables of both names are always set for compatibility.
``REQUIRED_VARS <required-var>...``
Specify the variables which are required for this package.
These may be named in the generated failure message asking the
user to set the missing variable values. Therefore these should
typically be cache entries such as ``FOO_LIBRARY`` and not output
variables like ``FOO_LIBRARIES``.
``VERSION_VAR <version-var>``
Specify the name of a variable that holds the version of the package
that has been found. This version will be checked against the
(potentially) specified required version given to the
:command:`find_package` call, including its ``EXACT`` option.
The default messages include information about the required
version and the version which has been actually found, both
if the version is ok or not.
``HANDLE_COMPONENTS``
Enable handling of package components. In this case, the command
will report which components have been found and which are missing,
and the ``<PackageName>_FOUND`` variable will be set to ``FALSE``
if any of the required components (i.e. not the ones listed after
the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are
missing.
``CONFIG_MODE``
Specify that the calling find module is a wrapper around a
call to ``find_package(<PackageName> NO_MODULE)``. This implies
a ``VERSION_VAR`` value of ``<PackageName>_VERSION``. The command
will automatically check whether the package configuration file
was found.
``FAIL_MESSAGE <custom-failure-message>``
Specify a custom failure message instead of using the default
generated message. Not recommended.
Example for the simple signature:
.. code-block:: cmake
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
The ``LibXml2`` package is considered to be found if both
``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid.
Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found
and ``REQUIRED`` was used, it fails with a
:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was
used or not. If it is found, success will be reported, including
the content of the first ``<required-var>``. On repeated CMake runs,
the same message will not be printed again.
Example for the full signature:
.. code-block:: cmake
find_package_handle_standard_args(LibArchive
REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION)
In this case, the ``LibArchive`` package is considered to be found if
both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid.
Also the version of ``LibArchive`` will be checked by using the version
contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given,
the default messages will be printed.
Another example for the full signature:
.. code-block:: cmake
find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
find_package_handle_standard_args(Automoc4 CONFIG_MODE)
In this case, a ``FindAutmoc4.cmake`` module wraps a call to
``find_package(Automoc4 NO_MODULE)`` and adds an additional search
directory for ``automoc4``. Then the call to
``find_package_handle_standard_args`` produces a proper success/failure
message.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_msg}")
else ()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_msg}")
endif ()
endif ()
endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing:${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
if(${_NAME}_CONSIDERED_CONFIGS)
set(configsText "")
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
math(EXPR configsCount "${configsCount} - 1")
foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
string(APPEND configsText " ${filename} (version ${version})\n")
endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE)
string(APPEND configsText " Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
endif()
endif()
endmacro()
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# Set up the arguments for `cmake_parse_arguments`.
set(options CONFIG_MODE HANDLE_COMPONENTS)
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
set(multiValueArgs REQUIRED_VARS)
# Check whether we are in 'simple' or 'extended' mode:
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
if(${INDEX} EQUAL -1)
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
set(FPHSA_REQUIRED_VARS ${ARGN})
set(FPHSA_VERSION_VAR)
else()
cmake_parse_arguments(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
if(FPHSA_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT FPHSA_FAIL_MESSAGE)
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
endif()
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
if(FPHSA_CONFIG_MODE)
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
endif()
if(NOT FPHSA_REQUIRED_VARS)
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
endif()
endif()
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
string(TOUPPER ${_NAME} _NAME_UPPER)
string(TOLOWER ${_NAME} _NAME_LOWER)
if(FPHSA_FOUND_VAR)
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
else()
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
endif()
else()
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
endif()
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
# check if all passed variables are valid
set(FPHSA_FOUND_${_NAME} TRUE)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(FPHSA_FOUND_${_NAME} FALSE)
string(APPEND MISSING_VARS " ${_CURRENT_VAR}")
else()
string(APPEND DETAILS "[${${_CURRENT_VAR}}]")
endif()
endforeach()
if(FPHSA_FOUND_${_NAME})
set(${_NAME}_FOUND TRUE)
set(${_NAME_UPPER}_FOUND TRUE)
else()
set(${_NAME}_FOUND FALSE)
set(${_NAME_UPPER}_FOUND FALSE)
endif()
# component handling
unset(FOUND_COMPONENTS_MSG)
unset(MISSING_COMPONENTS_MSG)
if(FPHSA_HANDLE_COMPONENTS)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(${_NAME}_${comp}_FOUND)
if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ")
endif()
string(APPEND FOUND_COMPONENTS_MSG " ${comp}")
else()
if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ")
endif()
string(APPEND MISSING_COMPONENTS_MSG " ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
string(APPEND MISSING_VARS " ${comp}")
endif()
endif()
endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
string(APPEND DETAILS "[c${COMPONENT_MSG}]")
endif()
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
# check with DEFINED here as the requested or found version may be "0"
if (DEFINED ${_NAME}_FIND_VERSION)
if(DEFINED ${FPHSA_VERSION_VAR})
set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
# count the dots in the version string
string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${_FOUND_VERSION}")
# add one dot because there is one dot more than there are components
string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
# Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
# is at most 4 here. Therefore a simple lookup table is used.
if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
set(_VERSION_REGEX "[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
set(_VERSION_REGEX "[^.]*\\.[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
else ()
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
endif ()
string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${_FOUND_VERSION}")
unset(_VERSION_REGEX)
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
unset(_VERSION_HEAD)
else ()
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
endif ()
unset(_VERSION_DOTS)
else() # minimum version specified:
if (${_NAME}_FIND_VERSION VERSION_GREATER _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable version \"${_FOUND_VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
else()
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
else()
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
endif()
endif()
else ()
# Check with DEFINED as the found version may be 0.
if(DEFINED ${FPHSA_VERSION_VAR})
set(VERSION_MSG "(found version \"${${FPHSA_VERSION_VAR}}\")")
endif()
endif ()
if(VERSION_OK)
string(APPEND DETAILS "[v${${FPHSA_VERSION_VAR}}(${${_NAME}_FIND_VERSION})]")
else()
set(${_NAME}_FOUND FALSE)
endif()
# print the result:
if (${_NAME}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else ()
if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
else()
if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing:${MISSING_VARS}) ${VERSION_MSG}")
endif()
endif()
endif ()
set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
endfunction()

View file

@ -0,0 +1,47 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REPLACE "\n" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()

View file

@ -1,130 +0,0 @@
#.rst:
# FindSDL2_ttf
# -----------
#
# Locate SDL2_ttf library
#
# This module defines:
#
# ::
#
# SDL2_TTF_LIBRARIES, the name of the library to link against
# SDL2_TTF_INCLUDE_DIRS, where to find the headers
# SDL2_TTF_FOUND, if false, do not try to link against
# SDL2_TTF_VERSION_STRING - human-readable string containing the version of SDL2_ttf
#
#
#
# For backward compatiblity the following variables are also set:
#
# ::
#
# SDL2TTF_LIBRARY (same value as SDL2_TTF_LIBRARIES)
# SDL2TTF_INCLUDE_DIR (same value as SDL2_TTF_INCLUDE_DIRS)
# SDL2TTF_FOUND (same value as SDL2_TTF_FOUND)
#
#
#
# $SDL2DIR is an environment variable that would correspond to the
# ./configure --prefix=$SDL2DIR used in building SDL2.
#
# Created by Andreas Löf. This was influenced by the FindSDL_ttf.cmake
# module, but with modifications to use SDL2.
#
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
# Copyright 2015 Andreas Löf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#=============================================================================
if(NOT SDL2_TTF_INCLUDE_DIR AND SDL2TTF_INCLUDE_DIR)
set(SDL2_TTF_INCLUDE_DIR ${SDL2TTF_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDL2DIR}
include/SDL2 include/SDL12 include/SDL11 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL2_TTF_LIBRARY AND SDL2TTF_LIBRARY)
set(SDL2_TTF_LIBRARY ${SDL2TTF_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL2_TTF_LIBRARY
NAMES SDL2_ttf
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
set(SDL2_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
unset(SDL_TTF_VERSION_MAJOR_LINE)
unset(SDL_TTF_VERSION_MINOR_LINE)
unset(SDL_TTF_VERSION_PATCH_LINE)
unset(SDL_TTF_VERSION_MAJOR)
unset(SDL_TTF_VERSION_MINOR)
unset(SDL_TTF_VERSION_PATCH)
endif()
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
VERSION_VAR SDL2_TTF_VERSION_STRING)
# for backward compatiblity
set(SDL2TTF_LIBRARY ${SDL2_TTF_LIBRARIES})
set(SDL2TTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS})
set(SDL2TTF_FOUND ${SDL2_TTF_FOUND})
mark_as_advanced(SDL2_TTF_LIBRARY SDL2_TTF_INCLUDE_DIR)

View file

@ -17,7 +17,7 @@ set(GETTEXT_XGETTEXT_OPTIONS
--force-po
--add-comments=TRANSLATORS
--copyright-holder=\"Wesnoth development team\"
--msgid-bugs-address=\"http://bugs.wesnoth.org/\"
--msgid-bugs-address=\"https://bugs.wesnoth.org/\"
--from-code=UTF-8
--sort-by-file
--keyword=_

View file

@ -91,6 +91,6 @@ ENDIF()
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG VORBISFILE_LIBRARIES VORBISFILE_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VorbisFile DEFAULT_MSG VORBISFILE_LIBRARIES VORBISFILE_INCLUDE_DIR)
mark_as_advanced(VORBISFILE_INCLUDE_DIR VORBISFILE_LIBRARIES VORBISFILE_LIBRARY VORBISFILE_LIBRARY_DEBUG)

View file

@ -0,0 +1,72 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# SelectLibraryConfigurations
# ---------------------------
#
#
#
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose
# good values for basename_LIBRARY, basename_LIBRARIES,
# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
# has been found and set. If only basename_LIBRARY_RELEASE is defined,
# basename_LIBRARY will be set to the release value, and
# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
# take the debug value, and basename_LIBRARY_RELEASE will be set to
# basename_LIBRARY_RELEASE-NOTFOUND.
#
# If the generator supports configuration types, then basename_LIBRARY
# and basename_LIBRARIES will be set with debug and optimized flags
# specifying the library to be used for the given configuration. If no
# build type has been set or the generator in use does not support
# configuration types, then basename_LIBRARY and basename_LIBRARIES will
# take only the release value, or the debug value if the release one is
# not set.
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
macro( select_library_configurations basename )
if(NOT ${basename}_LIBRARY_RELEASE)
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
if(NOT ${basename}_LIBRARY_DEBUG)
set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
set( ${basename}_LIBRARY "" )
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
endforeach()
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
elseif( ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
elseif( ${basename}_LIBRARY_DEBUG )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
else()
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif()
mark_as_advanced( ${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro()

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2

View file

@ -56,17 +56,6 @@
default=yes
[/advanced_preference]
[advanced_preference]
field=ping_timeout
name= _ "Ping timeout"
description= _ "Number of seconds to wait for a ping reply before timing out. Set to 0 to disable"
type=int
default=0
min=0
max=60
step=5
[/advanced_preference]
[advanced_preference]
field=lobby_auto_open_whisper_windows
name= _ "Auto-open whisper windows in lobby"
@ -150,12 +139,6 @@
default=yes
[/advanced_preference]
[advanced_preference]
field=advanced_graphic_options
name= _ "Graphics scaling options"
type=custom
[/advanced_preference]
[advanced_preference]
field=orb_color
name= _ "Customize orb colors"
@ -177,207 +160,22 @@
[/advanced_preference]
[advanced_preference]
field=show_halos
name= _ "Show haloing effects"
description= _ "Show special unit graphical effects"
field=show_deprecation
name= _ "Show deprecation messages in-game"
description= _ "Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
type=boolean
default=yes
default=no
[/advanced_preference]
[advanced_preference]
field=use_prng
name= _ "Use experimental PRNG combat"
description= _ "Enables more determinstic chance-to-hit calculations. This is an experimental feature designed to bring the observed hit/miss rate more in line with the displayed percentages.
Note: this option only affects singleplayer, and the Save random seed option must also be enabled when creating a game for this to work."
type=boolean
default=no
[/advanced_preference]
#ifdef __UNUSED__
[advanced_preference]
field=show_deprecation
# TODO: Add translation marks and enable this after 1.14
name="Show deprecation messages in-game"
description="Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
type=boolean
default=no
[/advanced_preference]
[advanced_preference]
field=joystick_support_enabled
name= _ "Joystick support"
type=boolean
default=no
[/advanced_preference]
[advanced_preference]
field=joystick_num_scroll_xaxis
name= _ "Joystick: number of the scroll X-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_xaxis_num
name= _ "Joystick: number of the scroll X-axis"
type=int
default=0
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_scroll_yaxis
name= _ "Joystick: number of the scroll Y-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_yaxis_num
name= _ "Joystick: number of the scroll Y-axis"
type=int
default=1
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_deadzone
name= _ "Joystick: deadzone of the scrolling stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_cursor_xaxis
name= _ "Joystick: number of the cursor X-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_xaxis_num
name= _ "Joystick: number of the cursor X-axis"
type=int
default=3
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_cursor_yaxis
name= _ "Joystick: number of the cursor Y-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_yaxis_num
name= _ "Joystick: number of the cursor Y-axis"
type=int
default=4
min=-1
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_deadzone
name= _ "Joystick: deadzone of the cursor stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_mouse_xaxis
name= _ "Joystick: number of the mouse X-axis joystick"
type=int
default=-1
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_xaxis_num
name= _ "Joystick: number of the mouse X-axis"
type=int
default=0
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_mouse_yaxis
name= _ "Joystick: number of the mouse Y-axis joystick"
type=int
default=-1
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_yaxis_num
name= _ "Joystick: number of the mouse Y-axis"
type=int
default=1
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_deadzone
name= _ "Joystick: deadzone of the mouse stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_thrusta_axis
name= _ "Joystick: number of the thrust axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_thrusta_axis_num
name= _ "Joystick: number of the thrust axis"
type=int
default=2
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_thrusta_deadzone
name= _ "Joystick: deadzone of the thruster"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
#endif

View file

@ -895,43 +895,18 @@ end
--------- Unit related helper functions ----------
function ai_helper.get_live_units(filter)
-- Same as wesnoth.get_units(), except that it only returns non-petrified units
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (not unit.status.petrified) then table.insert(units, unit) end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units { { "not", { status = "petrified" } }, { "and", filter } }
end
function ai_helper.get_units_with_moves(filter)
-- Using formula = '$this_unit.moves > 0' is slow, this method is much faster
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (unit.moves > 0) then table.insert(units, unit) end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units { { "and", { formula = "moves > 0" } }, { "and", filter } }
end
function ai_helper.get_units_with_attacks(filter)
-- Using formula = '$this_unit.attacks_left > 0' is slow, this method is much faster
-- Also need to check that units actually have attacks (as attacks_left > 0 with no attacks is possible)
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (unit.attacks_left > 0) and (#unit.attacks > 0) then
table.insert(units, unit)
end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units { { "and", { formula = "attacks_left > 0 and size(attacks) > 0" } }, { "and", filter } }
end
function ai_helper.get_visible_units(viewing_side, filter)
@ -1092,9 +1067,9 @@ end
function ai_helper.has_ability(unit, ability)
-- Returns true/false depending on whether unit has the given ability
local has_ability = false
local abilities = H.get_child(unit.__cfg, "abilities")
local abilities = wml.get_child(unit.__cfg, "abilities")
if abilities then
if H.get_child(abilities, ability) then has_ability = true end
if wml.get_child(abilities, ability) then has_ability = true end
end
return has_ability
end

View file

@ -38,11 +38,11 @@ function battle_calcs.unit_attack_info(unit, cache)
resist_mod = {},
alignment = unit_cfg.alignment
}
for attack in H.child_range(unit_cfg, 'attack') do
for attack in wml.child_range(unit_cfg, 'attack') do
-- Extract information for specials; we do this first because some
-- custom special might have the same name as one of the default scalar fields
local a = {}
for special in H.child_range(attack, 'specials') do
for special in wml.child_range(attack, 'specials') do
for _,sp in ipairs(special) do
if (sp[1] == 'damage') then -- this is 'backstab'
if (sp[2].id == 'backstab') then

View file

@ -23,8 +23,6 @@ return {
end
math.randomseed(os.time())
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
@ -60,10 +58,10 @@ return {
random_gender = false
}
-- Find the best regeneration ability and use it to estimate hp regained by regeneration
local abilities = H.get_child(unit.__cfg, "abilities")
local abilities = wml.get_child(unit.__cfg, "abilities")
local regen_amount = 0
if abilities then
for regen in H.child_range(abilities, "regenerate") do
for regen in wml.child_range(abilities, "regenerate") do
if regen.value > regen_amount then
regen_amount = regen.value
end
@ -121,21 +119,21 @@ return {
-- This may be rectifiable by looking at retaliation damage as well.
local steadfast = false
for attack in H.child_range(wesnoth.unit_types[attacker.type].__cfg, "attack") do
for attack in wml.child_range(wesnoth.unit_types[attacker.type].__cfg, "attack") do
local defense = defender_defense
local poison = false
local damage_multiplier = 1
local damage_bonus = 0
local weapon_damage = attack.damage
for special in H.child_range(attack, 'specials') do
for special in wml.child_range(attack, 'specials') do
local mod
if H.get_child(special, 'poison') and can_poison then
if wml.get_child(special, 'poison') and can_poison then
poison = true
end
-- Handle marksman and magical
mod = H.get_child(special, 'chance_to_hit')
mod = wml.get_child(special, 'chance_to_hit')
if mod then
if mod.value then
if mod.cumulative then
@ -157,7 +155,7 @@ return {
end
-- Handle most damage specials (assumes all are cumulative)
mod = H.get_child(special, 'damage')
mod = wml.get_child(special, 'damage')
if mod and mod.active_on ~= "defense" then
local special_multiplier = 1
local special_bonus = 0
@ -195,10 +193,10 @@ return {
-- Handle drain for defender
local drain_recovery = 0
for defender_attack in H.child_range(defender.__cfg, 'attack') do
for defender_attack in wml.child_range(defender.__cfg, 'attack') do
if (defender_attack.range == attack.range) then
for special in H.child_range(defender_attack, 'specials') do
if H.get_child(special, 'drains') and drainable(attacker) then
for special in wml.child_range(defender_attack, 'specials') do
if wml.get_child(special, 'drains') and drainable(attacker) then
-- TODO: calculate chance to hit
-- currently assumes 50% chance to hit using supplied constant
local attacker_resistance = wesnoth.unit_resistance(attacker, defender_attack.type)
@ -293,9 +291,9 @@ return {
end
function can_slow(unit)
for defender_attack in H.child_range(unit.__cfg, 'attack') do
for special in H.child_range(defender_attack, 'specials') do
if H.get_child(special, 'slow') then
for defender_attack in wml.child_range(unit.__cfg, 'attack') do
for special in wml.child_range(defender_attack, 'specials') do
if wml.get_child(special, 'slow') then
return true
end
end
@ -420,9 +418,20 @@ return {
add_unit_type(unit_type)
end
end
-- If no enemies were found, add a small number of "representative" unit types
if #enemy_types == 0 then
add_unit_type('Orcish Grunt')
add_unit_type('Orcish Archer')
add_unit_type('Wolf Rider')
add_unit_type('Spearman')
add_unit_type('Bowman')
add_unit_type('Cavalryman')
end
data.enemy_counts = enemy_counts
data.enemy_types = enemy_types
data.num_enemies = #enemies
data.num_enemies = math.max(#enemies, 1)
data.possible_enemy_recruit_count = possible_enemy_recruit_count
return data
@ -443,7 +452,7 @@ return {
end
function ai_cas:recruit_rushers_exec()
if AH.show_messages() then W.message { speaker = 'narrator', message = 'Recruiting' } end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = 'narrator', message = 'Recruiting' } end
local enemy_counts = recruit_data.recruit.enemy_counts
local enemy_types = recruit_data.recruit.enemy_types
@ -577,6 +586,9 @@ return {
return true
else
-- This results in the CA being blacklisted -> clear cache
recruit_data.recruit = nil
return false
end
end
@ -652,14 +664,32 @@ return {
local best_scores = {offense = 0, defense = 0, move = 0}
local best_hex = recruit_data.recruit.best_hex
local target_hex = recruit_data.recruit.target_hex
local distance_to_enemy, enemy_location
if target_hex[1] then
distance_to_enemy, enemy_location = AH.get_closest_enemy(target_hex, wesnoth.current.side, { viewing_side = 0 })
else
distance_to_enemy, enemy_location = AH.get_closest_enemy(best_hex, wesnoth.current.side, { viewing_side = 0 })
local reference_hex = target_hex[1] and target_hex or best_hex
local distance_to_enemy, enemy_location = AH.get_closest_enemy(reference_hex, wesnoth.current.side, { viewing_side = 0 })
-- If no enemy is on the map, then we first use closest enemy start hex,
-- and if that does not exist either, a location mirrored w.r.t the center of the map
if not enemy_location then
local enemy_sides = wesnoth.get_sides({ { "enemy_of", {side = wesnoth.current.side} } })
local min_dist = math.huge
for _, side in ipairs(enemy_sides) do
local enemy_start_hex = wesnoth.special_locations[side.side]
if enemy_start_hex then
local dist = wesnoth.map.distance_between(reference_hex[1], reference_hex[2], enemy_start_hex[1], enemy_start_hex[2])
if dist < min_dist then
min_dist = dist
enemy_location = { x = enemy_start_hex[1], y = enemy_start_hex[2] }
end
end
end
if not enemy_location then
local width, height = wesnoth.get_map_size()
enemy_location = { x = width + 1 - reference_hex[1], y = height + 1 - reference_hex[2] }
end
distance_to_enemy = wesnoth.map.distance_between(reference_hex[1], reference_hex[2], enemy_location.x, enemy_location.y)
end
local gold_limit = 9e99
local gold_limit = math.huge
if recruit_data.castle.loose_gold_limit >= recruit_data.recruit.cheapest_unit_cost then
gold_limit = recruit_data.castle.loose_gold_limit
end
@ -936,7 +966,7 @@ return {
local test_units, num_recruits = {}, 0
local movetypes = {}
for x,id in ipairs(wesnoth.sides[wesnoth.current.side].recruit) do
local custom_movement = H.get_child(wesnoth.unit_types[id].__cfg, "movement_costs")
local custom_movement = wml.get_child(wesnoth.unit_types[id].__cfg, "movement_costs")
local movetype = wesnoth.unit_types[id].__cfg.movement_type
if custom_movement
or (not movetypes[movetype])

View file

@ -6,8 +6,6 @@ return {
-- More generic grunt rush (and can, in fact, be used with other unit types as well)
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
@ -256,7 +254,7 @@ return {
local leader = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1]
if AH.print_exec() then print_time(' Executing castle_switch CA') end
if AH.show_messages() then W.message { speaker = leader.id, message = 'Switching castles' } end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = leader.id, message = 'Switching castles' } end
AH.checked_move(ai, leader, self.data.leader_target[1], self.data.leader_target[2])
self.data.leader_target = nil
@ -395,7 +393,7 @@ return {
function generic_rush:grab_villages_exec()
if AH.print_exec() then print_time(' Executing grab_villages CA') end
if AH.show_messages() then W.message { speaker = self.data.unit.id, message = 'Grab villages' } end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = self.data.unit.id, message = 'Grab villages' } end
AH.movefull_stopunit(ai, self.data.unit, self.data.village)
self.data.unit, self.data.village = nil, nil
@ -492,7 +490,7 @@ return {
local is_poisoner, poison_weapon = AH.has_weapon_special(attacker, "poison")
if AH.print_exec() then print_time(' Executing spread_poison CA') end
if AH.show_messages() then W.message { speaker = attacker.id, message = 'Poison attack' } end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = attacker.id, message = 'Poison attack' } end
AH.robust_move_and_attack(ai, attacker, self.data.attack.dst, self.data.attack.target, { weapon = poison_weapon })

View file

@ -84,8 +84,8 @@ function retreat_functions.get_healing_locations()
if u.moves == 0 or u.side ~= wesnoth.current.side then
local heal_amount = 0
local cure = 0
local abilities = H.get_child(u.__cfg, "abilities") or {}
for ability in H.child_range(abilities, "heals") do
local abilities = wml.get_child(u.__cfg, "abilities") or {}
for ability in wml.child_range(abilities, "heals") do
heal_amount = ability.value
if ability.poison == "slowed" then
cure = 1

View file

@ -5,12 +5,12 @@ local LS = wesnoth.require "location_set"
local function get_units_target(cfg)
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
local target = wesnoth.get_units {
{ "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } },
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}[1]
return units, target
@ -55,7 +55,7 @@ function ca_assassin_move:execution(cfg)
local enemies = AH.get_visible_units(wesnoth.current.side, {
{ "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } },
{ "not", H.get_child(cfg, "filter_second") }
{ "not", wml.get_child(cfg, "filter_second") }
})
-- Maximum damage the enemies can theoretically do for all hexes they can attack
@ -128,7 +128,7 @@ function ca_assassin_move:execution(cfg)
-- Preferred hexes (do this here once for all hexes, so that it does not need
-- to get done for every step of the a* search.
-- We only need to know whether a hex is preferred or not, there's no additional rating.
local prefer_slf = H.get_child(cfg, "prefer")
local prefer_slf = wml.get_child(cfg, "prefer")
local prefer_map -- want this to be nil, not empty LS if [prefer] tag not given
if prefer_slf then
local preferred_hexes = wesnoth.get_locations(prefer_slf)

View file

@ -6,7 +6,7 @@ local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local function get_big_animals(cfg)
local big_animals = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and" , H.get_child(cfg, "filter") }
{ "and" , wml.get_child(cfg, "filter") }
}
return big_animals
end
@ -24,7 +24,7 @@ function ca_big_animals:execution(cfg)
local unit = get_big_animals(cfg)[1]
local avoid_tag = H.get_child(cfg, "avoid_unit")
local avoid_tag = wml.get_child(cfg, "avoid_unit")
local avoid_map = LS.create()
if avoid_tag then
local enemies_to_be_avoided = AH.get_attackable_enemies(avoid_tag)
@ -41,7 +41,7 @@ function ca_big_animals:execution(cfg)
-- Unit gets a new goal if none is set or on any move with a 10% random chance
local r = math.random(10)
if (not goal.goal_x) or (r == 1) then
local locs = AH.get_passable_locations(H.get_child(cfg, "filter_location") or {})
local locs = AH.get_passable_locations(wml.get_child(cfg, "filter_location") or {})
local rand = math.random(#locs)
goal.goal_x, goal.goal_y = locs[rand][1], locs[rand][2]
@ -49,7 +49,7 @@ function ca_big_animals:execution(cfg)
end
local reach_map = AH.get_reachable_unocc(unit)
local wander_terrain = H.get_child(cfg, "filter_location_wander") or {}
local wander_terrain = wml.get_child(cfg, "filter_location_wander") or {}
reach_map:iter( function(x, y, v)
-- Remove tiles that do not comform to the wander terrain filter
if (not wesnoth.match_location(x, y, wander_terrain)) then

View file

@ -2,7 +2,7 @@ local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_coward(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local coward = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -23,7 +23,7 @@ function ca_coward:execution(cfg)
local reach = wesnoth.find_reach(coward)
local filter_second =
H.get_child(cfg, "filter_second")
wml.get_child(cfg, "filter_second")
or { { "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } } }
local enemies = AH.get_live_units {
{ "and", filter_second },

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local T = wml.tag
@ -22,7 +21,7 @@ function ca_fast_attack_utils.get_avoid_map(cfg)
-- Use [micro_ai][avoid] tag with priority over [ai][avoid].
-- If neither is given, return an empty location set.
local avoid_tag = H.get_child(cfg, "avoid")
local avoid_tag = wml.get_child(cfg, "avoid")
if not avoid_tag then
return LS.of_pairs(ai.aspects.avoid)
@ -118,7 +117,7 @@ function ca_fast_attack_utils.single_unit_info(unit_proxy)
}
-- Include the ability type, such as: hides, heals, regenerate, skirmisher (set up as 'hides = true')
local abilities = H.get_child(unit_proxy.__cfg, "abilities")
local abilities = wml.get_child(unit_proxy.__cfg, "abilities")
if abilities then
for _,ability in ipairs(abilities) do
single_unit_info[ability[1]] = true
@ -128,11 +127,11 @@ function ca_fast_attack_utils.single_unit_info(unit_proxy)
-- Information about the attacks indexed by weapon number,
-- including specials (e.g. 'poison = true')
single_unit_info.attacks = {}
for attack in H.child_range(unit_cfg, 'attack') do
for attack in wml.child_range(unit_cfg, 'attack') do
-- Extract information for specials; we do this first because some
-- custom special might have the same name as one of the default scalar fields
local a = {}
for special in H.child_range(attack, 'specials') do
for special in wml.child_range(attack, 'specials') do
for _,sp in ipairs(special) do
if (sp[1] == 'damage') then -- this is 'backstab'
if (sp[2].id == 'backstab') then

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua"
local LS = wesnoth.require "location_set"
@ -9,8 +8,8 @@ function ca_fast_combat:evaluation(cfg, data)
data.move_cache = { turn = wesnoth.current.turn }
data.gamedata = FAU.gamedata_setup()
local filter_own = H.get_child(cfg, "filter")
local filter_enemy = H.get_child(cfg, "filter_second")
local filter_own = wml.get_child(cfg, "filter")
local filter_enemy = wml.get_child(cfg, "filter_second")
local enemies
local units_sorted = true

View file

@ -18,8 +18,8 @@ function ca_fast_combat_leader:evaluation(cfg, data)
data.move_cache = { turn = wesnoth.current.turn }
data.gamedata = FAU.gamedata_setup()
local filter_own = H.get_child(cfg, "filter")
local filter_enemy = H.get_child(cfg, "filter_second")
local filter_own = wml.get_child(cfg, "filter")
local filter_enemy = wml.get_child(cfg, "filter_second")
local enemies, leader
if (not filter_own) and (not filter_enemy) then

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
@ -45,9 +43,9 @@ function ca_forest_animals_move:execution(cfg)
local enemies = AH.get_attackable_enemies()
-- Get the locations of all the rabbit holes
W.store_items { variable = 'holes_wml' }
local all_items = H.get_variable_array('holes_wml')
W.clear_variable { name = 'holes_wml' }
wesnoth.wml_actions.store_items { variable = 'holes_wml' }
local all_items = wml.array_access.get('holes_wml')
wesnoth.wml_actions.clear_variable { name = 'holes_wml' }
-- If cfg.rabbit_hole_img is set, only items with that image or halo count as holes
local holes
@ -73,7 +71,7 @@ function ca_forest_animals_move:execution(cfg)
end
-- If no close enemies, do a random move
local wander_terrain = H.get_child(cfg, "filter_location") or {}
local wander_terrain = wml.get_child(cfg, "filter_location") or {}
if (not close_enemies[1]) then
local reach = AH.get_reachable_unocc(unit)
local width, height = wesnoth.get_map_size()

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local T = wml.tag
@ -18,9 +16,9 @@ function ca_forest_animals_new_rabbit:execution(cfg)
local rabbit_enemy_distance = cfg.rabbit_enemy_distance or 3
-- Get the locations of all items on that map (which could be rabbit holes)
W.store_items { variable = 'holes_wml' }
local all_items = H.get_variable_array('holes_wml')
W.clear_variable { name = 'holes_wml' }
wesnoth.wml_actions.store_items { variable = 'holes_wml' }
local all_items = wml.array_access.get('holes_wml')
wesnoth.wml_actions.clear_variable { name = 'holes_wml' }
-- Eliminate all holes that have an enemy within 'rabbit_enemy_distance' hexes
-- We also add a random number to the ones we keep, for selection of the holes later

View file

@ -25,13 +25,31 @@ function ca_goto:evaluation(cfg, data)
return 0
end
local all_units = AH.get_units_with_moves {
{ "and", { side = wesnoth.current.side } },
{ "and", wml.get_child(cfg, "filter") }
}
local units = {}
if cfg.release_unit_at_goal then
for _,unit in ipairs(all_units) do
if (not MAIUV.get_mai_unit_variables(unit, cfg.ai_id, "release")) then
table.insert(units, unit)
end
end
else
units = all_units
end
if (not units[1]) then return 0 end
-- For convenience, we check for locations here, and just pass that to the exec function
-- This is mostly to make the unique_goals option easier
local width, height = wesnoth.get_map_size()
local all_locs = wesnoth.get_locations {
x = '1-' .. width,
y = '1-' .. height,
{ "and", H.get_child(cfg, "filter_location") }
{ "and", wml.get_child(cfg, "filter_location") }
}
if (#all_locs == 0) then return 0 end
@ -60,23 +78,6 @@ function ca_goto:evaluation(cfg, data)
end
if (not locs[1]) then return 0 end
local all_units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
}
local units = {}
if cfg.release_unit_at_goal then
for _,unit in ipairs(all_units) do
if (not MAIUV.get_mai_unit_variables(unit, cfg.ai_id, "release")) then
table.insert(units, unit)
end
end
else
units = all_units
end
if (not units[1]) then return 0 end
-- Now store units and locs, so that we don't need to duplicate this in the exec function
GO_units, GO_locs = units, locs

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -8,7 +7,7 @@ local M = wesnoth.map
local function get_hang_out_units(cfg)
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return units
end
@ -22,14 +21,14 @@ function ca_hang_out:evaluation(cfg, data)
end
-- Otherwise check if any of the mobilize conditions are now met
local mobilize_condition = H.get_child(cfg, "mobilize_condition")
local mobilize_condition = wml.get_child(cfg, "mobilize_condition")
if (mobilize_condition and wesnoth.eval_conditional(mobilize_condition))
or (cfg.mobilize_on_gold_less_than and (wesnoth.sides[wesnoth.current.side].gold < cfg.mobilize_on_gold_less_than))
then
MAISD.insert_mai_self_data(data, cfg.ai_id, { mobilize_units = true })
-- Need to unmark all units also (all units, with and without moves)
local units = wesnoth.get_units { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } }
local units = wesnoth.get_units { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } }
for _,unit in ipairs(units) do
MAIUV.delete_mai_unit_variables(unit, cfg.ai_id)
end
@ -46,7 +45,7 @@ function ca_hang_out:execution(cfg)
-- Get the locations close to which the units should hang out
-- cfg.filter_location defaults to the location of the side leader(s)
local filter_location = H.get_child(cfg, "filter_location") or {
local filter_location = wml.get_child(cfg, "filter_location") or {
{ "filter", { side = wesnoth.current.side, canrecruit = "yes" } }
}
@ -60,15 +59,15 @@ function ca_hang_out:execution(cfg)
-- Get map of locations to be avoided.
-- Use [micro_ai][avoid] tag with priority over [ai][avoid].
-- If neither is given, default to all castle terrain.
local avoid_tag = H.get_child(cfg, "avoid")
local avoid_tag = wml.get_child(cfg, "avoid")
local avoid_map
if avoid_tag then
avoid_map = LS.of_pairs(wesnoth.get_locations(avoid_tag))
else
local ai_tag = H.get_child(wesnoth.sides[wesnoth.current.side].__cfg, 'ai')
for aspect in H.child_range(ai_tag, 'aspect') do
local ai_tag = wml.get_child(wesnoth.sides[wesnoth.current.side].__cfg, 'ai')
for aspect in wml.child_range(ai_tag, 'aspect') do
if (aspect.id == 'avoid') then
local facet = H.get_child(aspect, 'facet')
local facet = wml.get_child(aspect, 'facet')
if facet or aspect.name ~= "composite_aspect" then
-- If there's a [facet] child, it's set as a composite aspect,
-- with at least one facet.

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local ca_healer_initialize = {}
function ca_healer_initialize:evaluation()
@ -19,7 +17,7 @@ function ca_healer_initialize:execution(cfg, data)
id = "no_healers_attack",
invalidate_on_gamestate_change = "yes",
{ "filter_own", {
{ "not", { ability = "healing", { "and", H.get_child(cfg, "filter") } } }
{ "not", { ability = "healing", { "and", wml.get_child(cfg, "filter") } } }
} }
}
)

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
@ -16,7 +15,7 @@ function ca_healer_move:evaluation(cfg, data)
local all_healers = wesnoth.get_units {
side = wesnoth.current.side,
ability = "healing",
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
local healers, healers_noMP = {}, {}
@ -31,7 +30,7 @@ function ca_healer_move:evaluation(cfg, data)
local all_healees = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
local healees, healees_MP = {}, {}

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_sheep(cfg)
local sheep = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return sheep
end
@ -13,7 +12,7 @@ end
local function get_dogs(cfg)
local dogs = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return dogs
end
@ -22,7 +21,7 @@ local function get_enemies(cfg, radius)
local enemies = AH.get_attackable_enemies {
{ "filter_location",
{ radius = radius,
{ "filter", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter_second") } } } }
{ "filter", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter_second") } } } }
}
}
return enemies

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
@ -6,8 +5,8 @@ local M = wesnoth.map
local function get_dog(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter_second") } } } } }
{ "and", wml.get_child(cfg, "filter") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter_second") } } } } }
}
return dogs[1]
end
@ -23,7 +22,7 @@ end
function ca_herding_dog_move:execution(cfg)
-- We simply move the first dog first, order does not matter
local dog = get_dog(cfg)
local herding_perimeter = LS.of_pairs(wesnoth.get_locations(H.get_child(cfg, "filter_location")))
local herding_perimeter = LS.of_pairs(wesnoth.get_locations(wml.get_child(cfg, "filter_location")))
-- Find average distance of herding_perimeter from center
local av_dist = 0

View file

@ -1,10 +1,9 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_dog(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") },
{ "and", wml.get_child(cfg, "filter") },
}
return dogs[1]
end

View file

@ -4,7 +4,7 @@ local LS = wesnoth.require "location_set"
return function(cfg)
-- Find the area that the sheep can occupy
-- First, find all contiguous hexes around center hex that are inside herding_perimeter
local location_filter = H.get_child(cfg, "filter_location")
local location_filter = wml.get_child(cfg, "filter_location")
local herding_area = LS.of_pairs(wesnoth.get_locations {
x = cfg.herd_x,
y = cfg.herd_y,

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
@ -7,7 +6,7 @@ local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area
local function get_dogs(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return dogs
end
@ -15,8 +14,8 @@ end
local function get_sheep_to_herd(cfg)
local all_sheep = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } } } } }
{ "and", wml.get_child(cfg, "filter_second") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } } } } }
}
local sheep_to_herd = {}
@ -63,7 +62,7 @@ function ca_herding_herd_sheep:execution(cfg)
-- And the closer dog goes first (so that it might be able to chase another sheep afterward)
rating = rating - M.distance_between(x, y, dog.x, dog.y) / 100.
-- Finally, prefer to stay on path, if possible
if (wesnoth.match_location(x, y, H.get_child(cfg, "filter_location")) ) then rating = rating + 0.001 end
if (wesnoth.match_location(x, y, wml.get_child(cfg, "filter_location")) ) then rating = rating + 0.001 end
reach_map:insert(x, y, rating)

View file

@ -6,7 +6,7 @@ local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area
local function get_next_sheep(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return sheep[1]
end
@ -24,7 +24,7 @@ function ca_herding_sheep_move:execution(cfg)
local sheep = get_next_sheep(cfg)
local reach_map = AH.get_reachable_unocc(sheep)
local dogs_filter = H.get_child(cfg, "filter")
local dogs_filter = wml.get_child(cfg, "filter")
-- Exclude those that are next to a dog
reach_map:iter( function(x, y, v)
for xa, ya in H.adjacent_tiles(x, y) do

View file

@ -1,12 +1,11 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_next_sheep(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") },
{ "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } } }
{ "and", wml.get_child(cfg, "filter_second") },
{ "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } } }
}
return sheep[1]
end
@ -24,7 +23,7 @@ function ca_herding_sheep_runs_dog:execution(cfg)
local sheep = get_next_sheep(cfg)
-- Get the first dog that the sheep is adjacent to
local dog = wesnoth.get_units { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") },
local dog = wesnoth.get_units { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") },
{ "filter_adjacent", { x = sheep.x, y = sheep.y } }
}[1]

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_next_sheep_enemies(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
if (not sheep[1]) then return end

View file

@ -1,5 +1,4 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local M = wesnoth.map
@ -36,7 +35,7 @@ local function hunter_attack_weakest_adj_enemy(ai, hunter)
end
local function get_hunter(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local hunter = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -65,7 +64,7 @@ function ca_hunter:execution(cfg)
local rand = math.random(10)
if (not hunter_vars.goal_x) or (rand == 1) then
-- 'locs' includes border hexes, but that does not matter here
locs = AH.get_passable_locations((H.get_child(cfg, "filter_location") or {}), hunter)
locs = AH.get_passable_locations((wml.get_child(cfg, "filter_location") or {}), hunter)
local rand = math.random(#locs)
hunter_vars.goal_x, hunter_vars.goal_y = locs[rand][1], locs[rand][2]
@ -121,7 +120,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'Now that I have eaten, I will go back home.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'Now that I have eaten, I will go back home.' }
end
end
@ -142,7 +141,7 @@ function ca_hunter:execution(cfg)
local enemy = wesnoth.get_unit(cfg.home_x, cfg.home_y)
if AH.is_attackable_enemy(enemy) then
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'Get out of my home!' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'Get out of my home!' }
end
AH.checked_attack(ai, hunter, enemy)
@ -162,7 +161,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'I made it home - resting now until the end of Turn ' .. hunter_vars.resting_until .. ' or until fully healed.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'I made it home - resting now until the end of Turn ' .. hunter_vars.resting_until .. ' or until fully healed.' }
end
end
@ -185,7 +184,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'I am done resting. It is time to go hunting again next turn.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'I am done resting. It is time to go hunting again next turn.' }
end
end
return

View file

@ -1,12 +1,11 @@
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local H = wesnoth.require "helper"
local function get_lurker(cfg)
-- We simply pick the first of the lurkers, they have no strategy
local lurker = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}[1]
return lurker
end
@ -26,7 +25,7 @@ function ca_lurkers:execution(cfg)
table.sort(targets, function(a, b) return (a.hitpoints < b.hitpoints) end)
local reach = LS.of_pairs(wesnoth.find_reach(lurker.x, lurker.y))
local lurk_area = H.get_child(cfg, "filter_location")
local lurk_area = wml.get_child(cfg, "filter_location")
local reachable_attack_terrain =
LS.of_pairs(wesnoth.get_locations {
{ "and", { x = lurker.x, y = lurker.y, radius = lurker.moves } },
@ -66,7 +65,7 @@ function ca_lurkers:execution(cfg)
local reachable_wander_terrain =
LS.of_pairs( wesnoth.get_locations {
{ "and", { x = lurker.x, y = lurker.y, radius = lurker.moves } },
{ "and", H.get_child(cfg, "filter_location_wander") or lurk_area }
{ "and", wml.get_child(cfg, "filter_location_wander") or lurk_area }
})
reachable_wander_terrain:inter(reach)

View file

@ -45,11 +45,11 @@ local function messenger_find_clearing_attack(messenger, goal_x, goal_y, cfg)
local enemy_in_way = messenger_find_enemies_in_way(messenger, goal_x, goal_y)
if (not enemy_in_way) then return end
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local units = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "not", filter },
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
if (not units[1]) then return end

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -9,7 +8,7 @@ local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f
local function get_escorts(cfg)
local escorts = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return escorts
end

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -10,7 +9,7 @@ return function(cfg)
-- Returns nil for first 3 arguments if no messenger has moves left
-- Returns nil for all arguments if there are no messengers on the map
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local messengers = wesnoth.get_units { side = wesnoth.current.side, { "and", filter } }
if (not messengers[1]) then return end

View file

@ -1,9 +1,8 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local function get_patrol(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local patrol = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
@ -10,7 +9,7 @@ function ca_protect_unit_attack:evaluation(cfg)
-- or the counter attack on the enemy turn, it does not attack, even if that's really unlikely
local units = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
table.insert(units, AH.get_units_with_attacks { id = u.id }[1])
end
if (not units[1]) then return 0 end

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_protect_unit_finish, PU_unit, PU_goal = {}
function ca_protect_unit_finish:evaluation(cfg)
-- If a unit can make it to the goal, this is the first thing that happens
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
local unit = AH.get_units_with_moves { id = u.id }[1]
if unit then
local path, cost = AH.find_path_with_shroud(unit, u.goal_x, u.goal_y)

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local function get_protected_units(cfg)
local units = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
table.insert(units, AH.get_units_with_moves { id = u.id }[1])
end
return units
@ -38,7 +37,7 @@ function ca_protect_unit_move:execution(cfg, data)
-- We move the weakest (fewest HP unit) first
local unit = AH.choose(protected_units, function(u) return - u.hitpoints end)
local goal = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
if (unit.id == u.id) then goal = { u.goal_x, u.goal_y } end
end

View file

@ -59,7 +59,7 @@ function ca_recruit_random:evaluation(cfg)
local probabilities, probability_sum = {}, 0
-- Go through all the types listed in [probability] tags (which can be comma-separated lists)
for prob in H.child_range(cfg, "probability") do
for prob in wml.child_range(cfg, "probability") do
types = AH.split(prob.type, ",")
for _,typ in ipairs(types) do -- 'type' is a reserved keyword in Lua
-- If this type is in the recruit list, add it

View file

@ -1,8 +1,7 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
@ -8,13 +7,13 @@ local ca_simple_attack, best_attack = {}
function ca_simple_attack:evaluation(cfg)
local units = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
if (not units[1]) then return 0 end
-- If cfg.filter_second is set, set up a map (location set)
-- of enemies that it is okay to attack
local enemy_filter = H.get_child(cfg, "filter_second")
local enemy_filter = wml.get_child(cfg, "filter_second")
local enemy_map
if enemy_filter then
local enemies = AH.get_attackable_enemies(enemy_filter)

View file

@ -3,7 +3,7 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local M = wesnoth.map
@ -6,15 +5,15 @@ local M = wesnoth.map
local function get_wolves(cfg)
local wolves = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return wolves
end
local function get_prey(cfg)
-- Note: we cannot pass H.get_child() directly to AH.get_attackable_enemies()
-- Note: we cannot pass wml.get_child() directly to AH.get_attackable_enemies()
-- as the former returns two values and the latter takes optional arguments
local filter_second = H.get_child(cfg, "filter_second")
local filter_second = wml.get_child(cfg, "filter_second")
local prey = AH.get_attackable_enemies(filter_second)
return prey
end

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
@ -6,7 +5,7 @@ local LS = wesnoth.require "location_set"
local function get_wolves(cfg)
local wolves = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return wolves
end

View file

@ -4,7 +4,7 @@ local LS = wesnoth.require "location_set"
local M = wesnoth.map
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -23,8 +23,8 @@ function ca_zone_guardian:execution(cfg)
local guardian = get_guardian(cfg)
local reach = wesnoth.find_reach(guardian)
local zone = H.get_child(cfg, "filter_location")
local zone_enemy = H.get_child(cfg, "filter_location_enemy") or zone
local zone = wml.get_child(cfg, "filter_location")
local zone_enemy = wml.get_child(cfg, "filter_location_enemy") or zone
local enemies = AH.get_attackable_enemies { { "filter_location", zone_enemy } }
if enemies[1] then
local min_dist, target = 9e99

View file

@ -33,7 +33,7 @@ return {
moves = "current",
variable = "tmp_locs"
}
attack_locs = H.get_variable_array("tmp_locs")
attack_locs = wml.array_access.get("tmp_locs")
W.clear_variable { name = "tmp_locs" }
if (#attack_locs > 0) then break end
end

View file

@ -30,7 +30,7 @@ function wesnoth.micro_ais.wolves(cfg)
id = "mai_wolves_" .. (cfg.ca_id or "default") .. "_dont_attack",
invalidate_on_gamestate_change = "yes",
{ "filter_enemy", {
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
} }
}
}
@ -165,7 +165,7 @@ function wesnoth.micro_ais.wolves_multipacks(cfg)
end
function wesnoth.micro_ais.hunter(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Hunter [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "home_x", "home_y" }

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.messenger_escort(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Messenger [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "waypoint_x", "waypoint_y" }

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.fast_ai(cfg)
local optional_keys = {
"attack_hidden_enemies", "[avoid]", "dungeon_mode",

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.stationed_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Stationed Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "distance", "station_x", "station_y" }
@ -14,7 +14,7 @@ function wesnoth.micro_ais.stationed_guardian(cfg)
end
function wesnoth.micro_ais.zone_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Zone Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "[filter_location]" }
@ -27,7 +27,7 @@ function wesnoth.micro_ais.zone_guardian(cfg)
end
function wesnoth.micro_ais.return_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Return Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "return_x", "return_y" }
@ -40,7 +40,7 @@ function wesnoth.micro_ais.return_guardian(cfg)
end
function wesnoth.micro_ais.coward(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Coward [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "distance" }

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.patrol(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Patrol [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "waypoint_x", "waypoint_y" }

View file

@ -11,7 +11,7 @@ function wesnoth.micro_ais.protect_unit(cfg)
}
local unit_ids = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
if not u.id then
H.wml_error("Protect Unit Micro AI missing id key in [unit] tag")
end

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local function handle_default_recruitment(cfg)
-- Also need to delete/add the default recruitment CA
if cfg.action == 'add' then

View file

@ -39,9 +39,9 @@ function micro_ai_helper.add_CAs(side, ca_id_core, CA_parms, CA_cfg)
while id_found do -- This is really just a precaution
id_found = false
for ai_tag in H.child_range(wesnoth.sides[side].__cfg, 'ai') do
for stage in H.child_range(ai_tag, 'stage') do
for ca in H.child_range(stage, 'candidate_action') do
for ai_tag in wml.child_range(wesnoth.sides[side].__cfg, 'ai') do
for stage in wml.child_range(ai_tag, 'stage') do
for ca in wml.child_range(stage, 'candidate_action') do
if string.find(ca.name, ai_id .. '_') then
id_found = true
break
@ -54,10 +54,10 @@ function micro_ai_helper.add_CAs(side, ca_id_core, CA_parms, CA_cfg)
-- AI's data variable. However, the MAI can be changed while it is not
-- the AI's turn, when this is not possible. So instead, we check for the
-- existence of such tags and make sure we are using a different ai_id.
for ai_tag in H.child_range(wesnoth.sides[side].__cfg, 'ai') do
for engine in H.child_range(ai_tag, 'engine') do
for data in H.child_range(engine, 'data') do
for mai in H.child_range(data, 'micro_ai') do
for ai_tag in wml.child_range(wesnoth.sides[side].__cfg, 'ai') do
for engine in wml.child_range(ai_tag, 'engine') do
for data in wml.child_range(engine, 'data') do
for mai in wml.child_range(data, 'micro_ai') do
if (mai.ai_id == ai_id) then
id_found = true
break
@ -169,10 +169,10 @@ function micro_ai_helper.micro_ai_setup(cfg, CA_parms, required_keys, optional_k
for _,v in pairs(required_keys) do
if v:match('%[[a-zA-Z0-9_]+%]') then
v = v:sub(2,-2)
if not H.get_child(cfg, v) then
if not wml.get_child(cfg, v) then
H.wml_error("[micro_ai] tag (" .. cfg.ai_type .. ") is missing required parameter: [" .. v .. "]")
end
for child in H.child_range(cfg, v) do
for child in wml.child_range(cfg, v) do
table.insert(CA_cfg, T[v](child))
end
else
@ -187,7 +187,7 @@ function micro_ai_helper.micro_ai_setup(cfg, CA_parms, required_keys, optional_k
for _,v in pairs(optional_keys) do
if v:match('%[[a-zA-Z0-9_]+%]') then
v = v:sub(2,-2)
for child in H.child_range(cfg, v) do
for child in wml.child_range(cfg, v) do
table.insert(CA_cfg, T[v](child))
end
else

View file

@ -13,8 +13,6 @@
-- same side).
-- For the time being, we only allow key=value style variables.
local H = wesnoth.require "helper"
local micro_ai_self_data = {}
function micro_ai_self_data.modify_mai_self_data(self_data, ai_id, action, vars_table)
@ -79,7 +77,7 @@ function micro_ai_self_data.get_mai_self_data(self_data, ai_id, key)
-- table of key=value pairs (including the ai_id key)
-- - If no such tag is found: nil (if @key is set), otherwise empty table
for mai in H.child_range(self_data, "micro_ai") do
for mai in wml.child_range(self_data, "micro_ai") do
if (mai.ai_id == ai_id) then
if key then
return mai[key]

View file

@ -9,8 +9,6 @@
-- with different ai_CA values affecting the same unit)
-- For the time being, we only allow key=value style variables.
local H = wesnoth.require "helper"
local micro_ai_unit_variables = {}
function micro_ai_unit_variables.modify_mai_unit_variables(unit, ai_id, action, vars_table)
@ -70,7 +68,7 @@ function micro_ai_unit_variables.get_mai_unit_variables(unit, ai_id, key)
-- table of key=value pairs (including the ai_id key)
-- - If no such tag is found: nil (if @key is set), otherwise empty table
for mai in H.child_range(unit.variables.__cfg, "micro_ai") do
for mai in wml.child_range(unit.variables.__cfg, "micro_ai") do
if (mai.ai_id == ai_id) then
if key then
return mai[key]

View file

@ -213,9 +213,13 @@
message= _ "There are too many to fight, far too many. We must escape!"
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
{PLACE_IMAGE "scenery/signpost.png" 1 1}

View file

@ -218,7 +218,11 @@
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -335,14 +339,27 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "Important Note" _"<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."}
[message]
speaker=narrator
image=wesnoth-icon.png
caption="Important Note"
message= _ "<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."
[/message]
# wmlindent: start ignoring
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
"+{ANIMAL_AI_DESCRIPTIONS1}}
"+{ANIMAL_AI_DESCRIPTIONS1}
[/message]
# wmlindent: stop ignoring
{MESSAGE narrator "wesnoth-icon.png" "" {ANIMAL_AI_DESCRIPTIONS2}}
[message]
speaker=narrator
image=wesnoth-icon.png
message={ANIMAL_AI_DESCRIPTIONS2}
[/message]
[message]
speaker=narrator
@ -354,7 +371,7 @@
Note that there is no end to this scenario. For demonstration purposes, any unit that is killed is replaced by another unit of the same type at the beginning of the next turn. In order to end the scenario, there's a right-click option - but that only works in human-controlled mode. In AI-only mode, you have to press 'Esc' or reload a previous savefile.
Also note: The Animal AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
Also note: The Animal AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
# wmlindent: stop ignoring
# wmllint: unbalanced-off
[option]
@ -410,8 +427,11 @@ Also note: The Animal AIs are coded as Micro AIs. A Micro AI can be added and ad
[/filter_second]
# wmlindent: start ignoring
{MESSAGE $second_unit.id "" "" _"Yowl!
Translation: Those Ogres are mean! We better stay away from them and their young."}
[message]
speaker=$second_unit.id
message= _ "Yowl!
Translation: Those Ogres are mean! We better stay away from them and their young."
[/message]
# wmlindent: stop ignoring
[micro_ai]

View file

@ -82,14 +82,24 @@
[event]
name=start
{MESSAGE LuaAI "" "" _"All right, chaps. Those orcs need to be stopped."}
[message]
speaker=LuaAI
message= _ "All right, chaps. Those orcs need to be stopped."
[/message]
{STORE_UNIT_VAR (id=Big Bad Orc) profile profile}
{MESSAGE (Big Bad Orc) "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Big Bad Orc
image=$profile~FL()~RIGHT()
message= _ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE LuaAI "" "" _"We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
[message]
speaker=LuaAI
message= _ "We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
# wmllint: local spellings AIs RCA
@ -148,7 +158,10 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
side=1
[/have_unit]
[then]
{MESSAGE LuaAI "" "" _"I may have fallen, but we will continue to defend the pass to the last man!"}
[message]
speaker=LuaAI
message= _ "I may have fallen, but we will continue to defend the pass to the last man!"
[/message]
[/then]
[/if]
[/event]
@ -181,7 +194,11 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory

View file

@ -78,10 +78,15 @@
name=start
{STORE_UNIT_VAR (id=Dreadful Bat) profile profile}
{MESSAGE (Dreadful Bat) "" "" _"Be careful to stay out of the way of that dragon. He's a mean one."}
[message]
speaker=Dreadful Bat
message= _ "Be careful to stay out of the way of that dragon. He's a mean one."
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE Rowck "" "" _"Hi there. I am Rowck and here is what I do:
[message]
speaker=Rowck
message= _ "Hi there. I am Rowck and here is what I do:
When hungry, I move around part of the map in a random wander until I get into range of an enemy. If enemies are within range, I attack and devour the weakest of them. After that, I retreat to my rest location, where I stay for a certain number of turns or until fully healed.
A few details (features, not bugs, but can be changed if desired):
- If my way home is blocked on the return, the normal RCA AI takes over my behavior.
@ -89,7 +94,8 @@ A few details (features, not bugs, but can be changed if desired):
- A kill only makes me go home when I am the attacker, not as defender.
- Occasionally I will not move at all while wandering (a dragon has to rest sometimes!)
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -136,7 +142,10 @@ Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted
[event]
name=end_scenario
{MESSAGE (Dreadful Bat) "" "" _"I'm out of here."}
[message]
speaker=Dreadful Bat
message= _ "I'm out of here."
[/message]
[endlevel]
result=victory

View file

@ -61,8 +61,12 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
There is nothing to do here, just watch or use this scenario as a template or for your own tests."}
There is nothing to do here, just watch or use this scenario as a template or for your own tests."
[/message]
[/event]
[/test]

View file

@ -391,7 +391,11 @@
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -407,14 +411,17 @@
[event]
name=start
#{MESSAGE narrator "wesnoth-icon.png" "" _"Text"}
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
The player controls Side 1. There are right-click context menu options for adding Side 1 units to the map and for taking them off again. This is useful mostly for testing how the Side 3 guardians react.
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -472,10 +479,18 @@ Note: This is a demonstration of how the Goto Micro AI can be used to code guard
name=side 8 turn
{UNIT 8 Ghost 29 1 id=ghost1}
{MESSAGE ghost1 "" "" _"Aaiiieeeeeee !!!"}
{MESSAGE messenger2 "" "" _"O no, a ghost!"}
{MESSAGE messenger1 "" "" _"Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."}
[message]
speaker=ghost1
message= _ "Aaiiieeeeeee !!!"
[/message]
[message]
speaker=messenger2
message= _ "O no, a ghost!"
[/message]
[message]
speaker=messenger1
message= _ "Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."
[/message]
[event]
name=side 8 turn
first_time_only=no

View file

@ -428,7 +428,12 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/dwarves/guard.png" _"Standard WML Guardian" _"This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."}
[message]
speaker=narrator
image=portraits/dwarves/guard.png
caption= _ "Standard WML Guardian"
message= _ "This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -439,12 +444,17 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/trolls/troll.png" _"Return Guardian" _"A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption= _ "Return Guardian"
message= _ "A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
- If at GP with no enemy in reach, do nothing.
- If at GP with enemy in reach, leave attack to default AI (note that this may include not attacking if the enemy is deemed too strong).
- If not at GP, return there, no matter whether an enemy is in reach or not.
- If enemies are blocking your way back, do your best to get there anyway.
- If you end up next to an enemy on the way back, attack after the move."}
- If you end up next to an enemy on the way back, attack after the move."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -455,8 +465,13 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/trolls/troll.png" _"Home Guard" _"A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."}
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption= _ "Home Guard"
message= _ "A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -467,13 +482,18 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/undead/archer.png" _"Stationed Guardian" _"A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
[message]
speaker=narrator
image=portraits/undead/archer.png
caption= _ "Stationed Guardian"
message= _ "A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
- If no enemy is within 'distance' of the guard's current position, do nothing.
- Otherwise: If an enemy is within 'distance' of the guard, but not also within the same distance of the guarded location and the station (all of this simultaneously), move the guard in the direction of the station.
- Otherwise:
- Pick the enemy unit that is closest to the guarded location.
- If we can reach it, pick the adjacent hex with the highest defense rating and attack from there.
- If not in reach, move toward this unit."}
- If not in reach, move toward this unit."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -484,11 +504,16 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "units/monsters/giant-rat.png" _"Coward" _"Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
[message]
speaker=narrator
image=units/monsters/giant-rat.png
caption= _ "Coward"
message= _ "Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
- If neither is given, the coward retreats to the position farthest away from the approaching enemies.
- If 'seek' is given, it preferentially goes toward that location (but getting away from enemies takes priority).
- If 'avoid' is given, it in addition tries to avoid that location (with both maximizing distance from enemies and going toward 'seek' taking priority).
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."}
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -499,9 +524,14 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/nagas/fighter.png" _"Zone Guardian" _"A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
[message]
speaker=narrator
image=portraits/nagas/fighter.png
caption= _ "Zone Guardian"
message= _ "A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
- If not specified, the zone guard attacks any enemy coming inside its guard zone.
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."}
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -510,14 +540,25 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
name=start
{STORE_UNIT_VAR id=Kraa profile profile}
{MESSAGE Kraa "$profile~FL()~RIGHT()" "" _"Kraahhh!!!!"}
{MESSAGE (Another Bad Orc) "" "" _"They there! We them get!"}
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message= _ "Kraahhh!!!!"
[/message]
[message]
speaker=Another Bad Orc
message= _ "They there! We them get!"
[/message]
# wmllint: unbalanced-on
{MESSAGE Kraa "$profile~FL()~RIGHT()" "" _"Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message= _ "Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
Note to the player: the right-click context menu provides information about each of the units' behavior.
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
@ -591,7 +632,10 @@ Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be
[event]
name=end_scenario
{MESSAGE Kraa "" "" _"Gryphons of the High Plains, it is time to return to said plains. Follow me."}
[message]
speaker=Kraa
message= _ "Gryphons of the High Plains, it is time to return to said plains. Follow me."
[/message]
[endlevel]
result=victory

View file

@ -113,9 +113,12 @@
name=start
# wmllint: unbalanced-on
{MESSAGE (Good Bandit) "" "" _"That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
[message]
speaker=Good Bandit
message= _ "That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -141,7 +144,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
id=Bad Outlaw
[/filter]
{MESSAGE (Good Bandit) "" "" _"We got him! Now whatever it is we are fighting for is safe."}
[message]
speaker=Good Bandit
message= _ "We got him! Now whatever it is we are fighting for is safe."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -165,7 +171,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
x,y=36,19
[/filter]
{MESSAGE (Bad Outlaw) "" "" _"I made it! Now we can keep fighting for whatever it is that we are fighting for."}
[message]
speaker=Bad Outlaw
message= _ "I made it! Now we can keep fighting for whatever it is that we are fighting for."
[/message]
[endlevel]
result=defeat
[/endlevel]

View file

@ -76,11 +76,14 @@
name=start
# wmllint: unbalanced-on
{MESSAGE Rebels1 "" "" _"In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
[message]
speaker=Rebels1
message= _ "In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
For clarity, each healer announces her upcoming support move. If you don't want to see that each time, just hit 'esc' when it happens the first time.
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -92,7 +95,10 @@ Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and
canrecruit=yes
[/filter]
{MESSAGE $unit.id "" "" _"Argh! They got us..."}
[message]
speaker=$unit.id
message= _ "Argh! They got us..."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -447,12 +447,17 @@
[event]
name=start
{MESSAGE Pekzs "" "" _"In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
[message]
speaker=Pekzs
message= _ "In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."}
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."
[/message]
# wmllint: unbalanced-on
{MESSAGE Pekzs "" "" _"Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
[message]
speaker=Pekzs
message= _ "Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
Side 2 (blue): saurians attacking only from swamp. If no enemy is in range, they do not move.
@ -460,13 +465,19 @@ Side 3 (green): saurians attacking only from swamp. If no enemy is in range, the
Side 4 (purple): nagas wandering only on water terrain, but attacking from both water and swamp.
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."}
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."
[/message]
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You can use the right-click context menu to add additional lurkers.
[message]
speaker=narrator
image="wesnoth-icon.png"
caption= _ "Notes"
message= _ "You can use the right-click context menu to add additional lurkers.
Any unit not adjacent to swamp (and water, for the nagas) is safe from the lurkers, thus it is easy to keep Pekzs from being attacked.
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -530,7 +541,10 @@ The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to
[event]
name=end_scenario
{MESSAGE Pekzs "" "" _"Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."}
[message]
speaker=Pekzs
message= _ "Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."
[/message]
[endlevel]
result=victory

View file

@ -132,17 +132,29 @@
name=start
{STORE_UNIT_VAR id=Vanak profile profile}
{MESSAGE Vanak "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Vanak
image=$profile~FL()~RIGHT()
message= _ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE messenger "" "" _"Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."}
[message]
speaker=messenger
message= _ "Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
Note that the messenger route is set up through a series of waypoints here simply to demonstrate how to use waypoints. On this map, using only a single waypoint at the end of the route would work just as well (or probably even better).
Also note that the messenger does not have to get exactly to each signpost (except for the last one), getting close is good enough.
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -170,7 +182,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
x,y=28,1
[/filter]
{MESSAGE messenger "" "" _"I made it! Now our people will be safe."}
[message]
speaker=messenger
message= _ "I made it! Now our people will be safe."
[/message]
[endlevel]
result=defeat
[/endlevel]
@ -182,7 +197,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
[filter]
id=messenger
[/filter]
{MESSAGE messenger "" "" _"Nooo! All is lost. We will never stop the orcs now!"}
[message]
speaker=messenger
message= _ "Nooo! All is lost. We will never stop the orcs now!"
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -201,20 +201,34 @@
{STORE_UNIT_VAR id=Konrad profile profile}
# wmllint: unbalanced-on
{MESSAGE Konrad "$profile~FL()~RIGHT()" "" _"Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
[message]
speaker=Konrad
image=$profile~FL()~RIGHT()
message= _ "Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
I am heading for the keep east of the central mountain via a couple waypoints in the south. I will stay there once I get there. By contrast, those two fellas in the center are perpetually circling the mountain, one of them always in the same direction, the other changing directions after every lap.
All of this is implemented by use of the Patrol [micro_ai] tag."}
All of this is implemented by use of the Patrol [micro_ai] tag."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
{MESSAGE guard1 "" "" _"By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
{MESSAGE Urudin "" "" _"And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
[message]
speaker=guard1
message= _ "By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
[/message]
[message]
speaker=Urudin
message= _ "And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
This is an AI separate from the Patrols of Side 2."}
This is an AI separate from the Patrols of Side 2."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
Konrad only attacks Gertburt, or any enemy unit that blocks his final waypoint.
@ -224,7 +238,8 @@ The Longbowman attacks any enemy unit he ends up next to at the end of his move.
They all have in common, however, that getting to their next waypoint takes priority over attacking. They will thus prefer to move around enemies rather than straight for them. Also, if a waypoint is occupied by a unit they are not instructed to attack, they will (eventually) abandon that waypoint once they get close enough and move on to the next one.
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -253,7 +268,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
x,y=25,15
[/filter]
{MESSAGE Konrad "" "" _"Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."}
[message]
speaker=Konrad
message= _ "Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."
[/message]
[/event]
# The events finishing the scenario
@ -294,7 +312,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
[event]
name=end_scenario
{MESSAGE Gertburt "" "" _"Let's go home, chaps."}
[message]
speaker=Gertburt
message= _ "Let's go home, chaps."
[/message]
[endlevel]
result=victory

View file

@ -124,11 +124,24 @@
name=start
{STORE_UNIT_VAR id=Koorzhar profile profile}
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"There's that traitor wizard. Let's get him."}
[message]
speaker=Koorzhar
image="$profile~FL()~RIGHT()"
message= _ "There's that traitor wizard. Let's get him."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."}
{MESSAGE Rossauba "" "" _"That's very kind of you, but ..."}
{MESSAGE Langzhar "" "" _"No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."}
[message]
speaker=Langzhar
message= _ "Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."
[/message]
[message]
speaker=Rossauba
message= _ "That's very kind of you, but ..."
[/message]
[message]
speaker=Langzhar
message= _ "No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."
[/message]
[message]
speaker=narrator
@ -137,7 +150,7 @@
# wmllint: unbalanced-on
message= _ "In this scenario, the AI playing the humans in the east (Langzhar) is instructed to protect the wizard Rossauba, while moving him safely to the signpost. On the other side, Koorzhar's units (in the west) will primarily attack Rossauba, even if a better target is available. Do you want to play either of the sides or let the AIs battle it out among themselves?
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
# wmllint: unbalanced-off
[option]
label= _ "<span font='16'>I'll watch the two AIs fight it out</span>" # wmllint: no spellcheck
@ -213,7 +226,11 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
id=Rossauba
[/filter]
{MESSAGE Rossauba "" "" _"I held out for as long as I could."}
[message]
speaker=Rossauba
message= _ "I held out for as long as I could."
[/message]
[fire_event]
name=end_scenario
[/fire_event]
@ -227,7 +244,10 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
x,y=1,1
[/filter]
{MESSAGE Rossauba "" "" _"I made it"}
[message]
speaker=Rossauba
message= _ "I made it"
[/message]
[fire_event]
name=end_scenario

View file

@ -82,16 +82,28 @@
name=start
{STORE_UNIT_VAR id=Koorzhar profile profile}
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"This is a very simple scenario that can be used to test out different recruiting patterns."}
[message]
speaker=Koorzhar
image=$profile~FL()~RIGHT()
message= _ "This is a very simple scenario that can be used to test out different recruiting patterns."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."}
[message]
speaker=Langzhar
message= _ "Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "Notes" _"If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
Side 2 uses the Rush Recruitment Micro AI (which is also used in the Experimental AI).
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -108,7 +120,11 @@ A Micro AI can be added and adapted to the need of a scenario easily using only
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -106,7 +106,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Bottleneck Defense Micro AI Demo" _"In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."}
[message]
speaker=Grnk
caption= _ "Bottleneck Defense Micro AI Demo"
message= _ "In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."
[/message]
[/command]
[/set_menu_item]
@ -121,7 +125,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Swamp Lurker Micro AI demo" _"Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."}
[message]
speaker=Grnk
caption= _ "Swamp Lurker Micro AI demo"
message= _ "Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."
[/message]
[/command]
[/set_menu_item]
@ -136,7 +144,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Guardian Micro AI demo" _"In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."}
[message]
speaker=Grnk
caption= _ "Guardian Micro AI demo"
message= _ "In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."
[/message]
[/command]
[/set_menu_item]
@ -151,7 +163,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Patrol Micro AI demo" _"'Patrols' contains AI modifications for units following patrol routes."}
[message]
speaker=Grnk
caption= _ "Patrol Micro AI demo"
message= _ "'Patrols' contains AI modifications for units following patrol routes."
[/message]
[/command]
[/set_menu_item]
@ -166,7 +182,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Recruiting Tests Micro AI demo" _"A simple scenario set up for the sole purpose of testing different recruiting patterns."}
[message]
speaker=Grnk
caption= _ "Recruiting Tests Micro AI demo"
message= _ "A simple scenario set up for the sole purpose of testing different recruiting patterns."
[/message]
[/command]
[/set_menu_item]
@ -181,7 +201,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Protect Unit Micro AI Demo" _"This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."}
[message]
speaker=Grnk
caption= _ "Protect Unit Micro AI Demo"
message= _ "This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."
[/message]
[/command]
[/set_menu_item]
@ -197,7 +221,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"HttT: The Elves Besieged Micro AI demo" _"This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."}
[message]
speaker=Grnk
caption= _ "HttT: The Elves Besieged Micro AI demo"
message= _ "This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."
[/message]
[/command]
[/set_menu_item]
@ -212,7 +240,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Messenger Escort Micro AI demo" _"'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."}
[message]
speaker=Grnk
caption= _ "Messenger Escort Micro AI demo"
message= _ "'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."
[/message]
[/command]
[/set_menu_item]
@ -227,7 +259,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Animals Micro AI demo" _"This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."}
[message]
speaker=Grnk
caption= _ "Animals Micro AI demo"
message= _ "This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."
[/message]
[/command]
[/set_menu_item]
@ -242,7 +278,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Wolves Micro AI demo" _"Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."}
[message]
speaker=Grnk
caption= _ "Wolves Micro AI demo"
message= _ "Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."
[/message]
[/command]
[/set_menu_item]
@ -257,7 +297,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Swarm Micro AI demo" _"This scenario features bats moving around semi-randomly in a swarm."}
[message]
speaker=Grnk
caption= _ "Swarm Micro AI demo"
message= _ "This scenario features bats moving around semi-randomly in a swarm."
[/message]
[/command]
[/set_menu_item]
@ -272,7 +316,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Dragon Micro AI demo" _"This scenario features a fire dragon displaying a hunt-and-rest behavior."}
[message]
speaker=Grnk
caption= _ "Dragon Micro AI demo"
message= _ "This scenario features a fire dragon displaying a hunt-and-rest behavior."
[/message]
[/command]
[/set_menu_item]
@ -287,7 +335,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Healer Support Micro AI demo" _"This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."}
[message]
speaker=Grnk
caption= _ "Healer Support Micro AI demo"
message= _ "This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."
[/message]
[/command]
[/set_menu_item]
@ -302,7 +354,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Goto Micro AI demo" _"This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."}
[message]
speaker=Grnk
caption= _ "Goto Micro AI demo"
message= _ "This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."
[/message]
[/command]
[/set_menu_item]
@ -317,7 +373,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Combined Hang Out and Messenger Escort Micro AI demo" _"This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."}
[message]
speaker=Grnk
caption= _ "Combined Hang Out and Messenger Escort Micro AI demo"
message= _ "This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."
[/message]
[/command]
[/set_menu_item]
@ -332,7 +392,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Simple Attack Micro AI demo" _"This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."}
[message]
speaker=Grnk
caption= _ "Simple Attack Micro AI demo"
message= _ "This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."
[/message]
[/command]
[/set_menu_item]
@ -347,7 +411,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Fast Micro AI demo" _"A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."}
[message]
speaker=Grnk
caption= _ "Fast Micro AI demo"
message= _ "A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -357,9 +425,12 @@
{SCROLL_TO 13 11}
{MESSAGE Grnk "" "" _"Move me to any of the signposts to go to a Micro AI demonstration.
[message]
speaker=Grnk
message= _ "Move me to any of the signposts to go to a Micro AI demonstration.
Information about each demonstration can be accessed by right-clicking on the respective signpost."}
Information about each demonstration can be accessed by right-clicking on the respective signpost."
[/message]
[objectives]
[objective]

View file

@ -120,10 +120,16 @@
{SCROLL_TO 11 9}
{MESSAGE sergeant "" "" _"General Grospur, what do we do? These undead will surely wipe us out."}
{MESSAGE Grospur "" "" _"Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
[message]
speaker=sergeant
message= _ "General Grospur, what do we do? These undead will surely wipe us out."
[/message]
[message]
speaker=Grospur
message= _ "Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"}
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"
[/message]
[objectives]
summary= _ "Watch the undead take care of business"
@ -161,10 +167,16 @@
lua_function = "close_to_advancing"
[/filter_second]
{MESSAGE $second_unit.id "" "" _"What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"}
{MESSAGE Uralt "" "" _"Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
[message]
speaker=$second_unit.id
message= _ "What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"
[/message]
[message]
speaker=Uralt
message= _ "Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"}
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"
[/message]
[/event]
# Put more undead out there when less than 25 left
@ -178,7 +190,10 @@
count=0-24
[/have_unit]
[then]
{MESSAGE Uralt "" "" _"Rise, minions!"}
[message]
speaker=Uralt
message= _ "Rise, minions!"
[/message]
{SCATTER_UNITS 6 "Soulless" 1 (x,y=5-9,1-15) (side=2)}
{SCATTER_UNITS 3 "Skeleton,Skeleton Archer" 1 (x,y=5-9,1-15) (side=2)}
[/then]
@ -221,7 +236,10 @@
controller=human
[/modify_side]
{MESSAGE Uralt "" "" _"And that's how the undead AI executes total annihilation ..."}
[message]
speaker=Uralt
message= _ "And that's how the undead AI executes total annihilation ..."
[/message]
[endlevel]
result=victory

View file

@ -69,7 +69,11 @@
{VARIABLE_CONDITIONAL scenario_name equals swarm}
[/show_if]
[command]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -134,11 +138,15 @@
name=start
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
The player controls a side of gryphons, each of which is given 99 moves so that the reaction of the swarm to enemies can be tested easily. There are also several right-click options, for example for adding bats or gryphons or for taking units off the map.
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -174,7 +182,11 @@ Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted t
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -98,7 +98,11 @@
{VARIABLE_CONDITIONAL scenario_name equals wolves}
[/show_if]
[command]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -185,11 +189,15 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
Second, wolves do not actively hunt here. For the most part they just wander (often long distance). However, the pack ferociously (and without regard for its own health) attacks any enemy units that come into range, as long as that does not mean separating the pack by more than a few hexes. Staying together, or joining with a new wolf assigned to the pack, is the only thing that takes priority over satisfying the wolves' thirst for blood.
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."}
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."
[/message]
[message]
speaker=narrator
@ -200,7 +208,7 @@ To emphasize which wolf belongs to which pack, the pack number will be displayed
Note that the leader of the human-controlled side, Rutburt, can move 99 hexes per turn, so that it is always possible to keep him out of harm's way.
Also note that the wolves AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
Also note that the wolves AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at https://wiki.wesnoth.org/Micro_AIs for more information." # wmllint: no spellcheck
# wmllint: unbalanced-off
[option]
label= _ "<span font='16'>I'll just watch the two wolf sides.</span>"
@ -259,7 +267,11 @@ Also note that the wolves AI is coded as a Micro AI. A Micro AI can be added and
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -21,9 +21,6 @@
first_time_only=no
[lua]
code = <<
H = wesnoth.dofile("lua/helper.lua")
W = H.set_wml_action_metatable({})
H.set_wml_var_metatable(_G)
local tests_table = {}
function register_test(_name, _description)
tests_table[_name] = _description
@ -70,7 +67,7 @@
name="_replace_ai_2"
[/fire_event]
[lua]
code= << W.fire_event {name=wesnoth.get_variable("test_id") } >>
code= << wesnoth.wml_actions.fire_event {name=wml.variables["test_id"] } >>
[/lua]
[/command]
[/set_menu_item]
@ -154,7 +151,7 @@
local cmd = { "command", {{ "set_variable", {name="test_id", value= k } } } }
table.insert(opts, { "option", { label = v, cmd } } )
end
W.message { speaker="narrator", message="Which test do you wish to run, O Mighty AI Developer?", table.unpack(opts) }
wesnoth.wml_actions.message { speaker="narrator", message="Which test do you wish to run, O Mighty AI Developer?", table.unpack(opts) }
>>
[/lua]
[command]
@ -163,7 +160,7 @@
[/fire_event]
[/command]
[lua]
code= << W.fire_event {name=wesnoth.get_variable("test_id") } >>
code= << wesnoth.wml_actions.fire_event {name=wml.variables["test_id"] } >>
[/lua]
[/event]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show more