Compare commits
2 Commits
c679a6dc39
...
9467d72fbb
| Author | SHA1 | Date | |
|---|---|---|---|
| 9467d72fbb | |||
| 2d82e95373 |
@@ -42,6 +42,30 @@ editor={
|
||||
editor.paused=true
|
||||
editor.show_menu()
|
||||
end
|
||||
if btnp(KEY_TAB) then
|
||||
update=editor.update_tileset
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
update_tileset=function()
|
||||
cls()
|
||||
sspr(0,0,128,128,0,0)
|
||||
|
||||
local mx,my=mousex(),mousey()
|
||||
local tx,ty=mx>>3,my>>3
|
||||
local rx,ry=tx<<3,ty<<3
|
||||
rect(rx-1, ry-1, rx+8, ry+8, 10)
|
||||
|
||||
if btnp(KEY_TAB) or btnp(KEY_ESCAPE) then
|
||||
update=editor.update
|
||||
end
|
||||
|
||||
if mbtnp(1) then
|
||||
if tx<16 and ty<16 then
|
||||
editor.selected_tile=ty*16+tx
|
||||
end
|
||||
update=editor.update
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
@@ -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