Commit graph

316 commits

Author SHA1 Message Date
Celtic Minstrel
7835e05d93 Fix [animate_unit][facing] not working.
This also tweaks the animator:add() API, replacing the facing key
with a target key and requiring it to be an adjacent location.
2017-04-09 01:29:10 -04:00
gfgtdf
cbd3c2644c add lua end_music setter/getter
this also refactors some play_controller members and moves them
to game_data

this also adds a scenario_id getter in lua.
2017-03-23 18:08:16 +01:00
gfgtdf
bd6a0c69d1 replace wesnoth.set_next_scenario() with wesnoth.game_config.next_scenario setter/getter 2017-03-20 02:48:03 +01:00
Celtic Minstrel
d84a52dc45 Fix incorrect API table name in [animate_unit] (GNA25550) 2017-03-12 14:49:52 -04:00
Celtic Minstrel
e107c52df4 Fix improper child_range call in [animate_unit] 2017-02-28 18:55:59 -05:00
Celtic Minstrel
b37d7233d5 [animate_unit] now defaults to hits=yes if missing 2017-02-28 16:21:16 -05:00
Celtic Minstrel
aa421ef698 Fix a Lua error in [animate_unit] 2017-02-27 13:12:21 -05:00
Charles Dang
f81392893d Attempt to fix some errors reported by @singalen 2017-02-27 18:52:10 +11: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
010acd870d Properly port [animate_unit] to Lua 2016-12-11 18:08:08 -05:00
Celtic Minstrel
c58e2d0095 wesnoth.scroll_to_tile can now skip if onscreen 2016-12-11 18:07:46 -05:00
gfgtdf
a53090d648 wml cleanups, add terrain= attribute to [random_placement] loc
replacing some [while] with [repeat] or [random_placement]

Adding  terrain= attribute to the variable generated by [random_placement] this mkaes it easier to use [random_placement] as a replacement for [store_locations] + [while] since [store_locations] also generates the [terrain] attribute:
2016-12-10 14:07:13 +01: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
Gregory A Lundberg
fc6774289e Upgrade deprecated Lua
loadstring was removed, load does the same thing.
atan2 was remvoed, atan works instead
2016-10-17 10:34:43 -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
3809a69a42 Fix bug: Lua harm_unit
Missing local T.

cf https://forums.wesnoth.org/viewtopic.php?f=21&t=44567
2016-09-19 17:40:41 -05:00
Gregory A Lundberg
6af699fdf3 Fix bug: 'text' is nil 2016-09-10 14:20:04 -05:00
Celtic Minstrel
742b4b0be3 Fix an issue with translatable strings that included a possible plural 2016-08-31 21:01:17 -04:00
Celtic Minstrel
b24fdbcbe1 Merge pull request #759 from GregoryLundberg/GL_modify_unit_mode
Add mode=replace to [modify_unit]
2016-08-30 12:31:23 -04:00
Charles Dang
ae6b8f97f2 Temporary fix for broken Objective dialog formatting (f866039e81) 2016-08-30 18:55:17 +11:00
Celtic Minstrel
f866039e81 Add support for gettext plurals to Lua API 2016-08-29 16:47:17 -04:00
Gregory A Lundberg
82c3b0114d Add mode=replace to [modify_unit]
When specified, replace rather than merge the [unit] sub-tags. Does not effect [object], [trait], [effect] or [advancement].

For example:
    [modify_unit]
        [filter]
            id=Deoran
        [/filter]
        mode=replace

        [filter_recall]
            [not]
                id="Sir Gerrick"
            [/not]
        [/filter_recall]
    [/modify_unit]

will replace the current contents of [filter_recall] with the given contents. Without mode=replace, the contents would be appended to the previous contents.
2016-08-24 19:35:06 -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
Gregory A Lundberg
5f9a711dab Fix the fix (#746)
I have SO got to check I pressed Save before I press Commit! This time it bit me because it got merged so quickly.
2016-08-12 14:32:55 -04:00
Gregory A Lundberg
652c5b9b0d Do not select unit in silent object
This causes, for example, units the player does not control to be selected at the start of HttT S08, S11 and S16.
2016-08-12 13:16:07 -05:00
Celtic Minstrel
f4ac23a3c5 Allow [endlevel] to be used in victory or defeat events 2016-08-08 04:09:32 -04:00
Charles Dang
7b22051c3c Merge pull request #721 from GregoryLundberg/GL_lua_objectives
objectives.lua show_turn_counter in white
2016-08-05 21:00:56 +11:00
Celtic Minstrel
53828a01b9 New [remove_object] WML tag 2016-08-02 00:52:52 -04:00
Celtic Minstrel
6dab777f66 Accept [effect] in [modify_unit] 2016-08-02 00:01:48 -04:00
Gregory A Lundberg
ee8778a6d7 objectives.lua show_turn_counter in white
This matches the style used for OBJECTIVE_FOOTNOTE and makes the turn count more apparent.
2016-08-01 20:22:15 -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
gfgtdf
5de1d9b046 optimise [random_placement]
the cases distance=0 and distance = -1 now dont loop thougth all
possible locations anymore when removing a used location.
2016-05-20 14:42:49 +02:00
Celtic Minstrel
af58b33aca [modify_unit] now supports dvs for modifications
This means [object], [advancement], and [trait] tags within [modify_unit]
can now use delayed_variable_substitution=yes.

This is currently needed for adding teleport, backstab, and leadership abilities.
2016-05-18 20:48:48 -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
d3374d3670 WML tags fixup 2016-04-04 20:10:52 -04:00
Celtic Minstrel
a791909544 Split the more complicated WML tags into separate Lua files 2016-04-04 17:03:38 -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
Celtic Minstrel
2e6ad2bee3 Add wesnoth.select_unit(), deprecate wesnoth.select_hex()
wesnoth.select_unit() is also callable as u:select() where u is a unit
2016-03-16 12:51:31 -04:00
Charles Dang
b512ad2143 Make [message] use wesnoth.highlight_hex() 2016-03-14 09:42:04 +11:00