Skip to content

Commit

Permalink
Merge pull request #40 from davwheat/main
Browse files Browse the repository at this point in the history
fix(TfW trainfx): wrong script for departing
  • Loading branch information
davwheat authored Oct 21, 2023
2 parents ebf04fb + 4f1d753 commit 3f41f92
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/announcement-data/systems/rolling-stock/TfWTrainFx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ interface IStoppedAtStationAnnouncementOptions {

interface IDepartingStopAnnouncementOptions {
nextStationCode: string
terminatesAtCode: string
terminatesHere: boolean
}

interface IApproachingStopAnnouncementOptions {
nextStationCode: string
terminatesAtCode: string
gapType: 'gap' | 'step' | 'step down' | 'none'
}

Expand Down Expand Up @@ -75,16 +74,14 @@ export default class TfWTrainFx extends TrainAnnouncementSystem {
}

private async playDepartingStopAnnouncement(options: IDepartingStopAnnouncementOptions, download: boolean = false): Promise<void> {
const { nextStationCode, terminatesAtCode } = options
const { nextStationCode, terminatesHere } = options

const files: AudioItem[] = []

if (!this.validateStationExists(nextStationCode, 'high')) {
return
}

files.push(...this.getTerminationInfo(terminatesAtCode, 'low'))

files.push(
{
id: 'conjoiners.the next stop is',
Expand All @@ -93,7 +90,7 @@ export default class TfWTrainFx extends TrainAnnouncementSystem {
`stations.high.${nextStationCode}`,
)

if (nextStationCode === terminatesAtCode) {
if (terminatesHere) {
files.push('conjoiners.our final station')
}

Expand Down Expand Up @@ -544,11 +541,10 @@ export default class TfWTrainFx extends TrainAnnouncementSystem {
options: this.AvailableStationItemMaps.high,
type: 'select',
},
terminatesAtCode: {
name: 'Terminates at',
default: this.AvailableDestinationOptions[0].value,
options: this.AvailableDestinationOptions,
type: 'select',
terminatesHere: {
name: 'Terminates here',
default: false,
type: 'boolean',
},
},
},
Expand Down

0 comments on commit 3f41f92

Please sign in to comment.