From 224f5d9aeef518a390cfe2602266ce0ca8ddefde Mon Sep 17 00:00:00 2001 From: Xertis <118364459+Xertis@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:24:36 +0300 Subject: [PATCH 1/3] Fix gui.template --- res/scripts/stdlib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 67cdd0fe..af035d36 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -195,7 +195,7 @@ function gui.template(name, params) text = text:gsub("if%s*=%s*\"%%{%w+}\"", "if=\"\"") -- remove unsolved properties: attr='%{var}' text = text:gsub("%w+%s*=%s*'%%{%w+}'%s?", "") - text = text:gsub("%w+%s*=%s*\"%%{%w+}\"%s?", "") + text = text:gsub('%s*%S+="%%{[^}]+}"%s*', " ")) return text end From 46c38edf8a26f70f395725550de249b640aaa59c Mon Sep 17 00:00:00 2001 From: Xertis <118364459+Xertis@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:32:20 +0300 Subject: [PATCH 2/3] fix unexpected ")" --- res/scripts/stdlib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index af035d36..ce7f5b48 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -195,7 +195,7 @@ function gui.template(name, params) text = text:gsub("if%s*=%s*\"%%{%w+}\"", "if=\"\"") -- remove unsolved properties: attr='%{var}' text = text:gsub("%w+%s*=%s*'%%{%w+}'%s?", "") - text = text:gsub('%s*%S+="%%{[^}]+}"%s*', " ")) + text = text:gsub('%s*%S+="%%{[^}]+}"%s*', " ") return text end From 9af5dcb68eb573433197671bd3aaf887010f827e Mon Sep 17 00:00:00 2001 From: Xertis <118364459+Xertis@users.noreply.github.com> Date: Sun, 26 Jan 2025 00:00:25 +0300 Subject: [PATCH 3/3] fix second gsub --- res/scripts/stdlib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index ce7f5b48..9d29b873 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -194,7 +194,7 @@ function gui.template(name, params) text = text:gsub("if%s*=%s*'%%{%w+}'", "if=''") text = text:gsub("if%s*=%s*\"%%{%w+}\"", "if=\"\"") -- remove unsolved properties: attr='%{var}' - text = text:gsub("%w+%s*=%s*'%%{%w+}'%s?", "") + text = text:gsub("%s*%S+='%%{[^}]+}'%s*", " ") text = text:gsub('%s*%S+="%%{[^}]+}"%s*', " ") return text end