OnCommand and OnInit

This commit is contained in:
Krzosa Karol
2024-08-15 10:03:44 +02:00
parent d4ac1dd817
commit b5772fa52c
7 changed files with 90 additions and 10 deletions

View File

@@ -185,6 +185,19 @@ KEY_RIGHT = 1073741903
KEY_LEFT = 1073741904
KEY_Q = 113
KEY_F1 = 0x4000003a
KEY_F2 = 0x4000003b
KEY_F3 = 0x4000003c
KEY_F4 = 0x4000003d
KEY_F5 = 0x4000003e
KEY_F6 = 0x4000003f
KEY_F7 = 0x40000040
KEY_F8 = 0x40000041
KEY_F9 = 0x40000042
KEY_F10 = 0x40000043
KEY_F11 = 0x40000044
KEY_F12 = 0x40000045
function SkipLineAndColumn(s)
local line, col = "1", "1"
@@ -355,21 +368,28 @@ Coroutines = {}
function AddCo(f)
local i = #Coroutines + 1
Coroutines[i] = coroutine.create(f)
coroutine.resume(Coroutines[i])
return Coroutines[i]
end
function OnUpdate()
function OnUpdate(e)
local new_co_list = {}
for key, co in pairs(Coroutines) do
local status = coroutine.status(co)
if status ~= "dead" then
coroutine.resume(co)
coroutine.resume(co, e)
new_co_list[#new_co_list + 1] = co
end
end
Coroutines = new_co_list
end
function OnCommand(e)
end
function OnInit()
end
)==";
void GenerateConfig() {