# Segnale basso (marmotta) ininfluente per il binario alla sua sinistra, da
# accoppiare come avviso al segnale successivo; si apre solo quando il suc-
# cessivo è in shunt, e lampeggia se il segnale successivo al suo è spento.
#
# Aspetti: _ (stop), | (on), |x (flashing), spento (off)

# Irrelevant shunting dwarf commanding to the left, acting as a distant of
# the main signal that follows. This signal is clear on when the next signal
# shows shunt, and flashes if the signal next to its own is disabled.
#
# Aspects: _ (stop), | (on), |x (flashing), off

# P.Rosati  21/01/2021 (Versione 5.1)

Aspect: stop
	IconE: MF_-_E.xpm
	IconW: MF_-_W.xpm
	IconN: MF_-_N.xpm
	IconS: MF_-_S.xpm
	Action: none

Aspect: on
	IconE: MF_I_E.xpm
	IconW: MF_I_W.xpm
	IconN: MF_I_N.xpm
	IconS: MF_I_S.xpm
	Action: none

Aspect: flashing
	IconE: MF_I_E.xpm MF___E.xpm
	IconW: MF_I_W.xpm MF___W.xpm
	IconN: MF_I_N.xpm MF___N.xpm
	IconS: MF_I_S.xpm MF___S.xpm
	Action: none

Aspect: off
	IconE: MF___E.xpm
	IconW: MF___W.xpm
	IconN: MF___N.xpm
	IconS: MF___S.xpm
	Action: none

# initial aspect

OnInit:
	.aspect = stop
end

# the player or a script cleared the signal

OnCleared:
	return
end

# this or another signal changed its aspect

OnUpdate:
	if next.aspect = off or next.aspect = fault
		.aspect = off
		return
	end
	if next.aspect ! shunt
		.aspect = stop
		return
	end
	.aspect = on
	if next.next.script > "rfi_LL" and next.next.script < "rfi_LN"
		return
	end
	# Se il suo è S e quello oltre il suo è spento, lampeggia
	# If its signal is S, and the one beyond is unlit, flashes
	if next.next.aspect = disabled or next.next.aspect = off
		.aspect = flashing
	end
end

# a train passed the signal

OnCross:
	return
end
