- els menus es poden controlar amb el ratolí
This commit is contained in:
@@ -28,6 +28,15 @@ menu = {
|
||||
if menu.selected==0 then menu.selected=#menu.options end
|
||||
if menu.selected>#menu.options then menu.selected=1 end
|
||||
|
||||
local mx,my=mousex(),mousey()
|
||||
if mx>=20 and mx<=140 and my>=28 and my<=(28+#menu.options*10) then
|
||||
menu.selected=min(1+flr((my-28)/10),#menu.options)
|
||||
if mbtnp(1) then
|
||||
update=menu.old_update
|
||||
menu.options[menu.selected][2]()
|
||||
end
|
||||
end
|
||||
|
||||
if btnp(KEY_RETURN) then
|
||||
update=menu.old_update
|
||||
menu.options[menu.selected][2]()
|
||||
|
||||
Reference in New Issue
Block a user