Merge pull request #124 from Spythere/development

v1.29.0 hotfixes
This commit is contained in:
Spythere
2025-02-13 18:39:53 +01:00
committed by GitHub
9 changed files with 128 additions and 77 deletions
@@ -130,7 +130,7 @@
<span class="schedule-stop"> <span class="schedule-stop">
<span class="stop-connection"> <span class="stop-connection">
{{ row.arrivingLine }} {{ row.currentElement.arrivalRouteExt }}
</span> </span>
<span class="stop-time"> <span class="stop-time">
@@ -139,7 +139,7 @@
</span> </span>
<span class="stop-connection"> <span class="stop-connection">
{{ row.departureLine }} {{ row.currentElement.departureRouteExt }}
</span> </span>
</span> </span>
@@ -279,12 +279,9 @@ export default defineComponent({
return { return {
checkpointStop: ct.checkpointStop, checkpointStop: ct.checkpointStop,
train: ct.train, train: ct.train,
prevDepartureLine: ct.previousSceneryElement?.departureRouteExt ?? null, prevElement: ct.previousSceneryElement,
nextArrivalLine: ct.nextSceneryElement?.arrivalRouteExt ?? null, nextElement: ct.nextSceneryElement,
departureLine: ct.timetablePathElement.departureRouteExt ?? null, currentElement: ct.timetablePathElement,
arrivingLine: ct.timetablePathElement.arrivalRouteExt ?? null,
prevStationName: ct.previousSceneryElement?.stationName ?? null,
nextStationName: ct.nextSceneryElement?.stationName ?? null,
status: trainStopStatus status: trainStopStatus
}; };
}) })
@@ -2,7 +2,9 @@
<div class="general-status"> <div class="general-status">
<span <span
:class="computedScheduledTrain.status" :class="computedScheduledTrain.status"
:title="computedScheduledTrain.stopStatusDescription" data-tooltip-type="HtmlTooltip"
:data-tooltip-content="computedScheduledTrain.stopStatusDescription"
@click.prevent="() => {}"
> >
{{ computedScheduledTrain.stopStatusIndicator }} {{ computedScheduledTrain.stopStatusIndicator }}
</span> </span>
@@ -24,16 +26,16 @@ export default defineComponent({
computed: { computed: {
computedScheduledTrain() { computedScheduledTrain() {
const { prevDepartureLine, prevStationName, nextArrivalLine, nextStationName, status } = const { status, prevElement, currentElement, nextElement } = this.sceneryTimetableRow;
this.sceneryTimetableRow;
const prevDepartureIndicator = prevDepartureLine const prevDepartureIndicator = prevElement?.departureRouteExt
? `(${prevDepartureLine}) ${prevStationName}` ? `(${prevElement.departureRouteExt}) ${prevElement.stationName}`
: '---';
const nextArrivalIndicator = nextArrivalLine
? `(${nextArrivalLine}) ${nextStationName}`
: '---'; : '---';
const nextArrivalIndicator = nextElement?.arrivalRouteExt
? `(${nextElement.arrivalRouteExt}) ${nextElement.stationName}`
: `${currentElement.stationName}`;
let stopStatusDescription = '', let stopStatusDescription = '',
stopStatusIndicator = ''; stopStatusIndicator = '';
@@ -41,34 +43,45 @@ export default defineComponent({
case StopStatus.ARRIVING: case StopStatus.ARRIVING:
stopStatusIndicator = `${this.$t('timetables.from')}: ${prevDepartureIndicator}`; stopStatusIndicator = `${this.$t('timetables.from')}: ${prevDepartureIndicator}`;
stopStatusDescription = this.$t('timetables.desc-arriving', { stopStatusDescription = this.$t('timetables.desc-arriving', {
prevStationName, prevStationName: prevElement?.stationName ?? '',
prevDepartureLine prevDepartureLine: prevElement?.departureRouteExt ?? ''
}); });
break; break;
case StopStatus.ONLINE: case StopStatus.ONLINE:
case StopStatus.STOPPED: case StopStatus.STOPPED:
stopStatusIndicator = nextArrivalLine stopStatusIndicator = nextElement?.arrivalRouteExt
? `${this.$t('timetables.to')}: ${nextArrivalIndicator}` ? `${this.$t('timetables.to')}: ${nextArrivalIndicator}`
: `${this.$t('timetables.desc-end')}`; : `${this.$t('timetables.desc-end')}`;
stopStatusDescription = nextArrivalLine stopStatusDescription = nextElement?.arrivalRouteExt
? this.$t(`timetables.desc-${status}`, { nextStationName, nextArrivalLine }) ? this.$t(`timetables.desc-${status}`, {
nextStationName: nextElement?.stationName,
nextArrivalLine: nextElement?.arrivalRouteExt
})
: ''; : '';
break; break;
case StopStatus.DEPARTED: case StopStatus.DEPARTED:
stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`; stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`;
stopStatusDescription = this.$t('timetables.desc-departed', {
nextStationName, if (!nextElement?.stationName) {
nextArrivalLine stopStatusDescription = this.$t('timetables.desc-departed-ends', {
}); nextStationName: currentElement.stationName
});
} else {
stopStatusDescription = this.$t('timetables.desc-departed', {
nextStationName: nextElement?.stationName ?? currentElement.stationName,
nextArrivalLine: nextElement?.arrivalRouteExt
});
}
break; break;
case StopStatus.DEPARTED_AWAY: case StopStatus.DEPARTED_AWAY:
stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`; stopStatusIndicator = `${this.$t('timetables.to')}: ${nextArrivalIndicator}`;
stopStatusDescription = this.$t('timetables.desc-departed-away', { stopStatusDescription = this.$t('timetables.desc-departed-away', {
nextStationName, nextStationName: nextElement?.stationName,
nextArrivalLine nextArrivalLine: nextElement?.arrivalRouteExt
}); });
break; break;
@@ -93,6 +106,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.general-status { .general-status {
margin-top: 0.5em; margin-top: 0.5em;
cursor: help;
span.arriving { span.arriving {
color: #ccc; color: #ccc;
+4 -7
View File
@@ -1,13 +1,10 @@
import { StopStatus, Train, TrainStop } from '../../typings/common'; import { StopStatus, TimetablePathElement, Train, TrainStop } from '../../typings/common';
export interface SceneryTimetableRow { export interface SceneryTimetableRow {
checkpointStop: TrainStop; checkpointStop: TrainStop;
train: Train; train: Train;
prevDepartureLine: string | null; prevElement: TimetablePathElement | null;
nextArrivalLine: string | null; nextElement: TimetablePathElement | null;
departureLine: string | null; currentElement: TimetablePathElement;
arrivingLine: string | null;
prevStationName: string | null;
nextStationName: string | null;
status: StopStatus; status: StopStatus;
} }
+39
View File
@@ -0,0 +1,39 @@
<template>
<div class="tooltip-content">
<span v-html="tooltipStore.content"></span>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { useTooltipStore } from '../../store/tooltipStore';
export default defineComponent({
data() {
return {
tooltipStore: useTooltipStore()
};
}
});
</script>
<style lang="scss" scoped>
.tooltip-content {
display: flex;
justify-content: center;
align-items: center;
gap: 0.5em;
white-space: pre-line;
padding: 0.25em 0.5em;
border-radius: 0.25em;
width: 100%;
background-color: #1f1f1f;
box-shadow: 0 0 5px 2px #aaa;
}
img {
height: 1em;
}
</style>
+9 -1
View File
@@ -12,11 +12,19 @@ import VehiclePreviewTooltip from './VehiclePreviewTooltip.vue';
import BaseTooltip from './BaseTooltip.vue'; import BaseTooltip from './BaseTooltip.vue';
import SpawnsTooltip from './SpawnsTooltip.vue'; import SpawnsTooltip from './SpawnsTooltip.vue';
import UsersTooltip from './UsersTooltip.vue'; import UsersTooltip from './UsersTooltip.vue';
import HtmlTooltip from './HtmlTooltip.vue';
const BOX_PADDING_PX = 20; const BOX_PADDING_PX = 20;
export default defineComponent({ export default defineComponent({
components: { DonatorTooltip, VehiclePreviewTooltip, BaseTooltip, SpawnsTooltip, UsersTooltip }, components: {
DonatorTooltip,
VehiclePreviewTooltip,
BaseTooltip,
SpawnsTooltip,
UsersTooltip,
HtmlTooltip
},
data() { data() {
return { return {
+22 -29
View File
@@ -3,11 +3,11 @@
<div class="schedule-wrapper" v-if="train.timetableData"> <div class="schedule-wrapper" v-if="train.timetableData">
<div class="stops"> <div class="stops">
<div <div
v-for="(stop, i) in scheduleStopsV2" v-for="(stop, i) in scheduleStops"
:key="i" :key="i"
class="stop" class="stop"
:data-status="stop.status" :data-status="stop.status"
:data-sbl="stop.isSBL && stop.sceneryName == scheduleStopsV2[i + 1]?.sceneryName" :data-sbl="stop.isSBL && stop.sceneryName == scheduleStops[i + 1]?.sceneryName"
:data-position="stop.position" :data-position="stop.position"
:data-delayed="stop.departureDelay > 0" :data-delayed="stop.departureDelay > 0"
:data-stop-type="stop.type" :data-stop-type="stop.type"
@@ -34,7 +34,7 @@
<div></div> <div></div>
<div class="progress"> <div class="progress">
<div class="line line_connection" v-if="i < scheduleStopsV2.length - 1"></div> <div class="line line_connection" v-if="i < scheduleStops.length - 1"></div>
</div> </div>
<div class="bottom-line-info"> <div class="bottom-line-info">
@@ -48,9 +48,9 @@
<span <span
v-if=" v-if="
stop.departureLine && stop.departureLine &&
(scheduleStopsV2[i + 1]?.arrivalLineInfo?.routeSpeed != (scheduleStops[i + 1]?.arrivalLineInfo?.routeSpeed !=
stop.arrivalLineInfo?.routeSpeed || stop.arrivalLineInfo?.routeSpeed ||
stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName) stop.sceneryName != scheduleStops[i + 1]?.sceneryName)
" "
> >
<div class="scenery-route"> <div class="scenery-route">
@@ -85,13 +85,13 @@
</div> </div>
<div <div
v-if="stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName" v-if="stop.sceneryName != scheduleStops[i + 1]?.sceneryName"
class="scenery-change-name" class="scenery-change-name"
> >
<span>{{ scheduleStopsV2[i + 1].sceneryName }}</span> <span>{{ scheduleStops[i + 1].sceneryName }}</span>
<i <i
v-if="!scheduleStopsV2[i + 1].isSceneryOnline" v-if="!scheduleStops[i + 1].isSceneryOnline"
class="fa-solid fa-ban fa-sm" class="fa-solid fa-ban fa-sm"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('app.tooltip-scenery-offline')" :data-tooltip-content="$t('app.tooltip-scenery-offline')"
@@ -101,30 +101,30 @@
<div <div
class="scenery-route" class="scenery-route"
v-if="stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName" v-if="stop.sceneryName != scheduleStops[i + 1]?.sceneryName"
> >
<span> {{ scheduleStopsV2[i + 1].arrivalLine }}</span> <span> {{ scheduleStops[i + 1].arrivalLine }}</span>
<span v-if="scheduleStopsV2[i + 1].arrivalLineInfo"> <span v-if="scheduleStops[i + 1].arrivalLineInfo">
<span> | {{ scheduleStopsV2[i + 1].arrivalLineInfo!.routeSpeed }} </span> <span> | {{ scheduleStops[i + 1].arrivalLineInfo!.routeSpeed }} </span>
<img <img
:src=" :src="
scheduleStopsV2[i + 1].arrivalLineInfo?.isElectric scheduleStops[i + 1].arrivalLineInfo?.isElectric
? '/images/icon-catenary.svg' ? '/images/icon-catenary.svg'
: '/images/icon-we4a.png' : '/images/icon-we4a.png'
" "
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content=" :data-tooltip-content="
$t( $t(
`trains.${!scheduleStopsV2[i + 1].arrivalLineInfo?.isElectric ? 'no-' : ''}catenary-tooltip` `trains.${!scheduleStops[i + 1].arrivalLineInfo?.isElectric ? 'no-' : ''}catenary-tooltip`
) )
" "
width="14" width="14"
/> />
<img <img
v-if="scheduleStopsV2[i + 1].arrivalLineInfo!.isRouteSBL" v-if="scheduleStops[i + 1].arrivalLineInfo!.isRouteSBL"
src="/images/icon-sbl-transparent.svg" src="/images/icon-sbl-transparent.svg"
width="14" width="14"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
@@ -206,7 +206,7 @@ export default defineComponent({
}, },
computed: { computed: {
scheduleStopsV2() { scheduleStops() {
if (!this.train.timetableData) return []; if (!this.train.timetableData) return [];
const { timetablePath, followingStops } = this.train.timetableData; const { timetablePath, followingStops } = this.train.timetableData;
@@ -224,20 +224,18 @@ export default defineComponent({
let isActive = false; let isActive = false;
if (pathData?.departureLineData) { if (pathData?.departureLineData) {
arrivalLineInfo = pathData.departureLineData; // arrivalLineInfo = pathData.departureLineData;
departureLineInfo = pathData.departureLineData; departureLineInfo = pathData.departureLineData;
} }
for (const stop of followingStops) { for (const stop of followingStops) {
let isExternal = false; let isExternal = false;
if ( if (stop.arrivalLine === currentPath.arrivalRouteExt) {
stop.arrivalLine &&
currentPath.arrivalRouteExt &&
stop.arrivalLine == currentPath.arrivalRouteExt
) {
isExternal = true; isExternal = true;
departureLineInfo = pathData?.arrivalLineData ?? null;
if (pathData?.arrivalLineData) { if (pathData?.arrivalLineData) {
arrivalLineInfo = pathData.arrivalLineData; arrivalLineInfo = pathData.arrivalLineData;
} }
@@ -282,8 +280,7 @@ export default defineComponent({
departureLineInfo, departureLineInfo,
isExternal, isExternal,
isActive,
isActive: isActive,
isSBL: /sbl/gi.test(stop.stopName), isSBL: /sbl/gi.test(stop.stopName),
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route', position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
@@ -312,11 +309,7 @@ export default defineComponent({
stopRows.push(rowData); stopRows.push(rowData);
if ( if (stop.departureLine === currentPath.departureRouteExt) {
stop.departureLine &&
currentPath.departureRouteExt &&
stop.departureLine == currentPath.departureRouteExt
) {
// Reverse search for last scenery checkpoint // Reverse search for last scenery checkpoint
if (pathData?.departureLineData) { if (pathData?.departureLineData) {
stopRows[stopRows.length - 1].isExternal = true; stopRows[stopRows.length - 1].isExternal = true;
+7 -6
View File
@@ -543,12 +543,13 @@
"terminates": "TERMINATES\nHERE", "terminates": "TERMINATES\nHERE",
"from": "FROM", "from": "FROM",
"to": "TO", "to": "TO",
"desc-arriving": "The train is not here yet. It's going to come from: {prevStationName} (szlak {prevDepartureLine})", "desc-arriving": "The train is not here yet.\nIt's going to come from: <b>{prevStationName} (route {prevDepartureLine})</b>",
"desc-online": "The train is at the station. It's going to leave to: {nextStationName} (szlak {nextArrivalLine})", "desc-online": "The train is at the station.\nIt's going to leave to: <b>{nextStationName} (route {nextArrivalLine})</b>",
"desc-stopped": "The train is at the station and is stopped. It's going to leave towards: {nextStationName} (szlak {nextArrivalLine})", "desc-stopped": "The train is at the station and is stopped.\nIt's going to leave towards: <b>{nextStationName} (route {nextArrivalLine})</b>",
"desc-next-arrival": "Leaves towards: {nextStationName} (szlak {nextArrivalLine})", "desc-next-arrival": "Leaves towards: <b>{nextStationName} (route {nextArrivalLine})</b>",
"desc-departed": "The train is at the station and it's been departed. Leaves towards: {nextStationName} (szlak {nextArrivalLine})", "desc-departed": "The train is at the station and it's been departed.\nLeaves towards: <b>{nextStationName} (route {nextArrivalLine})</b>",
"desc-departed-away": "The train has been departed to: {nextStationName} (szlak {nextArrivalLine})", "desc-departed-ends": "The train is at the station and it's been departed.\nLeaves towards station: <b>{nextStationName}</b>",
"desc-departed-away": "The train has been departed to:\n<b>{nextStationName} (route {nextArrivalLine})</b>",
"desc-end": "The train terminates here", "desc-end": "The train terminates here",
"desc-terminated": "The train has been terminated" "desc-terminated": "The train has been terminated"
}, },
+7 -6
View File
@@ -529,12 +529,13 @@
"terminates": "KOŃCZY BIEG", "terminates": "KOŃCZY BIEG",
"from": "Z", "from": "Z",
"to": "DO", "to": "DO",
"desc-arriving": "Pociągu nie ma jeszcze na tej scenerii. Przyjedzie z: {prevStationName} (szlak {prevDepartureLine})", "desc-arriving": "Pociągu nie ma jeszcze na tej scenerii.\nPrzyjedzie z: <b>{prevStationName} (szlak {prevDepartureLine})</b>",
"desc-online": "Pociąg jest na tej scenerii. Odjedzie do: {nextStationName} (szlak {nextArrivalLine})", "desc-online": "Pociąg jest na tej scenerii.\nOdjedzie w kierunku: <b>{nextStationName} (szlak {nextArrivalLine})</b>",
"desc-stopped": "Pociąg jest na tej scenerii i odbywa postój. Odjedzie do: {nextStationName} (szlak {nextArrivalLine})", "desc-stopped": "Pociąg jest na tej scenerii i odbywa postój.\nOdjedzie w kierunku: <b>{nextStationName} (szlak {nextArrivalLine})</b>",
"desc-next-arrival": "Odjeżdża do: {nextStationName} (szlak {nextArrivalLine})", "desc-next-arrival": "Odjeżdża do:\n<b>{nextStationName} (szlak {nextArrivalLine})</b>",
"desc-departed": "Pociąg jest na tej scenerii i został odprawiony. Odjeżdża do: {nextStationName} (szlak {nextArrivalLine})", "desc-departed": "Pociąg jest na tej scenerii i został odprawiony.\nOdjeżdża w kierunku: <b>{nextStationName} (szlak {nextArrivalLine})</b>",
"desc-departed-away": "Pociąg został odprawiony i odjechał do: {nextStationName} (szlak {nextArrivalLine})", "desc-departed-ends": "Pociąg jest na tej scenerii i został odprawiony.\nOdjechał w kierunku stacji: <b>{nextStationName}</b>",
"desc-departed-away": "Pociąg został odprawiony i odjechał do:\n<b>{nextStationName} (szlak {nextArrivalLine})</b>",
"desc-end": "Pociąg kończy bieg", "desc-end": "Pociąg kończy bieg",
"desc-terminated": "Pociąg skończył bieg" "desc-terminated": "Pociąg skończył bieg"
}, },
+2 -1
View File
@@ -7,7 +7,8 @@ export const tooltipKeys = [
'BaseTooltip', 'BaseTooltip',
'VehiclePreviewTooltip', 'VehiclePreviewTooltip',
'SpawnsTooltip', 'SpawnsTooltip',
'UsersTooltip' 'UsersTooltip',
'HtmlTooltip'
] as const; ] as const;
export type TooltipType = (typeof tooltipKeys)[number]; export type TooltipType = (typeof tooltipKeys)[number];