Skip to content

Commit

Permalink
Autosave && soft keyboard button
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Sep 5, 2024
1 parent c3fd5d6 commit e309896
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
8 changes: 4 additions & 4 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "Отправьте ссылку на подключение",
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 1 addition & 2 deletions src/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ 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;
}

return <div class="sidebar">
{window === "run" && <SaveButtons />}
{window === "run" && mobileControls && <SoftKeyboardButton />}
{window === "run" && <SoftKeyboardButton />}
{window === "run" && networking && <NetworkButton />}
{editor && window === "prerun" && <DosboxConfButton />}
{editor && window === "prerun" && backend === "dosboxX" && <FatDrivesButton />}
Expand Down
6 changes: 5 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = {
safelist: [
"alert-success",
"alert-error",
"alert-warning",
"text-success-content",
"text-error-content",
"text-warning-content",
],
daisyui: {
themes: [
Expand Down Expand Up @@ -44,5 +48,5 @@ module.exports = {
"coffee",
"winter",
],
}
},
};

0 comments on commit e309896

Please sign in to comment.