diff --git a/package.json b/package.json
index 670190a..de02770 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stacjownik",
- "version": "1.23.0",
+ "version": "1.23.1",
"private": true,
"scripts": {
"dev": "vite",
diff --git a/src/App.vue b/src/App.vue
index 2b80633..4ff42c9 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,7 +4,7 @@
-
+
@@ -34,11 +34,12 @@
@@ -49,23 +55,6 @@ export default defineComponent({
}
}
-.exit {
- position: absolute;
- top: 0;
- right: 0;
-
- margin: 0.5em 1em;
-
- padding: 0.25em;
-
- z-index: 201;
-
- img {
- width: 1.5rem;
- vertical-align: middle;
- }
-}
-
.train-modal {
position: fixed;
top: 0;
diff --git a/src/locales/en.json b/src/locales/en.json
index 9e71137..a9470b3 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -26,6 +26,13 @@
"TWR": "High risk freight train",
"SKR": "Train with exceeded gauge"
},
+ "update": {
+ "title": "Stacjownik app update!",
+ "version": "Version {0}",
+ "confirm-button": "UPDATE NOW",
+ "later-button": "LATER",
+ "content": "context tooltips when hovering over project sponsors and timetable comment warnings\nvehicle image preview when hovering over its thumbnail in the active timetable card view and timetable journal\nlink to the driver's timetable history in the active timetable card view\nlink to the driver's active timetable card view in the timetable journal (available for online trains only)\nnew update card with version changelog"
+ },
"app": {
"sceneries": "SCENERIES",
"trains": "TRAINS",
@@ -41,13 +48,7 @@
"footer": {
"discord": "Stacjownik Discord server"
},
- "update": {
- "title": "New version of the app is available!",
- "paragraph1": "Enjoy the application and may the green signal be with you!",
- "release-link": "Click here to browse version changelog (GitHub)",
- "confirm-button": "UPDATE NOW",
- "later-button": "LATER"
- },
+
"vehicle-preview": {
"loading": "Loading preview...",
"error": "Oops! The vehicle preview seems to be missing! :/"
diff --git a/src/locales/pl.json b/src/locales/pl.json
index f0e0aff..ec0940c 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -4,7 +4,7 @@
"header": "Grosza daj Stacjownikowi!",
"donator-title": "Projekt ma już ponad {count} wspierających, w tym:",
"p1": "Hej o7! Z tej strony Spythere, twórca Stacjownika, Pojazdownika oraz kilku innych aplikacji wspomagających rozgrywkę symulatora Train Driver 2!",
- "p2": "{b1} to narzędzie całkowicie darmowe, tworzone i rozwijane dla społeczności symulatora TD2 nieprzerwanie od 2020 roku. Jednakże, część projektu jest podtrzymywana wyłącznie dzięki mojemu prywatnemu wkładowi finansowemu. Funkcje takie jak {b2} czy też {b3} działający na moim {link} (na który serdeczne zapraszam) muszą działać na wydzielonym serwerze, gdzie będą mogły zbierać i przetwarzać dane, aby następnie pokazać je na stronie.",
+ "p2": "{b1} to narzędzie całkowicie darmowe, tworzone i rozwijane dla społeczności symulatora TD2 nieprzerwanie od 2020 roku. Jednakże, część projektu jest podtrzymywana wyłącznie dzięki mojemu prywatnemu wkładowi finansowemu. Funkcje takie jak {b2} czy też {b3} działający na moim {link} (na który serdecznie zapraszam) muszą działać na wydzielonym serwerze, gdzie będą mogły zbierać i przetwarzać dane, aby następnie pokazać je na stronie.",
"p2-b1": "Stacjownik",
"p2-b2": "Dziennik",
"p2-b3": "Stacjobot",
@@ -26,6 +26,13 @@
"TWR": "Towar niebezpieczny wysokiego ryzyka",
"SKR": "Przekroczona skrajnia"
},
+ "update": {
+ "title": "Aktualizacja Stacjownika!",
+ "version": "Wersja {0}",
+ "confirm-button": "UPDATE NOW",
+ "later-button": "LATER",
+ "content": "dymki kontekstowe po najechaniu kursorem na m.in. sponsorów projektu i uwagi eksploatacyjne\npodgląd pojazdu po najechaniu kursorem na jego miniaturkę w karcie aktywnego rozkładu jazdy oraz dzienniku RJ\nodnośnik do historii RJ maszynisty w widoku karty aktywnego rozkładu jazdy\nodnośnik do karty aktywnego rozkładu jazdy maszynisty w dzienniku (dostępny tylko dla pociągów online)\nnowa karta ze zmianami w aktualizacji"
+ },
"app": {
"sceneries": "SCENERIE",
"trains": "POCIĄGI",
diff --git a/src/mixins/modalTrainMixin.ts b/src/mixins/modalTrainMixin.ts
index 8e704d4..0935a76 100644
--- a/src/mixins/modalTrainMixin.ts
+++ b/src/mixins/modalTrainMixin.ts
@@ -1,21 +1,13 @@
import { defineComponent } from 'vue';
import { useMainStore } from '../store/mainStore';
-import { usePopupStore } from '../store/popupStore';
export default defineComponent({
data() {
return {
- store: useMainStore(),
- popupStore: usePopupStore()
+ store: useMainStore()
};
},
- computed: {
- chosenTrain() {
- return this.store.trainList.find((train) => train.trainId == this.store.chosenModalTrainId);
- }
- },
-
methods: {
selectModalTrain(trainId: string, target?: EventTarget | null) {
this.store.chosenModalTrainId = trainId;
@@ -25,7 +17,7 @@ export default defineComponent({
closeModal() {
this.store.chosenModalTrainId = undefined;
- this.popupStore.currentPopupComponent = null;
+ this.store.popUpData.key = null;
setTimeout(() => {
(this.store.modalLastClickedTarget as any)?.focus();
diff --git a/src/mixins/popupMixin.ts b/src/mixins/popupMixin.ts
new file mode 100644
index 0000000..8a16b65
--- /dev/null
+++ b/src/mixins/popupMixin.ts
@@ -0,0 +1,27 @@
+import { defineComponent } from 'vue';
+import { useMainStore } from '../store/mainStore';
+import { PopUpType, popupKeys } from '../store/typings';
+
+const isPopUp = (v: any): v is PopUpType => popupKeys.includes(v);
+
+export default defineComponent({
+ data() {
+ return {
+ store: useMainStore()
+ };
+ },
+
+ methods: {
+ showPopUp(e: MouseEvent, componentKey: string, value?: string) {
+ if (!isPopUp(componentKey)) return;
+
+ this.store.popUpData['key'] = componentKey;
+ this.store.popUpData['content'] = value ?? '';
+ },
+
+ hidePopUp() {
+ this.store.popUpData['key'] = null;
+ this.store.popUpData['content'] = '';
+ }
+ }
+});
diff --git a/src/store/apiStore.ts b/src/store/apiStore.ts
index 1fa0166..1749f5e 100644
--- a/src/store/apiStore.ts
+++ b/src/store/apiStore.ts
@@ -4,9 +4,6 @@ import { Status } from '../typings/common';
import { StationJSONData } from './typings';
import axios, { AxiosInstance } from 'axios';
-// Update seconds cron for active data scheduler
-const UPDATE_SECONDS = [3, 23, 43];
-
export enum APIMode {
PRODUCTION = 0,
DEV = 1,
diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts
index 1170700..a6e13c8 100644
--- a/src/store/mainStore.ts
+++ b/src/store/mainStore.ts
@@ -26,8 +26,10 @@ export const useMainStore = defineStore('store', {
chosenModalTrainId: undefined,
- blockScroll: false,
- modalLastClickedTarget: null
+ modalLastClickedTarget: null,
+
+ mousePos: { x: 0, y: 0 },
+ popUpData: { key: null, content: '' }
}) as StoreState,
getters: {
@@ -45,7 +47,8 @@ export const useMainStore = defineStore('store', {
const sceneryNames =
train.timetable?.sceneries?.map(
(sceneryHash) =>
- this.activeSceneryList.find((st) => st.hash === sceneryHash)?.name ??
+ apiStore.activeData?.activeSceneries?.find((st) => st.stationHash === sceneryHash)
+ ?.stationName ??
apiStore.sceneryData.find((sd) => sd.hash === sceneryHash)?.name ??
sceneryHash
) ?? [];
diff --git a/src/store/popupStore.ts b/src/store/popupStore.ts
deleted file mode 100644
index 5af0ae9..0000000
--- a/src/store/popupStore.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { defineStore } from 'pinia';
-
-export const popupKeys = ['DonatorPopUp', 'TrainCommentsPopUp', 'VehiclePreviewPopUp'] as const;
-export type PopUp = (typeof popupKeys)[number];
-
-const isPopUp = (v: any): v is PopUp => popupKeys.includes(v);
-
-export const usePopupStore = defineStore('popupStore', {
- state: () => ({
- popupPosition: { x: 0, y: 0 },
- currentPopupComponent: null as PopUp | null,
- currentPopupContent: '',
- donatorPopupVisible: false
- }),
-
- actions: {
- onPopUpShow(e: MouseEvent, componentKey: string, value?: string) {
- if (!isPopUp(componentKey)) return;
-
- this.popupPosition.x = e.pageX;
- this.popupPosition.y = e.pageY;
-
- this.currentPopupComponent = componentKey;
- this.currentPopupContent = value ?? '';
- },
-
- onPopUpMove(e: MouseEvent) {
- this.popupPosition.x = e.pageX;
- this.popupPosition.y = e.pageY;
- },
-
- onPopUpHide() {
- this.currentPopupComponent = null;
- this.currentPopupContent = '';
- }
- }
-});
diff --git a/src/store/typings.ts b/src/store/typings.ts
index d9ed6d1..27f5605 100644
--- a/src/store/typings.ts
+++ b/src/store/typings.ts
@@ -1,7 +1,9 @@
import { API } from '../typings/api';
import { Status } from '../typings/common';
+export const popupKeys = ['DonatorPopUp', 'TrainCommentsPopUp', 'VehiclePreviewPopUp'] as const;
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
+export type PopUpType = (typeof popupKeys)[number];
export interface RegionCounters {
stationCount: number;
@@ -19,8 +21,9 @@ export interface StoreState {
driverStatsData?: API.DriverStats.Response;
driverStatsStatus: Status.Data;
chosenModalTrainId?: string;
- blockScroll: boolean;
modalLastClickedTarget: EventTarget | null;
+ mousePos: { x: number; y: number };
+ popUpData: { key: PopUpType | null; content: string };
}
export interface StationRoutesInfo {
diff --git a/src/styles/JournalSection.scss b/src/styles/JournalSection.scss
index 504cf1f..a37fed7 100644
--- a/src/styles/JournalSection.scss
+++ b/src/styles/JournalSection.scss
@@ -6,6 +6,7 @@
height: 90vh;
min-height: 550px;
margin-top: 0.5em;
+ position: relative;
padding-right: 0.2em;
}
diff --git a/src/styles/global.scss b/src/styles/global.scss
index b6b873c..8d1fd59 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -55,6 +55,8 @@ body {
-webkit-font-smoothing: antialiased !important;
overflow-y: scroll;
+ overflow-x: hidden;
+ position: relative;
&.no-scroll {
overflow-y: hidden;