Overhaul of thread handling to support blocking functions other than wait
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user