Commit graph

83 commits

Author SHA1 Message Date
Celtic Minstrel
f7fadba928 Fix compatibility path for helper.set_wml_var_metatable 2023-05-07 14:56:55 -04:00
Celtic Minstrel
aed779fb6a Lua API: Deprecate the helper.lua module itself 2021-07-07 01:32:05 -04:00
Celtic Minstrel
8b05449bbc Lua API: Deprecate helper.set_wml_action_metatable
wml.fire now supports the same syntax - both of the following work:

- wml.fire("message", {message = "Hello World"})
- wml.fire.message{message = "Hello World"}
2021-07-07 01:32:05 -04:00
Celtic Minstrel
771f472dd7 Lua API: Add wesnoth.map.iter_adjacent
This replaces helper.adjacent_tiles
2021-07-07 01:32:05 -04:00
Celtic Minstrel
47951c4700 Lua API: Add wesnoth.sides.iter
This replaces both helper.get_sides and helper.all_teams
2021-07-07 01:32:05 -04:00
Celtic Minstrel
05b0b7a1df Update uses of wesnoth.fire 2021-05-11 14:52:20 -04:00
Celtic Minstrel
a09f88c1c9 Start a Lua mathx module to hold round, shuffle, random, and a few other things 2021-05-08 17:20:47 -04:00
mattsc
cadb233d6c Update some deprecated Lua uses 2021-03-06 15:08:54 -08:00
Celtic Minstrel
9d3bf196b0 Update everything to use the new wesnoth.map module
- get_terrain and set_terrain replaced with direct indexing operations
- get_map_size mostly replaced with either the iterator or an on_board call.
  Only a few cases really needed to know the size of the map for some other purpose.
- shroud and fog operations, village owner, time areas, and location filters
- get_terrain_info replaced with terrain_types table
- Map generation functions create_map and create_filter
2021-02-28 18:16:33 -05:00
Celtic Minstrel
11a57e0fa7 Move helper.find_attack -> wesnoth.units.find_attack 2019-12-02 22:39:34 -05:00
Celtic Minstrel
d5c1c9734f Fix the deprecated helper.set_wml_tag_metatable using a non-existent core table 2019-12-02 22:39:34 -05:00
Celtic Minstrel
3734bce276 Lua: Replace uses of deprecated (moved) sides functions 2019-11-23 14:41:03 -05:00
Celtic Minstrel
597ed24170 Remove the helper.deprecate function, which isn't used anywhere 2019-11-16 13:11:58 -05:00
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