From ae5084a8676da6c09d634a7f66e1f977f4ee8342 Mon Sep 17 00:00:00 2001 From: Alexander Guryanov Date: Wed, 28 Aug 2024 11:05:36 +0300 Subject: [PATCH] v8.1.18: refactored pre-run window, noCursor option --- index.html | 1 + package.json | 2 +- src/components/dos-option-checkbox.tsx | 12 +++ src/components/dos-option-select.tsx | 6 +- src/frame/account-frame.tsx | 31 ++++++- src/frame/editor/editor-conf-frame.tsx | 1 + src/frame/frame.css | 5 +- src/frame/frame.tsx | 2 + src/frame/prerun-frame.tsx | 29 ++++++ src/frame/settings-frame.tsx | 6 +- src/i18n.ts | 6 ++ src/load.ts | 1 + src/main.tsx | 9 ++ src/public/types.ts | 2 + src/sidebar/sidebar-button.tsx | 27 ++++++ src/sidebar/sidebar.tsx | 4 +- src/store.tsx | 2 +- src/store/dos.ts | 5 + src/store/ui.ts | 7 +- src/window/dos/dos-window.tsx | 3 +- src/window/prerun-window.tsx | 123 +++++++++---------------- 21 files changed, 190 insertions(+), 94 deletions(-) create mode 100644 src/frame/prerun-frame.tsx diff --git a/index.html b/index.html index 735059dc..beec7d4e 100644 --- a/index.html +++ b/index.html @@ -54,6 +54,7 @@ // }, // noNetworking: true, // noCloud: true, + // noCursor: true, onEvent: (event, ci) => { console.log("Event", event) if (event === "ci-ready") { diff --git a/package.json b/package.json index f7235737..74d6ea32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-dos", - "version": "8.1.17", + "version": "8.1.18", "description": "Full-featured DOS player with multiple emulator backends", "type": "module", "keywords": [ diff --git a/src/components/dos-option-checkbox.tsx b/src/components/dos-option-checkbox.tsx index 0af1de7f..0dd7e0cb 100644 --- a/src/components/dos-option-checkbox.tsx +++ b/src/components/dos-option-checkbox.tsx @@ -29,6 +29,18 @@ export function MouseCapture() { />; } +export function SystemCursor() { + const t = useT(); + const dispatch = useDispatch(); + const lock = useSelector((state: State) => !state.dos.noCursor); + return dispatch(dosSlice.actions.noCursor(!l))} + />; +} + export function MobileControls() { const t = useT(); const dispatch = useDispatch(); diff --git a/src/components/dos-option-select.tsx b/src/components/dos-option-select.tsx index ad8b10a4..e0d1b894 100644 --- a/src/components/dos-option-select.tsx +++ b/src/components/dos-option-select.tsx @@ -11,9 +11,10 @@ import { ThemeValues, Theme, uiSlice } from "../store/ui"; import { lStorage } from "../host/lstorage"; import { SockdriveBackendName, initSlice, sockdriveBackendNames } from "../store/init"; -export function BackendSelect() { +export function BackendSelect(props: { multiline?: boolean }) { const locked = useSelector((state: State) => state.dos.backendLocked); return ; } -export function RenderSelect() { +export function RenderSelect(props: { multiline?: boolean }) { const disabled = useSelector((state: State) => state.ui.window) === "run"; return