Commit graph

53 commits

Author SHA1 Message Date
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
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
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
mattsc
ce7faae4f4 Lua code: replace deprecated wesnoth.set_variable() calls 2018-05-13 20:35:20 -07:00
Celtic Minstrel
07e465e57b Support male_voice and female_voice in [message] 2018-04-28 23:09:29 -04:00
gfgtdf
0f756b8189 fix [message] side_for= not working for the last side.
fixes #2776
2018-04-05 10:39:52 +11:00
Celtic Minstrel
c835e5b7e6 Nicer handling of some Pango formatting attributes in [message] 2018-03-30 18:38:25 -04:00
Celtic Minstrel
2bd2a8b1b6 Handle speaker=id directly in [message] instead of relying on SUF 2018-03-30 18:38:03 -04:00
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11:00
Celtic Minstrel
5fc9d8d173 Use new deprecated_message() function wherever possible (C++)
This also covers handling of legacy DescriptionWML for [set_menu_item],
and tweaks its handling in the other cases (mainly [multiplayer_side]).

I added the next_dev_version constant intending to use it, but then
decided not to do so; however I left it in in case someone finds it useful.
2018-03-04 21:21:33 -05:00
vgaming
728204665c fix code problems found by luacheck (#2388)
fix code problems found by luacheck

Second iteration of the process, now handling data/lua/wml/*.lua

luacheck command used to find bugs:
  luacheck ./*.lua --globals wesnoth wml --codes --ignore 542 213
Additionally, error code 211 (unused variables) could be ignored,
as using underscore convention `_` is controversial in
wesnoth ( see https://github.com/wesnoth/wesnoth/pull/2380#discussion_r162519341 )

Actual bugs found:
* items.lua, access of global `write_name` instead of local `cfg.write_name`
* kill.lua, typo `primary_unit` -> `primary`
* bad code style: global `i` instead of local `i`
  (would conflict with 3-rd party code if it would use global `i`, too)
2018-01-23 13:35:04 -06:00
gfgtdf
121c1cb007 fix wml tags using side.controller (#1740) 2017-05-29 11:58:29 +02:00
Celtic Minstrel
bea0e92c6c Add voice= key to [message] and [story][part]
Resolves #1621
2017-05-11 18:59:15 -04:00
Celtic Minstrel
a5ec607b54 Fix a (probably) rare case when [message]sound might play even if the dialog wasn't shown 2017-05-11 18:10:41 -04:00
Celtic Minstrel
8d4cf3cf62 Shorten requires where possible 2017-05-03 02:42:25 -04:00
Celtic Minstrel
8822dacd92 Merge branch 'wml_tag_porting' 2017-02-26 19:32:44 -05:00
pentarctagon
420a9fa7c0 Fix the unit portrait being displayed with only second_image is provided 2017-01-07 16:12:24 -06:00
Celtic Minstrel
c58e2d0095 wesnoth.scroll_to_tile can now skip if onscreen 2016-12-11 18:07:46 -05:00
Gregory A Lundberg
36ab1f9a5c wesnoth.show_message_dialog: Don't expose has_input flag to Lua
Adjustment of PR 841 (as PR #843)
2016-10-26 00:51:38 -04:00
Gregory A Lundberg
a441fc97a2 Fix bug: Slow narrator (Partial 25186)
No need to deselect when it was already done.

While this is the fix for the specific complaint, it does not address the larger issue of [message] being generally slow.
2016-10-25 04:53:45 -05:00
Gregory A Lundberg
9d08723236 [text_input] Fix bug 25173
Added an internal flag to indicate [text_input] appeared so we no longer require label= to be present.
2016-10-24 21:58:26 -05:00
Pentarctagon
9df77488e3 Update message.lua 2016-10-01 14:28:50 -05:00
Pentarctagon
05cf2ba6cf Add ability to display two portraits at once
Adds the keys: mirror, second_image, second_mirror.  These allow a portrait to be displayed on the right and left of a message simultaneously as well as to mirror them.
2016-10-01 14:28:12 -05:00
Gregory A Lundberg
9d44a45f88 Fix bug with gender-specific messages in [message] 2016-08-19 20:43:50 -05:00
Gregory A Lundberg
f0ad540001 Add result variable to [message] tag
If [message] includes one or more [option] choices, store the choice index in the result variable.
2016-08-14 00:19:11 -05:00
Celtic Minstrel
36eeed413c Comment fixup 2016-07-17 19:51:09 -04:00
Bär Halberkamp
0a83e2e6b6 Fix [message]s without an image not working 2016-07-17 19:49:29 -04:00
Celtic Minstrel
6abd7a6941 Add [message]image_pos=left|right
This is meant to replace ~RIGHT() and also the newer ~LEFT(),
with one exception: ~RIGHT() will still be the standard way to
make a unit's portrait go on the right by default.
2016-07-15 17:35:51 -04:00
Pentarctagon
d22b15b19b Add color=value to [message] (#651)
Add support for the pango attributes as keys in [message]
This is equivalent to surrounding the entire string in a span with the specified attribtues.
2016-06-06 12:50:49 -04:00
Celtic Minstrel
5cf12798ce Port "trivial" WML tags to Lua
This is more about adding Lua API for things that should have it than porting WML tags to Lua.
The following new Lua API functions have been added to the wesnoth table:
- add_fog, remove_fog
- add_sound_source, remove_sound_source, get_sound_source
- log
2016-04-05 02:24:42 -04:00
Celtic Minstrel
a275f22ebe Fix potential "image is nil" error in [message] 2016-04-04 20:55:45 -04:00
Celtic Minstrel
7c37ad57bd Two new [message] features
- ~LEFT() does the opposite of ~RIGHT(), but takes higher priority;
  use it to force an image to the left that's normally on the right
  (eg female silver mage)
- image=~RIGHT() means "use normal portrait, but on the right"
2016-04-02 15:15:31 -04:00
Celtic Minstrel
1c27cafa74 Add highlight=yes|no to [scroll_to], [scroll_to_unit], [message]
Defaults to no in the first two cases, yes in the third
If yes, the target hex is outlined.
2016-03-20 02:55:12 -04:00
mattsc
bce1fae063 Fix portrait missing in [message] with empty image= key
This is mostly important for use of the MESSAGE macro.  Use image=none
if no image/portrait is supposed to be shown.
2016-03-19 14:25:28 -07:00
Charles Dang
b512ad2143 Make [message] use wesnoth.highlight_hex() 2016-03-14 09:42:04 +11:00
Celtic Minstrel
1873b38243 Demote [option] deprecated message even further 2016-02-13 18:42:02 -05:00
Celtic Minstrel
d28365730b Demote [option] deprecated message to log 2016-02-13 18:23:07 -05:00
Celtic Minstrel
4d2e4e2dbc Don't needlessly preparse [message][command]
Fixes bug #24288
2016-01-08 23:14:54 -05:00
Celtic Minstrel
129418e2f9 Outline the speaker's hex in [message]
Unfortunately, this also highlights the speaker's reach.
2016-01-02 22:20:36 -05:00
Celtic Minstrel
2e293fb61d Apply TC to unit sprites in [message] 2016-01-02 20:36:29 -05:00
Celtic Minstrel
fa9a394987 Deselect speaker after [message] 2016-01-02 20:36:27 -05:00
gfgtdf
59233ce903 attempt to fix bug in [message]
previously this bug http://i.imgur.com/9B7bquA.png happend in LoW scenario3.
2015-11-27 18:13:07 +01:00
Celtic Minstrel
8a7f71578d Add (male|female)_message to [message] 2015-10-06 15:03:55 -04:00
Celtic Minstrel
114b31c90c New syntax for [message][option]message= similar to new [campaign][difficulty] 2015-09-30 02:01:03 -04:00
CelticMinstrel
f07e463882 Merge pull request #493 from CelticMinstrel/foreach
Enhanced looping tags
2015-09-23 00:50:30 -04:00
Celtic Minstrel
d5eea2abbf Fix [show_if] in [message][option] 2015-09-22 16:16:08 -04:00
gfgtdf
58512935d4 add [message] wait_description=
the description provided in wait_description is used when other players
wait for this [message] input.
2015-09-21 15:50:14 +02:00
gfgtdf
4c3e00b3bb readd side_for parameter for [message] with input
this was lost when porting the code to lua.
2015-09-21 15:46:00 +02:00
Celtic Minstrel
aec99429c4 Merge branch 'break-continue' into foreach 2015-09-20 00:48:39 -04:00
Celtic Minstrel
3c329408ce Implement [break], [continue], [return] tags (they take no arguments) 2015-09-20 00:47:23 -04:00