From b9c824db00f73c28b6b728e35a9967bc54054020 Mon Sep 17 00:00:00 2001 From: hlqkj Date: Tue, 9 Mar 2021 10:03:42 +0100 Subject: [PATCH] Rework active_common formspec layout - Aligned stuff - Added style to use monospaced font in the code editor textarea - Added label to the environment dropdown --- advtrains_luaautomation/active_common.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/advtrains_luaautomation/active_common.lua b/advtrains_luaautomation/active_common.lua index d168bad..36cb8cd 100644 --- a/advtrains_luaautomation/active_common.lua +++ b/advtrains_luaautomation/active_common.lua @@ -41,9 +41,14 @@ function ac.getform(pos, meta_p) sel=#envs_asvalues end end - local form = "size[10,10]dropdown[0,0;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" - .."button[4,0;2,1;save;Save]button[7,0;2,1;cle;Clear local env] textarea[0.2,1;10,10;code;Code;"..minetest.formspec_escape(code).."]" - .."label[0,9.8;"..err.."]" + local form = "size[10,10]" + .."style[code;font=mono]" + .."label[0,-0.1;Environment]" + .."dropdown[0,0.3;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" + .."button[5,0.2;2,1;save;Save]" + .."button[7,0.2;3,1;cle;Clear Local Env.]" + .."textarea[0.3,1.5;10,9.5;code;Code;"..minetest.formspec_escape(code).."]" + .."label[0,9.7;"..err.."]" return form end