From 75474ec07e0ed497eb4abbe902aa9187fc657937 Mon Sep 17 00:00:00 2001 From: hlqkj Date: Tue, 9 Mar 2021 10:03:41 +0100 Subject: Rework envsetup formspec layout - Aligned stuff - Added style to use monospaced font in the code editor textarea --- advtrains_luaautomation/chatcmds.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'advtrains_luaautomation') diff --git a/advtrains_luaautomation/chatcmds.lua b/advtrains_luaautomation/chatcmds.lua index 468698b..31e2a48 100644 --- a/advtrains_luaautomation/chatcmds.lua +++ b/advtrains_luaautomation/chatcmds.lua @@ -18,10 +18,15 @@ local function get_init_form(env, pname) if ppos then pp="POS"..minetest.pos_to_string(ppos) end - local form = "size[10,10]button[0,0;2,1;run;Run InitCode]button[2,0;2,1;cls;Clear S]" - .."button[4,0;2,1;save;Save] button[6,0;2,1;del;Delete Env.] field[8.1,0.5;2,1;punchpos;Last punched position;"..pp.."]" - .."textarea[0.2,1;10,10;code;Environment initialization code;"..minetest.formspec_escape(code).."]" - .."label[0,9.8;"..err.."]" + local form = "size[10,10]" + .."style[code;font=mono]" + .."button[0.0,0.2;2,1;run;Run InitCode]" + .."button[2.0,0.2;2,1;cls;Clear S]" + .."button[4.0,0.2;2,1;save;Save]" + .."button[6.0,0.2;2,1;del;Delete Env.]" + .."field[8.3,0.5;2,1;punchpos;Last punched position;"..pp.."]" + .."textarea[0.3,1.5;10,9.5;code;Environment initialization code;"..minetest.formspec_escape(code).."]" + .."label[0.0,9.7;"..err.."]" return form end -- cgit v1.2.3