mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 02:51:42 +00:00

For any given event name, events execute in order of decreasing priority. Priority is a real number, and may be assigned via the `priority` attribute for the WML [event] tag, or through the Lua APIs: - wesnoth.game_events.add({priority = number}) - wesnoth.game_events.add_repeating(name, action, [priority]) Note that delayed variable substitution is not currently supported in the WML attribute.
These files can be used to allow Lua linting tools to understand Wesnoth types and functions that are defined in C++. Documentation of the annotations format can be found here.
To enable in Visual Studio Code, install this Lua plugin and add the following settings to your settings.json:
"Lua.runtime.version": "Lua 5.4",
"Lua.workspace.library": [
"./utils/emmylua"
],
"Lua.runtime.special": {
"wesnoth.require": "require",
"wesnoth.dofile": "dofile"
},
"Lua.runtime.builtin": {
"io": "disable",
"debug": "disable",
"os": "disable",
"package": "disable"
},
"Lua.diagnostics.globals": [
"wesnoth",
"wml",
"gui",
"filesystem",
"unit_test",
"stringx",
"mathx",
"ai"
]