diff options
author | orwell <orwell@bleipb.de> | 2024-11-11 20:50:28 +0100 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2024-11-11 20:50:28 +0100 |
commit | 380c26f7a851f4b4edb3879b544a542e7bfbb490 (patch) | |
tree | 158ac366c93a8581f5792f95eba6932bafe4c325 /advtrains_interlocking/route_ui.lua | |
parent | 29180f0f60871f92889f686fe666c029ac07861a (diff) | |
parent | 3d2d19f6f7eba90f0d19b002824b2ff466567608 (diff) | |
download | advtrains-380c26f7a851f4b4edb3879b544a542e7bfbb490.tar.gz advtrains-380c26f7a851f4b4edb3879b544a542e7bfbb490.tar.bz2 advtrains-380c26f7a851f4b4edb3879b544a542e7bfbb490.zip |
Merge branch 'master' into route_prog_rework
Diffstat (limited to 'advtrains_interlocking/route_ui.lua')
-rw-r--r-- | advtrains_interlocking/route_ui.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua index b01d449..478e8dc 100644 --- a/advtrains_interlocking/route_ui.lua +++ b/advtrains_interlocking/route_ui.lua @@ -25,7 +25,7 @@ function atil.show_route_edit_form(pname, sigd, routeid) local route = tcbs.routes[routeid] if not route then return end - local form = "size[9,10]label[0.5,0.2;Route overview]" + local form = "size[9,11]label[0.5,0.2;Route overview]" 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]" @@ -114,11 +114,12 @@ function atil.show_route_edit_form(pname, sigd, routeid) form = form.."button[3.5,6;2,1;noautogen;Clr Autogen]" end form = form.."button[5.5,6;3,1;delete;Delete Route]" + form = form.."button[5.5,7;3,1;newfrom;New From Route]" --atdebug(route.ars) 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]" + form = form.."textarea[0.8,8.3;5,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]" + form = form.."button[5.5,8.23;3,1;savears;Save ARS List]" minetest.show_formspec(pname, "at_il_routeedit_"..minetest.pos_to_string(sigd.p).."_"..sigd.s.."_"..routeid, form) @@ -185,6 +186,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) table.remove(tcbs.routes, routeid) advtrains.interlocking.show_signalling_form(sigd, pname) end + + if fields.newfrom then + advtrains.interlocking.init_route_prog(pname, sigd, route) + minetest.close_formspec(pname, formname) + tcbs.ars_ignore_next = nil + return + end if fields.ars and fields.savears then route.ars = atil.text_to_ars(fields.ars) |