From 44c93e7caf7e3cef91d8931b1559dd1912e893b7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 15 Dec 2018 13:16:40 +0000 Subject: Pass event name to handler --- scripts/toy.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/toy.groovy b/scripts/toy.groovy index 1cb9672..9e26632 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -207,7 +207,7 @@ def execEvents = { rt -> events.remove(e.key); saveEvents(events); if (f) { - f(e.value.arg, e.value.time, rt); + f(e.key, e.value.arg, e.value.time, rt); } }) }; @@ -1330,10 +1330,9 @@ def beginPlan = { plan -> }; // Initial - basic checks and defaults namedEvents = [ - // name: func(arg, schedTime rt) - play: { arg, schedTime, rt -> playEvent(rt, arg) }, - redress: { arg, schedTime, rt -> redress(rt) }, - permit: { arg, schedTime, rt -> givePermission(arg) } + play: { name, arg, schedTime, rt -> playEvent(rt, arg) }, + redress: { name, arg, schedTime, rt -> redress(rt) }, + permit: { name, arg, schedTime, rt -> givePermission(arg) } ]; def setupInitial = { if (loadInteger("toy.version") == null) { -- cgit v1.2.3