diff --git a/package.json b/package.json index 6584efd..623712d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.30.2", + "version": "1.30.3", "private": true, "type": "module", "scripts": { diff --git a/src/components/SceneryView/SceneryHeader.vue b/src/components/SceneryView/SceneryHeader.vue index babcb09..c295d04 100644 --- a/src/components/SceneryView/SceneryHeader.vue +++ b/src/components/SceneryView/SceneryHeader.vue @@ -1,5 +1,13 @@ - diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue index 6f0f78b..5a71098 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue @@ -44,6 +44,7 @@ {{ route.routeName }} {{ route.routeSpeed }} + | {{ route.routeSpeedExit }} {{ (route.routeLength / 1000).toFixed(1) + 'km' }} diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index dd50b70..4c5a648 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -93,18 +93,56 @@
- - {{ row.train.timetableData!.category }} - -   - {{ row.train.trainNo }} -  •  - {{ row.train.driverName }} + + TWR + + + + TN + + + + PN + + + + + + {{ row.train.timetableData!.category }} + + +  {{ row.train.trainNo }} + + + {{ row.train.driverName }} + + {{ row.train.stockList[0] }} + + + @use '../../styles/responsive'; @use '../../styles/animations'; +@use '../../styles/badge'; .scenery-timetable { height: 100%; @@ -468,21 +507,31 @@ export default defineComponent({ .general-info { display: flex; + flex-direction: column; flex-wrap: wrap; +} - .info-number { - color: var(--clr-primary); - } +.info-train { + display: flex; + flex-wrap: wrap; + gap: 0.25em; +} - .info-route { - width: 100%; - } +.info-train > .train-badge { + font-size: 0.85em; +} - img { - height: 0.9em; - vertical-align: middle; - margin: 0 0.25em; - } +.info-number { + color: var(--clr-primary); +} + +.info-route { + width: 100%; +} + +.stop-comments-icon > img { + width: 1.2em; + vertical-align: middle; } .schedule { diff --git a/src/components/SceneryView/ScheduledTrainStatus.vue b/src/components/SceneryView/ScheduledTrainStatus.vue index 90755f6..2d642a9 100644 --- a/src/components/SceneryView/ScheduledTrainStatus.vue +++ b/src/components/SceneryView/ScheduledTrainStatus.vue @@ -2,11 +2,9 @@
- {{ computedScheduledTrain.stopStatusIndicator }}
@@ -28,48 +26,37 @@ export default defineComponent({ computedScheduledTrain() { const { status, prevElement, currentElement, nextElement } = this.sceneryTimetableRow; - const prevDepartureIndicator = prevElement?.departureRouteExt - ? `(${prevElement.departureRouteExt}) ${prevElement.stationName}` - : '---'; - - const nextArrivalIndicator = nextElement?.arrivalRouteExt - ? `(${nextElement.arrivalRouteExt}) ${nextElement.stationName}` - : `${currentElement.stationName}`; - - let stopStatusDescription = '', - stopStatusIndicator = ''; + let stopStatusIndicator = ''; switch (status) { case StopStatus.ARRIVING: - stopStatusIndicator = `${this.$t('timetables.from')}: ${prevDepartureIndicator}`; - stopStatusDescription = this.$t('timetables.desc-arriving', { - prevStationName: prevElement?.stationName ?? '', - prevDepartureLine: prevElement?.departureRouteExt ?? '' - }); + if (prevElement) { + stopStatusIndicator = this.$t('timetables.desc-arriving', { + prevStationName: prevElement?.stationName ?? '', + prevDepartureLine: prevElement?.departureRouteExt ?? '' + }); + } else { + stopStatusIndicator = this.$t('timetables.desc-beginning'); + } break; case StopStatus.ONLINE: case StopStatus.STOPPED: stopStatusIndicator = nextElement?.arrivalRouteExt - ? `${this.$t('timetables.to')}: ${nextArrivalIndicator}` - : `${this.$t('timetables.desc-end')}`; - stopStatusDescription = nextElement?.arrivalRouteExt ? this.$t(`timetables.desc-${status}`, { nextStationName: nextElement?.stationName, nextArrivalLine: nextElement?.arrivalRouteExt }) - : ''; + : this.$t(`timetables.desc-end`); break; case StopStatus.DEPARTED: - stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`; - if (!nextElement?.stationName) { - stopStatusDescription = this.$t('timetables.desc-departed-ends', { + stopStatusIndicator = this.$t('timetables.desc-departed-ends', { nextStationName: currentElement.stationName }); } else { - stopStatusDescription = this.$t('timetables.desc-departed', { + stopStatusIndicator = this.$t('timetables.desc-departed', { nextStationName: nextElement?.stationName ?? currentElement.stationName, nextArrivalLine: nextElement?.arrivalRouteExt }); @@ -78,16 +65,14 @@ export default defineComponent({ break; case StopStatus.DEPARTED_AWAY: - stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`; - stopStatusDescription = this.$t('timetables.desc-departed-away', { + stopStatusIndicator = this.$t('timetables.desc-departed-away', { nextStationName: nextElement?.stationName, nextArrivalLine: nextElement?.arrivalRouteExt }); break; case StopStatus.TERMINATED: - stopStatusIndicator = `X ${this.$t('timetables.desc-terminated')}`; - stopStatusDescription = this.$t('timetables.desc-terminated'); + stopStatusIndicator = this.$t('timetables.desc-terminated'); break; default: @@ -95,7 +80,6 @@ export default defineComponent({ } return { ...this.sceneryTimetableRow, - stopStatusDescription, stopStatusIndicator }; } @@ -106,7 +90,6 @@ export default defineComponent({ diff --git a/src/components/TrainsView/TrainSchedule.vue b/src/components/TrainsView/TrainSchedule.vue index f060858..0128399 100644 --- a/src/components/TrainsView/TrainSchedule.vue +++ b/src/components/TrainsView/TrainSchedule.vue @@ -57,7 +57,14 @@ {{ stop.departureLine }} - | {{ stop.departureLineInfo.routeSpeed }} + + | + {{ + stop.departureLineInfo.routeSpeedExit + ? `${stop.departureLineInfo.routeSpeedExit} (${stop.departureLineInfo.routeSpeed})` + : stop.departureLineInfo.routeSpeed + }} - {{ scheduleStops[i + 1].sceneryName }} + {{ stop.nextPointRef.sceneryName }} - {{ scheduleStops[i + 1].arrivalLine }} + {{ stop.nextPointRef.arrivalLine }} - - | {{ scheduleStops[i + 1].arrivalLineInfo!.routeSpeed }} + + | {{ stop.nextPointRef.arrivalLineInfo!.routeSpeed }} + ({{ stop.nextPointRef.arrivalLineInfo!.routeSpeedExit }}) { let isExternal = false; if (stop.arrivalLine === currentPath.arrivalRouteExt) { @@ -287,7 +297,9 @@ export default defineComponent({ status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed', sceneryName: currentPath.stationName, - isSceneryOnline: pathData?.isOnline ?? false + isSceneryOnline: pathData?.isOnline ?? false, + + nextPointRef: null }; if (internalRouteInfo) { @@ -309,6 +321,11 @@ export default defineComponent({ stopRows.push(rowData); + // Assign this row data object to the last one as reference + if (i != 0) { + stopRows[i - 1].nextPointRef = rowData; + } + if (stop.departureLine === currentPath.departureRouteExt) { // Reverse search for last scenery checkpoint if (pathData?.departureLineData) { @@ -328,7 +345,7 @@ export default defineComponent({ currentPath = timetablePath[++currentPathIndex]; pathData = this.getPathSceneryData(currentPath); } - } + }); return stopRows; }, diff --git a/src/components/TrainsView/typings.ts b/src/components/TrainsView/typings.ts index 8097133..a336bce 100644 --- a/src/components/TrainsView/typings.ts +++ b/src/components/TrainsView/typings.ts @@ -196,4 +196,6 @@ export interface TrainSchedulePoint { isSBL: boolean; sceneryName: string | null; isSceneryOnline: boolean; + + nextPointRef: TrainSchedulePoint | null; } \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index e2254de..dd9e8f9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -543,7 +543,7 @@ "no-users": "NO ACTIVE PLAYERS", "no-spawns": "NO OPEN SPAWNS", "no-scenery": "Oops! This scenery doesn't exist!", - "return-btn": "Return", + "return-btn": "BACK TO THE LAST SITE", "history-btn": "View the dispatcher history", "info-btn": "Return to the scenery view", "authors-title": "Scenery author | Scenery authors", @@ -589,15 +589,16 @@ "terminated": "Timetable terminated", "begins": "BEGINS HERE", "terminates": "TERMINATES\nHERE", - "from": "FROM", - "to": "TO", - "desc-arriving": "The train is not here yet.\nIt's going to come from: {prevStationName} (route {prevDepartureLine})", - "desc-online": "The train is at the station.\nIt's going to leave to: {nextStationName} (route {nextArrivalLine})", - "desc-stopped": "The train is at the station and is stopped.\nIt's going to leave towards: {nextStationName} (route {nextArrivalLine})", - "desc-next-arrival": "Leaves towards: {nextStationName} (route {nextArrivalLine})", - "desc-departed": "The train is at the station and it's been departed.\nLeaves towards: {nextStationName} (route {nextArrivalLine})", - "desc-departed-ends": "The train is at the station and it's been departed.\nLeaves towards station: {nextStationName}", - "desc-departed-away": "The train has been departed to:\n{nextStationName} (route {nextArrivalLine})", + "from": "Arrives from", + "to": "Departs to", + "desc-beginning": "The train begins here", + "desc-arriving": "Arrives from: {prevStationName} ({prevDepartureLine})", + "desc-online": "On scenery / direction: {nextStationName} ({nextArrivalLine})", + "desc-stopped": "On scenery - stopped / direction: {nextStationName} ({nextArrivalLine})", + "desc-next-arrival": "On scenery / direction: {nextStationName} ({nextArrivalLine})", + "desc-departed": "On scenery / departed to: {nextStationName} ({nextArrivalLine})", + "desc-departed-ends": "On scenery / departed to: {nextStationName}", + "desc-departed-away": "Departed to: {nextStationName} ({nextArrivalLine})", "desc-end": "The train terminates here", "desc-terminated": "The train has been terminated" }, diff --git a/src/locales/pl.json b/src/locales/pl.json index b60238f..b4b6774 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -529,7 +529,7 @@ "no-users": "BRAK AKTYWNYCH GRACZY", "no-spawns": "BRAK OTWARTYCH SPAWNÓW", "no-scenery": "Ups! Ta sceneria nie istnieje!", - "return-btn": "Powrót", + "return-btn": "POWRÓT DO POPRZEDNIEJ STRONY", "history-btn": "Przejdź do widoku historii dyżurnych ruchu", "info-btn": "Wróć do widoku scenerii", "authors-title": "Autor scenerii | Autorzy scenerii", @@ -575,17 +575,18 @@ "terminated": "Rozkład jazdy zakończony", "begins": "ROZPOCZYNA\nBIEG", "terminates": "KOŃCZY BIEG", - "from": "Z", - "to": "DO", - "desc-arriving": "Pociągu nie ma jeszcze na tej scenerii.\nPrzyjedzie z: {prevStationName} (szlak {prevDepartureLine})", - "desc-online": "Pociąg jest na tej scenerii.\nOdjedzie w kierunku: {nextStationName} (szlak {nextArrivalLine})", - "desc-stopped": "Pociąg jest na tej scenerii i odbywa postój.\nOdjedzie w kierunku: {nextStationName} (szlak {nextArrivalLine})", - "desc-next-arrival": "Odjeżdża do:\n{nextStationName} (szlak {nextArrivalLine})", - "desc-departed": "Pociąg jest na tej scenerii i został odprawiony.\nOdjeżdża w kierunku: {nextStationName} (szlak {nextArrivalLine})", - "desc-departed-ends": "Pociąg jest na tej scenerii i został odprawiony.\nOdjechał w kierunku stacji: {nextStationName}", - "desc-departed-away": "Pociąg został odprawiony i odjechał do:\n{nextStationName} (szlak {nextArrivalLine})", + "from": "Przyjedzie z", + "to": "Odjeżdża do", + "desc-beginning": "Pociąg rozpoczyna bieg", + "desc-arriving": "Przyjedzie z: {prevStationName} ({prevDepartureLine})", + "desc-online": "Na scenerii / kierunek: {nextStationName} ({nextArrivalLine})", + "desc-stopped": "Na scenerii - postój / kierunek: {nextStationName} ({nextArrivalLine})", + "desc-next-arrival": "Na scenerii / kierunek: {nextStationName} ({nextArrivalLine})", + "desc-departed": "Na scenerii / odprawiony do: {nextStationName} ({nextArrivalLine})", + "desc-departed-ends": "Na scenerii / odprawiony do: {nextStationName}", + "desc-departed-away": "Odprawiony do: {nextStationName} ({nextArrivalLine})", "desc-end": "Pociąg kończy bieg", - "desc-terminated": "Pociąg skończył bieg" + "desc-terminated": "Pociąg zakończył bieg" }, "history": { "title": "DZIENNIK ROZKŁADÓW JAZDY" diff --git a/src/styles/_global.scss b/src/styles/_global.scss index 6e94677..a9a2d64 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -297,48 +297,6 @@ a.a-button { } } -.return-btn { - display: none; - justify-content: center; - align-items: center; - - position: fixed; - right: 2.5rem; - bottom: 4rem; - - z-index: 100; - - width: 3.5rem; - - font-size: 3rem; - - background-color: #555; - outline: 3px solid #222; - color: white; - - border-radius: 50%; - cursor: pointer; - - &:hover { - background-color: #3c3c3c; - } - - img { - width: 1.3em; - } - - @include responsive.smallScreen { - bottom: 1em; - right: 0; - left: 50%; - - width: 1em; - height: 1em; - - transform: translateX(-50%); - } -} - // Basic tooltip [data-tooltip] { cursor: help; diff --git a/src/typings/common.ts b/src/typings/common.ts index e2004fa..cc48644 100644 --- a/src/typings/common.ts +++ b/src/typings/common.ts @@ -142,6 +142,7 @@ export interface StationRoutesInfo { isRouteSBL: boolean; routeLength: number; routeSpeed: number; + routeSpeedExit?: number; routeTracks: number; hidden?: boolean; realLineNo?: number; diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index 32d5140..c4cef30 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -2,12 +2,6 @@
-
- -
- { - prevPath.value = (route.meta['prevPath'] as string) ?? '/'; -}); - const currentMode = computed(() => { return route.query.view?.toString() ?? 'SceneryTimetable'; }); @@ -139,21 +126,11 @@ function setViewMode(componentName: string) { } }); } - -function onReturnButtonClick() { - router.push(prevPath.value); -}