From 3d12b85489aa262c6f6b0fda79df165423538b9c Mon Sep 17 00:00:00 2001 From: ZwerOxotnik Date: Tue, 28 Sep 2021 12:03:51 +0300 Subject: [PATCH] Update to 0.9.14 --- changelog.txt | 5 +++++ info.json | 2 +- models/lua-compiler.lua | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 622e5b4..a95e839 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.9.14 +Date: 28. 09. 2021 + Changes: + - Refactored on_gui_click event sligthly +--------------------------------------------------------------------------------------------------- Version: 0.9.13 Date: 28. 09. 2021 Changes: diff --git a/info.json b/info.json index 182d2d9..1a22101 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "lua-compiler", - "version": "0.9.13", + "version": "0.9.14", "factorio_version": "1.1", "title": "Lua Compiler", "author": "ZwerOxotnik", diff --git a/models/lua-compiler.lua b/models/lua-compiler.lua index 1809a0a..c57d522 100644 --- a/models/lua-compiler.lua +++ b/models/lua-compiler.lua @@ -14,7 +14,7 @@ local players_copyboard --#region Constants -local find = string.find +local sub = string.sub local RED_COLOR = {1, 0, 0} local DEFAULT_TEXT = "local compiler, player = ...\nplayer.print(compiler.name)" --#endregion @@ -359,7 +359,7 @@ local GUIS = { } local function on_gui_click(event) local element = event.element - if not find(element.name, "^zLua_") then return end + if sub(element.name, 1, 5) ~= "zLua_" then return end local f = GUIS[element.name] if f then f(element, game.get_player(event.player_index)) end