Commit graph

316 commits

Author SHA1 Message Date
ln-zookeeper
93a7f5e599 Fixed the last character of [objectives] note= getting eaten 2016-02-14 02:12:01 +02: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
gfgtdf
5caa9dd95b cleanup wml_actions.store_items 2016-02-03 22:58:23 +01:00
gfgtdf
08236f8953 added name= attribute to [item]
name= has no effect but can be used to delete the item. I also changed
[item] to automatically create an id (in case no id was given) and
return that (only usable if called from lua).

I used the id= field from overlay class for this, it was previously only
used by the editor. Not sure if it is a good idea to reuse the id field.
2016-01-31 02:25:46 +01: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
74152fc2cb Fix [object] without a filter 2015-10-01 16:13:19 -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
Charles Dang
acdc67fe56 [object] don't show unit reach when highlighting unit 2015-09-21 10:47:21 +11:00
Charles Dang
00d96b3016 Fixed a variable typo pointed out by Elvish_Hunter 2015-09-20 23:49:06 +11: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
Charles Dang
45aa0d4ae8 Fixup 9ea9c88356 2015-09-20 10:23:34 +11:00
Charles Dang
9ea9c88356 Fixed bug where unit at x1,y1 would be considered for object even if filter failed
Note that this was only present the 1.13 Lua implementation of [object]
and as such does not affect 1.12
2015-09-20 10:19:10 +11:00
Charles Dang
660647f7d8 Strip newline whitespace 2015-09-20 04:46:34 +11:00
Celtic Minstrel
907d527cc3 Lua API: Replace wesnoth.skipping_replay() with is_skipping_messages() and skip_messages() 2015-09-19 12:13:40 -04:00
Celtic Minstrel
03580ed9a9 Allow spaces in [object]id= and show error if invalid characters are present 2015-09-19 12:13:38 -04:00
Celtic Minstrel
a93ce122ff Add [found_item] ConditionalWML that checks if an [object] ActionWML has been taken 2015-09-19 12:13:36 -04:00
Celtic Minstrel
376020097f Port [object] ActionWML tag from C++ to Lua
Lua API additions:
- wesnoth.show_popup_dialog()
- optional write_to_mods parameter to wesnoth.add_modification
2015-09-19 12:13:25 -04:00
Celtic Minstrel
d4835b0157 Port [message] ActionWML tag from C++ to Lua
Lua API additions:
- wesnoth.skipping_replay()
- wesnoth.deselect_hex()

Note: vultraz and aetheryn deserve partial credit for the Lua implementation
2015-09-19 12:13:23 -04:00
Charles Dang
d8b36e5d08 Add a newline between objective sections
This is set up that there will be no newlines at the end of any section, unless you have
only a summary key, which no one would do. However, there will be a newline at the top of
the dialog if you don't have a win objective, but no one would do that either.

Note that because of newlines not showing up properly on Windows, this won't be viable
on that platform.
2015-03-21 20:55:38 +11:00
8573
e23ff7009c Lua: Fix uses of tostring calls as LHSs to or
This commit changes occurrences of the pattern `tostring(x) or y` to
`tostring(x or y)` in the following Lua scripts:

  - `data/lua/wml-tags.lua`
  - `data/lua/wml/items.lua`

`tostring(x) or y` is unlikely to do what the author intended (and is
pointless unless `x` is an object of a custom type with unusual
behavior), because `tostring` returns a string (`"false"` or `"nil"`)
if `x` is a falsy value (`false` or `nil`), and all strings are truthy
in Lua — thus, `tostring(x) or y` will (unless `x` is of a custom
type) *always* evaluate to `tostring(x)`, never to `y`.

`tostring(x or y)` should, I expect, give the intended behavior.
2014-12-29 10:09:48 +00:00
Anonymissimus
6f48761f93 Fix a variable referenced out of its scope (bug #19803) 2012-06-13 21:58:01 +00:00
Anonymissimus
6f7e76cbac introduce [item]redraw=yes|no (def yes) parameter
This allows WML/lua authors to optionally skip [item]'s implicit redraw
call. shadowmaster was experiencing some negative
visual effects due to this.
2012-04-09 19:48:51 +00:00
Elvish_Hunter
b52b619482 Added [show_if] support to [objectives] [note] 2012-03-13 09:31:18 +00:00
Anonymissimus
590708a27b introduce inline SSF support in [show_objectives] 2012-03-07 19:36:34 +00:00
Anonymissimus
c0bac05285 introduce inline SSF support in [objectives]
No deprecation needed since it defaulted to the 'default
objectives' already. They are used for a side in case that that side
doesn't have side specific objctives set. Use a SSF which matches
no sides or all sides to set the default objectives, if a subset
of all sides match, the side specific objectives for these are set.
2012-03-07 19:36:14 +00:00
Steven Panek
b2bb325104 Removed support for the deprecated [removeitem]. 2012-02-07 00:16:29 +00:00
Alexander van Gessel
6eb9efd2fd Revert "Add a warning for empty [remove_item]"
This reverts commit 2012-02-05T16:05:43Z!ai0867@gmail.com.
2012-02-05 23:08:03 +01:00
Alexander van Gessel
86ef26478c Add a warning for empty [remove_item] 2012-02-05 17:05:43 +01:00
Anonymissimus
406d76e09c set team.objectives_changed differently (fix for bug #18927)
In multiplayer, scenarios have default objectives sent from the host
to the other clients as [scenario]objectives= t_string, and this doesn't
know about silent= but must be shown anyway.
2011-11-06 23:22:56 +00:00
Steven Panek
b194bf3724 Made it so that red=, blue=, and green= actually work for lose objectives. 2011-10-31 07:14:27 +00:00
Steven Panek
e1d7f56b7c Renamed r=, g=, and b=...
...in [objective], [gold_carryover], and [note] to red=, green=, and
blue= for consistency.
2011-10-28 23:04:45 +00:00
Steven Panek
f400ee4ac5 Implemented r=, g=, and b=...
...for [objective], [gold_carryover], and [note].
2011-10-28 22:31:04 +00:00
Steven Panek
f2c605e793 Implemented bullet=...
...in [objectives], [objective], [gold_carryover], and [note].
2011-10-28 22:10:02 +00:00
Anonymissimus
d3d0400ed0 revert part of 2011-09-08T19:16:01Z!thonsew@yahoo.com (resonless change to [item] behavior) 2011-09-27 23:01:26 +00:00
Anonymissimus
febb9da2ca Reverted 2011-09-21T21:44:58Z!thonsew@yahoo.com and 2011-09-20T21:21:21Z!thonsew@yahoo.com.
thonsew: The lua interface is not your playground. This is not the way
I want the lua files or its C++ interface to be modified. You are
invited to talk with me on IRC.

some of the main reasons:

-Your revisions contain lots of unneccessary changes, some of which
 break existing lua or wml without a reason. Do you ever look at the
 diffs?

-Your revisions pack a lot of unrelated stuff together into one.

2011-09-21T21:44:58Z!thonsew@yahoo.com makes sense in some parts and is what you should have
done in the first place.
2011-09-22 17:09:50 +00:00
Thonsew
e59dc97260 Added support for t_token to lua code.
1. Created a t_token metatable along with support code for indexing,
garbage collection, tostring, tonumber, comparison and concatenation.

2. Adjusted string comparison and lookup in lua code to work with
either t_token or string.

This addresses in part bug #18631, bug #18695.  Before this lua was
treating all t_token as either tstrings or strings.
2011-09-20 21:21:21 +00:00
Thonsew
2bf6377351 Changed config and vconfig to use a token representation...
...t_token in place of std::string.  t_token compares, copies, copy
constructs and hashes in 1 operation instead of proportional to the
length of the string.
2011-09-08 19:16:01 +00:00
Anonymissimus
e8f6531a86 Completely removed the old x,y=$x1,$y1 default in [remove_item],
since when running into this rare exception (if the SLF doesn't
matching anything) it could be hard to figure out what happens.

[remove_item] does nothing in this case now.
2011-09-01 19:06:56 +00:00
Anonymissimus
75bf37ed86 improved [store_items] to store only items on locs matching given SLF 2011-08-21 17:39:11 +00:00