Skip to content

Commit 2541d52

Browse files
committed
v8.3.11
1 parent 4ab9932 commit 2541d52

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@
140140
],
141141
],
142142
// key: "-----",
143-
onEvent: (event, ci) => {
144-
console.log("Event", event)
143+
onEvent: (event, arg) => {
144+
console.log("Event", event, arg);
145145
if (event === "ci-ready") {
146-
window.ci = ci;
146+
window.ci = arg;
147147
// props.setFrame("network");
148148
// props.setFullScreen(true);
149149
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-dos",
3-
"version": "8.3.10",
3+
"version": "8.3.11",
44
"description": "Full-featured DOS player with multiple emulator backends",
55
"type": "module",
66
"keywords": [

src/host/fullscreen.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Store, getNonSerializableStore } from "../store";
1+
import { Store, getNonSerializableStore, postJsDosEvent } from "../store";
22
import { uiSlice } from "../store/ui";
33

44
export function browserSetFullScreen(fullScreen: boolean, store: Store) {
5-
const root = getNonSerializableStore(store).root as any;
5+
const nsStore = getNonSerializableStore(store);
6+
const root = nsStore.root as any;
67
if (fullScreen) {
78
if (root.requestFullscreen) {
89
root.requestFullscreen();
@@ -32,4 +33,5 @@ export function browserSetFullScreen(fullScreen: boolean, store: Store) {
3233
}
3334

3435
store.dispatch(uiSlice.actions.setFullScreen(fullScreen));
36+
postJsDosEvent(nsStore, "fullscreen-change", fullScreen);
3537
}

src/public/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type DosEvent = "emu-ready" | "ci-ready" | "bnd-play" | "open-key";
1+
export type DosEvent = "emu-ready" | "ci-ready" | "bnd-play" | "open-key" | "fullscreen-change";
22
export type ImageRendering = "pixelated" | "smooth";
33
export type RenderBackend = "webgl" | "canvas";
44
export type RenderAspect = "AsIs" | "1/1" | "5/4" | "4/3" | "16/10" | "16/9" | "Fit";
@@ -35,7 +35,7 @@ export interface DosOptions {
3535
backendHardware: ((backend: "dosbox" | "dosboxX", sockdriveNative: boolean) => Promise<string | null>),
3636
workerThread: boolean,
3737
mouseCapture: boolean,
38-
onEvent: (event: DosEvent, ci?: any /* CommandInterface */) => void,
38+
onEvent: (event: DosEvent, arg?: any /* CommandInterface | boolean */) => void,
3939
ipx: NamedHost[],
4040
ipxBackend: string,
4141
room: string,

src/store.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ export function useNonSerializableStore() {
111111
return getNonSerializableStore(useStore());
112112
}
113113

114-
export function postJsDosEvent(nonSerializableStore: NonSerializableStore, event: DosEvent, ci?: CommandInterface) {
114+
export function postJsDosEvent(nonSerializableStore: NonSerializableStore, event: DosEvent,
115+
arg?: CommandInterface | boolean) {
115116
if (nonSerializableStore.options.onEvent) {
116117
setTimeout(() => {
117-
nonSerializableStore.options.onEvent?.(event, ci);
118+
nonSerializableStore.options.onEvent?.(event, arg);
118119
}, 4);
119120
}
120121
}

0 commit comments

Comments
 (0)