- Rework formspec layout, fixed tab order
- Added style to use monospaced font for the stn and ars fields
diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua
index 9c1470a..3805117 100644
--- a/advtrains_line_automation/stoprail.lua+++ b/advtrains_line_automation/stoprail.lua
@@ -50,19 +50,18 @@ local function show_stoprailform(pos, player)
end
local form = "size[8,7]"
- form = form.."field[0.5,0.5;7,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]"- form = form.."field[0.5,1.5;7,1;stnname;"..attrans("Station Name")..";"..minetest.formspec_escape(stnname).."]"- form = form.."field[0.5,2.5;1.5,1;ddelay;"..attrans("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]"- form = form.."field[2,2.5;2,1;speed;"..attrans("Departure Speed")..";"..minetest.formspec_escape(stdata.speed).."]"- form = form.."checkbox[5,1.75;reverse;"..attrans("Reverse train")..";"..(stdata.reverse and "true" or "false").."]"- form = form.."checkbox[5,2.0;kick;"..attrans("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]"- form = form.."label[0.5,3;Door side:]"- form = form.."dropdown[0.5,3;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]" - form = form.."field[5,3.5;2,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]"- form = form.."field[5,4.5;2,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]"-- form = form.."textarea[0.5,4;4,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]"-+ form = form.."style[stn,ars;font=mono]"+ form = form.."field[0.8,0.8;2,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]"+ form = form.."field[2.8,0.8;5,1;stnname;"..attrans("Station Name")..";"..minetest.formspec_escape(stnname).."]"+ form = form.."field[0.80,2.0;1.75,1;ddelay;"..attrans("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]"+ form = form.."field[2.55,2.0;1.75,1;speed;"..attrans("Dep. Speed")..";"..minetest.formspec_escape(stdata.speed).."]"+ form = form.."field[4.30,2.0;1.75,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]"+ form = form.."field[6.05,2.0;1.75,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]"+ form = form.."label[0.5,2.6;"..attrans("Door Side").."]"+ form = form.."dropdown[0.51,3.0;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]" + form = form.."checkbox[3.00,2.7;reverse;"..attrans("Reverse train")..";"..(stdata.reverse and "true" or "false").."]"+ form = form.."checkbox[3.00,3.1;kick;"..attrans("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]"+ form = form.."textarea[0.8,4.2;7,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]" form = form.."button[0.5,6;7,1;save;"..attrans("Save").."]"
minetest.show_formspec(pname, "at_lines_stop_"..pe, form)
--
2.30.0.windows.1
[PATCH 2/6] Use mono font to ATC rail command fields
- Aligned stuff
- Added style to use monospaced font in the code editor textarea
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
--
2.30.0.windows.1
- Aligned stuff
- Added style to use monospaced font in the code editor textarea
- Added label to the environment dropdown
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
--
2.30.0.windows.1
- Aligned stuff
- Added style to use monospaced font in the ars rules editor textarea
diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua
index 64e45ee..1999941 100644
--- a/advtrains_interlocking/route_ui.lua+++ b/advtrains_interlocking/route_ui.lua
@@ -25,8 +25,8 @@ function atil.show_route_edit_form(pname, sigd, routeid)
if not route then return end
local form = "size[9,10]label[0.5,0.2;Route overview]"
- form = form.."field[0.8,1.2;5.2,1;name;Route name;"..minetest.formspec_escape(route.name).."]"- form = form.."button[5.5,0.9;1,1;setname;Set]"+ form = form.."field[0.8,1.2;6.5,1;name;Route name;"..minetest.formspec_escape(route.name).."]"+ form = form.."button[7.0,0.9;1.5,1;setname;Set]" -- construct textlist for route information
local tab = {}
@@ -80,15 +80,16 @@ function atil.show_route_edit_form(pname, sigd, routeid)
itab("Route ends on dead-end")
end
- form = form.."textlist[0.5,2;7,4;rtelog;"..table.concat(tab, ",").."]"+ form = form.."textlist[0.5,2;7.75,3.9;rtelog;"..table.concat(tab, ",").."]"- form = form.."button[0.5,6;2,1;back;<<< Back to signal]"- form = form.."button[3.5,6;2,1;aspect;Signal Aspect]"- form = form.."button[5.5,6;2,1;delete;Delete Route]"+ form = form.."button[0.5,6;3,1;back;<<< Back to signal]"+ form = form.."button[4.5,6;2,1;aspect;Signal Aspect]"+ form = form.."button[6.5,6;2,1;delete;Delete Route]" --atdebug(route.ars)
- form = form.."textarea[1,7.3;5.2,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]"- form = form.."button[6,7.7;1,1;savears;Save]"+ form = form.."style[ars;font=mono]"+ form = form.."textarea[0.8,7.3;5,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]"+ form = form.."button[5.5,7.23;3,1;savears;Save ARS List]" minetest.show_formspec(pname, "at_il_routeedit_"..minetest.pos_to_string(sigd.p).."_"..sigd.s.."_"..routeid, form)
--
2.30.0.windows.1
[PATCH 6/6] Remove "Last punched" from LuaATC init code fs
Also removed the now-dead last punch pos helper code.
Resized buttons accordinghly.
diff --git a/advtrains_luaautomation/chatcmds.lua b/advtrains_luaautomation/chatcmds.lua
index 31e2a48..a3e6eb5 100644
--- a/advtrains_luaautomation/chatcmds.lua+++ b/advtrains_luaautomation/chatcmds.lua
@@ -1,30 +1,16 @@
--chatcmds.lua
--Registers commands to modify the init and step code for LuaAutomation
---position helper.---punching a node will result in that position being saved and inserted into a text field on the top of init form.-local punchpos={}--minetest.register_on_punchnode(function(pos, node, player, pointed_thing)- local pname=player:get_player_name()- punchpos[pname]=pos-end)-local function get_init_form(env, pname)
local err = env.init_err or ""
local code = env.init_code or ""
- local ppos=punchpos[pname]- local pp=""- if ppos then- pp="POS"..minetest.pos_to_string(ppos)- end+ 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.."]"+ .."button[0.0,0.2;2.5,1;run;Run Init Code]"+ .."button[2.5,0.2;2.5,1;cls;Clear S]"+ .."button[5.0,0.2;2.5,1;save;Save]"+ .."button[7.5,0.2;2.5,1;del;Delete Env.]" .."textarea[0.3,1.5;10,9.5;code;Environment initialization code;"..minetest.formspec_escape(code).."]"
.."label[0.0,9.7;"..err.."]"
return form
--
2.30.0.windows.1