Skip to content

Commit

Permalink
v8.3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Jan 9, 2025
1 parent 4ab9932 commit 8ae47d7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@
],
],
// key: "-----",
onEvent: (event, ci) => {
console.log("Event", event)
onEvent: (event, arg) => {
console.log("Event", event, arg);
if (event === "ci-ready") {
window.ci = ci;
window.ci = arg;
// props.setFrame("network");
// props.setFullScreen(true);
}
Expand Down
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.3.10",
"version": "8.3.11",
"description": "Full-featured DOS player with multiple emulator backends",
"type": "module",
"keywords": [
Expand Down
6 changes: 4 additions & 2 deletions src/host/fullscreen.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Store, getNonSerializableStore } from "../store";
import { Store, getNonSerializableStore, postJsDosEvent } from "../store";
import { uiSlice } from "../store/ui";

export function browserSetFullScreen(fullScreen: boolean, store: Store) {
const root = getNonSerializableStore(store).root as any;
const nsStore = getNonSerializableStore(store);
const root = nsStore.root as any;
if (fullScreen) {
if (root.requestFullscreen) {
root.requestFullscreen();
Expand Down Expand Up @@ -32,4 +33,5 @@ export function browserSetFullScreen(fullScreen: boolean, store: Store) {
}

store.dispatch(uiSlice.actions.setFullScreen(fullScreen));
postJsDosEvent(nsStore, "fullscreen-change", fullScreen);
}
4 changes: 2 additions & 2 deletions src/public/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type DosEvent = "emu-ready" | "ci-ready" | "bnd-play" | "open-key";
export type DosEvent = "emu-ready" | "ci-ready" | "bnd-play" | "open-key" | "fullscreen-change";
export type ImageRendering = "pixelated" | "smooth";
export type RenderBackend = "webgl" | "canvas";
export type RenderAspect = "AsIs" | "1/1" | "5/4" | "4/3" | "16/10" | "16/9" | "Fit";
Expand Down Expand Up @@ -35,7 +35,7 @@ export interface DosOptions {
backendHardware: ((backend: "dosbox" | "dosboxX", sockdriveNative: boolean) => Promise<string | null>),
workerThread: boolean,
mouseCapture: boolean,
onEvent: (event: DosEvent, ci?: any /* CommandInterface */) => void,
onEvent: (event: DosEvent, arg?: any /* CommandInterface | boolean */) => void,
ipx: NamedHost[],
ipxBackend: string,
room: string,
Expand Down
4 changes: 2 additions & 2 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ export function useNonSerializableStore() {
return getNonSerializableStore(useStore());
}

export function postJsDosEvent(nonSerializableStore: NonSerializableStore, event: DosEvent, ci?: CommandInterface) {
export function postJsDosEvent(nonSerializableStore: NonSerializableStore, event: DosEvent, arg?: CommandInterface | boolean) {

Check failure on line 114 in src/store.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

This line has a length of 127. Maximum allowed is 120

Check failure on line 114 in src/store.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

This line has a length of 127. Maximum allowed is 120
if (nonSerializableStore.options.onEvent) {
setTimeout(() => {
nonSerializableStore.options.onEvent?.(event, ci);
nonSerializableStore.options.onEvent?.(event, arg);
}, 4);
}
}
Expand Down

0 comments on commit 8ae47d7

Please sign in to comment.