From 307912681cf111088c9e940864d46cc2d401042b Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 7 Dec 2018 20:42:41 +0100 Subject: [PATCH] Lua: detect that the layer has changed and update layer buttons fixes bug #42 http://pulkomandy.tk/projects/GrafX2/ticket/42 --- src/factory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/factory.c b/src/factory.c index f5a41159..fb995a98 100644 --- a/src/factory.c +++ b/src/factory.c @@ -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) char buf[MAX_PATH_CHARACTERS]; 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 Cursor_shape=CURSOR_SHAPE_HOURGLASS; @@ -2519,6 +2519,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename) Hide_cursor(); Display_all_screen(); + 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