From 5dc3b7d337845c8004e3f9be25cb21c072e19027 Mon Sep 17 00:00:00 2001 From: sammyette Date: Tue, 20 Dec 2022 20:55:56 -0400 Subject: [PATCH] feat: add constants to hilbish.timers for timeout and interval times types --- timerhandler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/timerhandler.go b/timerhandler.go index 92947e1..a2c5caf 100644 --- a/timerhandler.go +++ b/timerhandler.go @@ -108,6 +108,8 @@ func (th *timersModule) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) { } // #interface timers +// #field INTERVAL Constant for an interval timer type +// #field TIMEOUT Constant for a timeout timer type // #property type What type of timer it is // #property running If the timer is running // #property duration The duration in milliseconds that the timer will run @@ -156,6 +158,9 @@ func (th *timersModule) loader(rtm *rt.Runtime) *rt.Table { luaTh := rt.NewTable() util.SetExports(rtm, luaTh, thExports) + util.SetField(rtm, luaTh, "INTERVAL", rt.IntValue(0)) + util.SetField(rtm, luaTh, "TIMEOUT", rt.IntValue(1)) + return luaTh }