aboutsummaryrefslogtreecommitdiff
path: root/advtrains_signals_ks/models
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_signals_ks/models')
0 files changed, 0 insertions, 0 deletions
ef='#n70'>70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
--chatcmds.lua
--Registers commands to modify the init and step code for LuaAutomation

local function get_init_form(env, pname)
	local err = env.init_err or ""
	local code = env.init_code or ""

	local form = "size["..atlatc.CODE_FORM_SIZE.."]"
		.."style[code;font=mono]"
		.."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;"..atlatc.CODE_FORM_SIZE..";code;Environment initialization code;"..minetest.formspec_escape(code).."]"
		.."label[0.0,9.7;"..err.."]"
	return form
end

core.register_chatcommand("env_setup", {
	params = "<environment name>",
	description = "Set up and modify AdvTrains LuaAutomation environment",
	privs = {atlatc=true},
	func = function(name, param)
		local env=atlatc.envs[param]
		if not env then return false,"Invalid environment name!" end