feat: add constants to hilbish.timers for timeout and interval times types

commander-stdout
sammyette 2022-12-20 20:55:56 -04:00
parent d5dffabcb2
commit 5dc3b7d337
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 5 additions and 0 deletions

View File

@ -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
}