aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/chatcmds.lua
diff options
context:
space:
mode:
authorhlqkj <kris88hl@gmail.com>2021-03-09 10:03:44 +0100
committerorwell96 <orwell@bleipb.de>2021-03-22 11:06:34 +0100
commit4fcc5527707d233535a9ed106cbd90892d95895c (patch)
tree6c745bdcf7cafcbbd0888370e78aa3ebda3dafa5 /advtrains_luaautomation/chatcmds.lua
parentace8ca0fdac5bfcc588d9ec47c24e28d699e3ca9 (diff)
downloadadvtrains-4fcc5527707d233535a9ed106cbd90892d95895c.tar.gz
advtrains-4fcc5527707d233535a9ed106cbd90892d95895c.tar.bz2
advtrains-4fcc5527707d233535a9ed106cbd90892d95895c.zip
Remove "Last punched" from LuaATC init code fs
Also removed the now-dead last punch pos helper code. Resized buttons accordinghly.
Diffstat (limited to 'advtrains_luaautomation/chatcmds.lua')
-rw-r--r--advtrains_luaautomation/chatcmds.lua24
1 files changed, 5 insertions, 19 deletions
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