Overhaul of thread handling to support blocking functions other than wait

This commit is contained in:
2022-04-25 17:17:41 -04:00
parent bd389c7815
commit 9aec7c5299
15 changed files with 144 additions and 88 deletions

View File

@@ -3,6 +3,7 @@ makeclass('login')
function login.interface(actor, place)
gui.menu_item("cb_becomeplayer", "Become a Player")
gui.menu_item("cb_p123", "Print 1, 2, 3")
gui.menu_item("cb_p123_nopredict", "Print 1, 2, 3 nopredict")
end
function login.cb_becomeplayer(actor, place, dialog)
@@ -20,9 +21,21 @@ function login.cb_p123(actor, place, dialog)
print(3)
end
function login.cb_p123_nopredict(actor, place, dialog)
nopredict()
print(1)
wait(1)
print(2)
wait(1)
print(3)
end
-- this is function documentation for setfoo.
function setfoo(n)
tangible.nopredict()
if (n == nil) then
error("setfoo(n) - n must be an integer")
end
nopredict()
tangible.actor().inventory.foo = n
end