diff --git a/package.json b/package.json index 69fd0eb8..ded12cd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-dos", - "version": "8.1.20", + "version": "8.2.0", "description": "Full-featured DOS player with multiple emulator backends", "type": "module", "keywords": [ diff --git a/src/i18n.ts b/src/i18n.ts index 7bbe0981..0219e7c3 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -64,8 +64,8 @@ const translations: {[lang: string]: {[key: string]: string} } = { account_not_ready: "Пропустить загрузку сохранений", loading_saves: "Загрузка сохранений", success: "Успешно", - success_save: "Сохранено", - warn_save: "Вы не вошли в аккаунт, сохранено в браузере", + success_save: "Сохранено в облаке", + warn_save: "Cохранено в браузере (вы не вошли)", unable_to_save: "Ошибка записи", not_premium: "Подключить подписку", copy_net_link: "Отправьте ссылку на подключение", @@ -147,8 +147,8 @@ const translations: {[lang: string]: {[key: string]: string} } = { account_not_ready: "Skip loading saves", loading_saves: "Loading saves", success: "Success", - success_save: "Saved", - warn_save: "You are not logged, saved in browser", + success_save: "Saved in cloud", + warn_save: "Saved in browser (you are not logged)", unable_to_save: "Unable to save", not_premium: "Subscribe", copy_net_link: "Share this link to connect", diff --git a/src/main.tsx b/src/main.tsx index 4cd5e0e0..e12849b0 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -330,6 +330,14 @@ function setupRootElement(root: HTMLDivElement, nonSerializableStore: NonSeriali document.addEventListener("fullscreenchange", () => { const fullscreen = document.fullscreenElement === root; store.dispatch(uiSlice.actions.setFullScreen(fullscreen)); + if (!fullscreen) { + apiSave(store.getState() as any, nonSerializableStore, store.dispatch); + } + }); + document.addEventListener("pointerlockchange", () => { + if (document.pointerLockElement === null) { + apiSave(store.getState() as any, nonSerializableStore, store.dispatch); + } }); function listen() { store.dispatch(uiSlice.actions.documentHidden(document.hidden)); diff --git a/src/sidebar/sidebar.tsx b/src/sidebar/sidebar.tsx index c3c510f2..3ba83f25 100644 --- a/src/sidebar/sidebar.tsx +++ b/src/sidebar/sidebar.tsx @@ -18,7 +18,6 @@ export function SideBar(props: {}) { const kiosk = useSelector((state: State) => state.ui.kiosk); const networking = !useSelector((state: State) => state.ui.noNetworking); const cloud = !useSelector((state: State) => state.ui.noCloud); - const mobileControls = useSelector((state: State) => state.dos.mobileControls); if (kiosk) { return null; @@ -26,7 +25,7 @@ export function SideBar(props: {}) { return