Replace deprecated usages of on_event()

This commit is contained in:
Celtic Minstrel 2022-06-22 09:47:29 -04:00 committed by Celtic Minstrel
parent 501936affb
commit 7e234f8833
6 changed files with 6 additions and 8 deletions

View file

@ -1,7 +1,7 @@
-- the main file for the WC2 mp campaign
T = wml.tag
on_event = wesnoth.require("on_event")
on_event = wesnoth.game_events.add_repeating
wesnoth.dofile("./game_mechanics/_load.lua")

View file

@ -1,7 +1,6 @@
local _ = wesnoth.textdomain 'wesnoth-help'
local T = wml.tag
local on_event = wesnoth.require("on_event")
local u_pos_filter = function(u_id)
@ -100,7 +99,7 @@ function wesnoth.wml_actions.on_undo_diversion(cfg)
status_anim_update(true)
end
on_event("moveto, die, recruit, recall", function()
wesnoth.game_events.add_repeating("moveto, die, recruit, recall", function()
status_anim_update()
end)

View file

@ -1,10 +1,9 @@
local _ = wesnoth.textdomain 'wesnoth-help'
local T = wml.tag
local on_event = wesnoth.require("on_event")
-- The feeding event code
on_event("die", function()
wesnoth.game_events.add_repeating("die", function()
local ec = wesnoth.current.event_context
if not ec.x1 or not ec.y1 or not ec.x2 or not ec.y2 then

View file

@ -1,6 +1,6 @@
-- << pick_advance/main.lua
local on_event = wesnoth.require "on_event"
local on_event = wesnoth.game_events.add_repeating
local F = wesnoth.require "functional"
local T = wml.tag
local _ = wesnoth.textdomain "wesnoth"

View file

@ -1,7 +1,7 @@
local _ = wesnoth.textdomain 'wesnoth-multiplayer'
local T = wml.tag
local on_event = wesnoth.require("on_event")
local on_event = wesnoth.game_events.add_repeating
local random_spawns = {
{

View file

@ -1,6 +1,6 @@
local _ = wesnoth.textdomain 'wesnoth-multiplayer'
local T = wml.tag
local on_event = wesnoth.require("on_event")
local on_event = wesnoth.game_events.add_repeating
local random_spawns = {
{