Commit 30791268 authored by Thomas Bernard's avatar Thomas Bernard 💬 Committed by Adrien Destugues

Lua: detect that the layer has changed and update layer buttons

fixes bug #42
parent ab8c7530
Pipeline #39432551 passed with stage
in 11 minutes and 31 seconds
......@@ -1956,7 +1956,6 @@ int L_SelectLayer(lua_State* L)
Update_depth_buffer(); // Only need the depth buffer
// Todo: mark the layer menu bar as 'needs to be refreshed'
return 0;
......@@ -2326,6 +2325,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
int original_image_width=Main.image_width;
int original_image_height=Main.image_height;
int original_current_layer = Main.current_layer;
// Some scripts are slow
......@@ -2519,6 +2519,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
if (original_current_layer != Main.current_layer)
Display_layerbar(); // current layer has changed, buttons need to be updated
// Update tilemap if image size has changed
if (original_image_width!=Main.image_width
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment