internal override void Trigger(int Direction, EventTriggerType TriggerType, TrainManager.Train Train, int CarIndex)
{
if (TriggerType == EventTriggerType.FrontCarFrontAxle)
{
if (Direction < 0)
{
Train.StationFrontCar = true;
}
else if (Direction > 0)
{
Train.StationFrontCar = false;
if (Train == TrainManager.PlayerTrain)
{
Timetable.UpdateCustomTimetable(Game.Stations[this.StationIndex].TimetableDaytimeTexture, Game.Stations[this.StationIndex].TimetableNighttimeTexture);
}
}
}
else if (TriggerType == EventTriggerType.RearCarRearAxle)
{
if (Direction < 0)
{
Train.Station = this.StationIndex;
Train.StationRearCar = true;
if (Train.NextStopSkipped != TrainManager.StopSkipMode.None)
{
Train.LastStation = this.StationIndex;
}
Train.NextStopSkipped = TrainManager.StopSkipMode.None;
}
else if (Direction > 0)
{
if (Train.Station == StationIndex)
{
if (Train == TrainManager.PlayerTrain)
{
if (Game.PlayerStopsAtStation(StationIndex) & TrainManager.PlayerTrain.StationState == TrainManager.TrainStopState.Pending)
{
string s = Interface.GetInterfaceString("message_station_passed");
s = s.Replace("[name]", Game.Stations[StationIndex].Name);
Game.AddMessage(s, MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Orange, Game.SecondsSinceMidnight + 10.0, null);
}
else if (Game.PlayerStopsAtStation(StationIndex) & TrainManager.PlayerTrain.StationState == TrainManager.TrainStopState.Boarding)
{
string s = Interface.GetInterfaceString("message_station_passed_boarding");
s = s.Replace("[name]", Game.Stations[StationIndex].Name);
Game.AddMessage(s, MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Red, Game.SecondsSinceMidnight + 10.0, null);
}
}
Train.Station = -1;
Train.StationRearCar = false;
Train.StationState = TrainManager.TrainStopState.Pending;
int d = Train.DriverCar;
Sounds.StopSound(Train.Cars[d].Sounds.Halt.Source);
}
}
}
}