Commit graph

70 commits

Author SHA1 Message Date
Celtic Minstrel
0bf377ab9f
Lua API: Fix some deprecations of game-only functions
Fixes #3737
2018-11-22 08:55:53 -05:00
Celtic Minstrel
6d7736e6e6 Deprecate helper.wml_error and move it to wml.error 2018-11-15 21:06:55 -05:00
Celtic Minstrel
8bcf749666 Lua API reorganization: units module deprecations 2018-11-15 21:06:55 -05:00
Celtic Minstrel
7c3fd9a612 Lua API reorganization: units module 2018-11-15 21:06:55 -05:00
Celtic Minstrel
3e79b3bde8 Lua API reorganization: GUI module deprecations 2018-11-15 21:06:55 -05:00
Celtic Minstrel
3ec9ce4b60 Lua API reorganization: GUI module 2018-11-15 21:06:55 -05:00
Celtic Minstrel
55a6c16810 Lua API reorganization: interface module deprecations 2018-11-15 21:06:55 -05:00
Celtic Minstrel
e3e80b4a99 Lua API reorganization: interface module 2018-11-15 21:06:55 -05:00
Celtic Minstrel
b94ccf9020 Rewrite helper.modify_unit to not use a WML variable 2018-11-11 20:03:05 -05:00
Celtic Minstrel
9885932011 Use wml.tag in helper.get_user_choice 2018-11-11 20:03:05 -05:00
Celtic Minstrel
40bf04ec8e Rewrite helper.move_unit_fake to not use a WML variable 2018-11-11 19:51:29 -05:00
mattsc
0e017d9f7c Lua code: replace deprecated wesnoth.set_variable() calls
(cherry-picked from commit ce7faae4f4)
2018-10-07 03:21:07 +00:00
mattsc
05d5afa6a9 Lua code: replace deprecated wesnoth.get_variable() calls
(cherry-picked from commit f1764d182f)
2018-10-07 03:21:06 +00:00
Celtic Minstrel
e776635023 Clear up redundancies in helper compatibility and deprecate the array functions 2018-03-17 16:48:03 -04:00
Celtic Minstrel
6e4d09d2a5 Bump up a couple of deprecation levels at @vultraz's request 2018-03-17 16:48:01 -04:00
Celtic Minstrel
08ec9017b5 Lua API: Some tweaks of the experimental wml module 2018-03-17 16:48:00 -04:00
vgaming
8ba6e5f40e fix code problems found by luacheck (#2380)
actual bugs found:
* backwards_compatibility.lua (undeclared global "helper")
* core.lua (use of undeclared global "helper")
* wml_tags.transform_unit had wrong code to deal with recall_cost
* wrong variable name in cave_map_generator
2018-01-20 23:05:58 -05:00
Celtic Minstrel
00443dd8a4 Fixup d192d0712393 and move wesnoth.debug() to lua_kernel_base 2017-08-14 13:10:52 -04:00
Celtic Minstrel
d192f07123 Implement standard deprecation system for Lua API
(as proposed by @DeFender1031)

All existing deprecation messages in the Lua code have been changed to
use the new deprecation system.

The goal is to eventually use an equivalent system for ALL areas of the API.
2017-08-14 12:36:09 -04:00
Celtic Minstrel
fbeb6c5b09 Add helper.find_attack and clean up the [animate_unit] / [kill] hack regarding death / victory animations 2017-05-28 18:20:16 -04:00
Celtic Minstrel
646bedb088 Reverse the Lua API deprecations for the time being. 2017-05-26 20:50:37 -04:00
Celtic Minstrel
2fe72820d1 Fix Lua deprecation warnings being shown in chat outside debug mode 2017-05-23 23:55:44 -04:00
Celtic Minstrel
62ac5a6897 fixup 30caf6149a 2017-05-22 20:29:19 -04:00
Celtic Minstrel
30caf6149a Show Lua deprecation warnings to chat only in debug mode, but always log them too 2017-05-22 17:31:17 -04:00
Celtic Minstrel
8492e8d639 Use standard deprecation mechanism for helper.distance_between 2017-05-22 17:31:15 -04:00
Celtic Minstrel
c0f926e2ed Move all WML and variable manipulator functions into new wml table
(The old functions in wesnoth and helper are still available,
but they are now deprecated.)
2017-05-22 17:31:14 -04:00
Celtic Minstrel
b11371dbfa Lua: Allow helper.set_variable_array and helper.get_variable_array to work on units and sides 2017-05-11 16:00:56 -04:00
Celtic Minstrel
a98a9a74db Deprecate helper.distance_between and implement helper.adjacent_tiles in
terms of wesnoth.map.get_adjacent_tiles
2017-05-10 17:40:15 -04:00
Celtic Minstrel
71ae14e851 Some minor improvements to Lua error messages
- Fix some missing whitespace in Lua log/error messages and add colons
- helper.lua: Improve error messages for config manipulators

It should now give the location of the misused helper call as the error
location, rather than the location where error was called within helper.lua
2017-05-06 17:47:17 -04:00
gfgtdf
8c4e09e940 allow to to use a custom rng in helper.rand 2017-04-07 15:05:56 +02:00
Charles Dang
d89730410b Improve ensure_config error messages 2017-03-01 11:58:33 +11:00
Celtic Minstrel
80cdac5b89 fixup! Improve error message when Lua config helper functions are not passed a config as the first argument 2017-02-28 19:15:57 -05:00
Celtic Minstrel
8319fee1f8 Improve error message when Lua config helper functions are not passed a config as the first argument 2017-02-28 19:03:41 -05:00
Gregory A Lundberg
edacf922fb Lua upgrade: integer indices
As of version 5.3, Lua converts a number which as an integer value to add ".0" to the end.

Updating mainline to avoid the issue.
2016-10-21 23:09:51 -05:00
Celtic Minstrel
79647ff9d9 helper.lua: set __metatable field to guard against external access to metatables 2016-10-10 17:41:23 -04:00
Bär Halberkamp
1d8d843a80 move set_variable.rand's logic to helper.rand 2016-07-19 13:48:31 -04:00
CelticMinstrel
f31084da84 Remove asserts 2015-09-29 20:56:34 -04:00
Celtic Minstrel
9aa015a57a Fix helper.child_range to work on config and vconfig alike 2015-09-29 20:04:03 -04:00
Celtic Minstrel
2c337d4115 Use ipairs() for helper.child_range 2015-09-29 14:46:41 -04:00
Celtic Minstrel
7fb0831da6 Use ipairs for the helper functions 2015-09-29 12:55:31 -04:00
Celtic Minstrel
03a38c5294 Lua API: More helper functions for configs 2015-09-26 02:43:59 -04:00
gfgtdf
0038448fcb make helper.shuffle synced
using helper.shuffle now doesn't casue OOS anymore used. It is possible
to get the old behaviour by passing math.random as a second parameter.
2015-08-04 22:36:54 +02:00
Alexander van Gessel
62b287354f Fix Fisher-Yates implemenation of Lua helper.shuffle (bug #21706) 2014-03-04 11:57:19 +01:00
J. Tyne
70351c6209 Improve the implementation of parenthetical_split()...
...and make it local to wml_actions.remove_unit_overlay().
2013-01-25 22:10:57 +00:00
J. Tyne
110484bca6 Add a variant on parenthetical_split() to helper.lua...
...and use it to fix bug #20401.

If no problems are found with this approach, I can backport it to stable.
2013-01-05 23:47:53 +00:00
Elvish_Hunter
aab7c8afcf Lua: added new helper.shuffle() function 2013-01-03 13:22:15 +00:00
Elvish_Hunter
6bfaa5ef88 Lua: added helper.round function 2012-04-12 10:12:05 +00:00
Anonymissimus
6569d72ada update helper.lua to use wesnoth.wml_actions instead of wesnoth.fire
(patch #3040 by SigurdFireDragon, slightly modified)
2012-02-08 21:28:02 +00:00
Anonymissimus
afb54cfc76 remove the string "WML" in helper.deprecate,
...since we're using it for lua functions as well
2012-02-07 23:27:34 +00:00
Anonymissimus
c3aa254e7d fix bug #18966 2011-11-10 21:19:10 +00:00