mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-02 19:53:23 +00:00
feat: add constants to hilbish.timers for timeout and interval times types
This commit is contained in:
parent
d5dffabcb2
commit
5dc3b7d337
@ -108,6 +108,8 @@ func (th *timersModule) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// #interface timers
|
// #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 type What type of timer it is
|
||||||
// #property running If the timer is running
|
// #property running If the timer is running
|
||||||
// #property duration The duration in milliseconds that the timer will run
|
// #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()
|
luaTh := rt.NewTable()
|
||||||
util.SetExports(rtm, luaTh, thExports)
|
util.SetExports(rtm, luaTh, thExports)
|
||||||
|
|
||||||
|
util.SetField(rtm, luaTh, "INTERVAL", rt.IntValue(0))
|
||||||
|
util.SetField(rtm, luaTh, "TIMEOUT", rt.IntValue(1))
|
||||||
|
|
||||||
return luaTh
|
return luaTh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user