First step in redesigning lua widgets
This commit is contained in:
@@ -55,13 +55,9 @@ function engio.getlookat()
|
||||
end
|
||||
|
||||
-- if the class has a function 'lookhotkeys', then the correct
|
||||
-- look-at widget is 'hotkeys'. We're going to automatically
|
||||
-- generate the correct response.
|
||||
-- look-at widget is 'hotkeys'.
|
||||
if class.lookhotkeys ~= nil then
|
||||
local keys = hotkeylist.create()
|
||||
class.lookhotkeys(keys)
|
||||
setmetatable(keys, nil)
|
||||
return keys
|
||||
return "hotkeys"
|
||||
end
|
||||
|
||||
-- otherwise, if the class has a function 'getlookat', use that.
|
||||
@@ -73,6 +69,20 @@ function engio.getlookat()
|
||||
return ""
|
||||
end
|
||||
|
||||
function engio.gethotkeys()
|
||||
local class = tangible.getclass(place)
|
||||
|
||||
-- if the tangible doesn't have a 'lookhotkeys' function, do nothing
|
||||
if class == nil or class.lookhotkeys == nil then
|
||||
return {}
|
||||
end
|
||||
|
||||
local keys = hotkeylist.create()
|
||||
class.lookhotkeys(keys)
|
||||
setmetatable(keys, nil)
|
||||
return keys
|
||||
end
|
||||
|
||||
function engio.presshotkey(action)
|
||||
local class = tangible.getclass(place)
|
||||
|
||||
@@ -94,4 +104,4 @@ function jp3()
|
||||
tangible.animate{tan=actor, anim={action="play", seq="jump"}}
|
||||
tangible.animate{tan=actor, anim={action="play", seq="jump"}}
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user