aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/textures/atlatc_pcnaming.png
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-06-19 19:50:11 +0200
committerorwell96 <orwell@bleipb.de>2018-06-19 19:50:11 +0200
commit65675664e3cdf3328b89b4bdc22cc07c21be3a56 (patch)
tree4519b5d3fd9f13c0f554eba7e88a7e3bcdc36616 /advtrains_luaautomation/textures/atlatc_pcnaming.png
parent08ac0f9c05c4623a2783749b1dee2dafa234cee6 (diff)
downloadadvtrains-65675664e3cdf3328b89b4bdc22cc07c21be3a56.tar.gz
advtrains-65675664e3cdf3328b89b4bdc22cc07c21be3a56.tar.bz2
advtrains-65675664e3cdf3328b89b4bdc22cc07c21be3a56.zip
Interlocking: Create demo signals, signal API and model for TCB configurer node
Diffstat (limited to 'advtrains_luaautomation/textures/atlatc_pcnaming.png')
0 files changed, 0 insertions, 0 deletions
n136' href='#n136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
-- stoprail.lua
-- adds "stop rail". Recognized by lzb. (part of behavior is implemented there)


local function updatemeta(pos)
	local meta = minetest.get_meta(pos)
	local pe = advtrains.encode_pos(pos)
	local stdata = advtrains.lines.stops[pe]
	if not stdata then
		meta:set_string("infotext", "Error")
	end
	
	meta:set_string("infotext", "Stn. "..stdata.stn.." T. "..stdata.track)
end

local door_dropdown = {L=1, R=2, C=3}
local door_dropdown_rev = {Right="R", Left="L", Closed="C"}

local function show_stoprailform(pos, player)
	local pe = advtrains.encode_pos(pos)
	local pname = player:get_player_name()
	if minetest.is_protected(pos, pname) then
		minetest.chat_send_player(pname, "Position is protected!")
		return
	end
	
	local stdata = advtrains.lines.stops[pe]
	if not stdata then
		advtrains.lines.stops[pe] = {
					stn="", track="", doors="R", wait=10
				}
		stdata = advtrains.lines.stops[pe]
	end
	
	local stn = advtrains.lines.stations[stdata.stn]
	local stnname = stn and stn.name or ""
	
	local form = "size[8,6.5]"
	form = form.."field[0.5,1;7,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]"