Commit graph

31 commits

Author SHA1 Message Date
josteph
167d56519e WML: Don't add a \n before condition=lose objectives if there are no objectives listed before them. 2018-07-04 20:15:59 -04:00
mattsc
32170543fd Lua code: replace deprecated wesnoth.tovconfig() calls 2018-05-10 19:54:59 -07:00
Celtic Minstrel
a314876bf2 Use new persistent tags interface for [object] [objectives] [item] 2018-03-17 17:16:23 -04:00
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11: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
sigurdfdragon
23c23b7a55 WML: Add [show_if] usage in [objectives] subtag [gold_carryover] 2017-11-22 20:27:13 -05:00
Celtic Minstrel
850dc96a3a Fix objectives with variables (#992)
[objectives] now supports delayed_variable_substitution=yes, which means that any
$variables or [insert_tag] are processed when the objectives are shown, rather than
when they are set.

In addition, if $|variable syntax is used to delay substitution of a specific variable,
the variable will now be substituted when the objectives are shown, rather than
being left unsubstituted.
2017-05-13 13:20:32 -04:00
Celtic Minstrel
8d4cf3cf62 Shorten requires where possible 2017-05-03 02:42:25 -04:00
Celtic Minstrel
742b4b0be3 Fix an issue with translatable strings that included a possible plural 2016-08-31 21:01:17 -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
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
ln-zookeeper
93a7f5e599 Fixed the last character of [objectives] note= getting eaten 2016-02-14 02:12:01 +02: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
Anonymissimus
6f48761f93 Fix a variable referenced out of its scope (bug #19803) 2012-06-13 21:58:01 +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
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
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
Anonymissimus
0832173ddb made scenario objectives work even if [objective]description= is empty 2011-06-13 15:58:48 +00:00
Lari Nieminen
a97209abc3 Applied patch #2201: show_turn_counter for win conditions. 2010-11-13 21:43:43 +00:00
Lari Nieminen
50a42c8346 Changed the objectives dialog's turn counter text from...
..."(turn_number/turn_limit)" to "(turns_left turns left)" and "(this
turn left)" on the last turn.
2010-09-05 08:58:00 +00:00
Guillaume Melquiond
27ebcd04cc Added default handlers for load/save events. 2010-08-28 18:56:09 +00:00
Guillaume Melquiond
920727691d Simplified code a bit. 2010-08-28 18:56:07 +00:00
Guillaume Melquiond
500177683e Moved objectives-related tags to their own file. 2010-08-28 18:56:04 +00:00