- els menus es poden controlar amb el ratolí

This commit is contained in:
2023-01-27 20:00:37 +01:00
parent c679a6dc39
commit 2d82e95373

View File

@@ -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]()