From bfe85d7eb3cef937a19d27a6438b7b6433493288 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Fri, 3 Feb 2023 16:09:59 +0100 Subject: [PATCH] =?UTF-8?q?-=20Opci=C3=B3=20per=20a=20recarregar=20texture?= =?UTF-8?q?s=20'en=20calent'=20des=20de=20l'editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/editor.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/editor.lua b/data/editor.lua index b90a003..99613f2 100644 --- a/data/editor.lua +++ b/data/editor.lua @@ -17,10 +17,24 @@ editor={ {"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}, {"RESIZE MAP", editor.resize}, + {"RELOAD TEXTURES", editor.reload_textures}, {"EXIT", main_init}, }, function()editor.paused=false end) end, + reload_textures=function() + freesurf(sprites) + freesurf(objectes) + freesurf(tiles) + sprites=loadsurf("sprites.gif") + objectes=loadsurf("objects.gif") + tiles=loadsurf("tiles.gif") + setsource(tiles) + local pal=loadpal("tiles.gif") + setpal(pal) + editor.paused=false + end, + toggle_front_layer=function() if not mapa.front_layer then mapa.front_layer=newsurf(mapa.w,mapa.h)