- [FIX] El layer frontal no se veïa (encara que no se si al final s'usarà)

This commit is contained in:
2024-02-20 14:02:18 +01:00
parent 297662de6f
commit d41566e393
3 changed files with 20 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ editor={
menu.show({ {"NEW MAP", editor.new}, menu.show({ {"NEW MAP", editor.new},
{"LOAD MAP", function() textbox.show("FILENAME TO LOAD:",editor.load, mapa.name) end}, {"LOAD MAP", function() textbox.show("FILENAME TO LOAD:",editor.load, mapa.name) end},
{"SAVE MAP", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end}, {"SAVE MAP", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end},
{mapa.front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer}, {editor.editing_front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer},
{"RESIZE MAP", editor.resize}, {"RESIZE MAP", editor.resize},
{"RELOAD TEXTURES", editor.reload_textures}, {"RELOAD TEXTURES", editor.reload_textures},
{"EXIT", main_init}, {"EXIT", main_init},
@@ -40,17 +40,23 @@ editor={
end, end,
toggle_front_layer=function() toggle_front_layer=function()
if not mapa.front_layer then if editor.editing_front_layer then
mapa.front_layer=newsurf(mapa.w,mapa.h) setmap(mapa.surface)
editor.editing_front_layer=true editor.editing_front_layer=false;
setmap(mapa.front_layer)
for y=0,mapa.h-1 do
for x=0,mapa.w-1 do
mset(x,y,0)
end
end
else else
mapa.front_layer=nil if not mapa.front_layer then
mapa.front_layer=newsurf(mapa.w,mapa.h)
editor.editing_front_layer=true
setmap(mapa.front_layer)
for y=0,mapa.h-1 do
for x=0,mapa.w-1 do
mset(x,y,0)
end
end
else
editor.editing_front_layer=true
setmap(mapa.front_layer)
end
end end
editor.paused=false editor.paused=false
end, end,

View File

@@ -22,8 +22,8 @@ game={
restart=function() restart=function()
flags={} flags={}
objects.list={} objects.list={}
actors.main={name="jailer",x=9,y=14,o="u",gfx={x=32,y=0},level="repro"} actors.main={name="jailer",x=6,y=30,o="u",gfx={x=32,y=0},level="vella"}
game.init("repro") game.init("vella")
end, end,
init=function(levelname,f,objs) init=function(levelname,f,objs)

View File

@@ -15,6 +15,7 @@ mapa={
mset(x,y,0) mset(x,y,0)
end end
end end
mapa.front_layer=nil
end, end,
load = function(filename) load = function(filename)