Skip to content

Commit

Permalink
Fix #304, v8.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Jul 5, 2024
1 parent 5de0535 commit bce4163
Show file tree
Hide file tree
Showing 20 changed files with 235 additions and 682 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
// url: decodeURIComponent("https%3A%2F%2Fcdn.dos.zone%2Fcustom%2Fdos%2Fdoom_dm.jsdos"),
// url: decodeURIComponent("https%3A%2F%2Fcdn.dos.zone%2Fcustom%2Fdos%2Fhomm2_netbios.jsdos"),
// url: "https://cdn.dos.zone/original/2X/2/24b00b14f118580763440ecaddcc948f8cb94f14.jsdos", // digger
url: "https://cdn.dos.zone/custom/dos/doom.jsdos",
// url: "https://cdn.dos.zone/custom/dos/doom.jsdos",
// url: "https://cdn.dos.zone/custom/dos/duke3d_ipx.jsdos",
// url: "https://br.cdn.dos.zone/ipx/duke3d/duke3d_ipx.jsdos",
// url: "https://br.cdn.dos.zone/ipx/doom_dm/doom_dm.jsdos",
// url: "https://cdn.dos.zone/original/2X/b/b4b5275904d86a4ab8a20917b2b7e34f0df47bf7.jsdos", // dhry2
// url: "https://cdn.dos.zone/original/2X/7/744842062905f72648a4d492ccc2526d039b3702.jsdos", // sim-city
// url: "https://cdn.dos.zone/custom/dos/war2.jsdos", // warcraft-2
// url: "https://cdn.dos.zone/original/2X/5/5f21f221e023bbca253396824c5f652438eeef8c.jsdos", // поле чудес
// dosboxConf: diabloConf,
// loginUrl: "http://localhost:8080/subscription.html",
// autoStart: true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-dos",
"version": "8.1.11",
"version": "8.1.12",
"description": "Full-featured DOS player with multiple emulator backends",
"type": "module",
"keywords": [
Expand Down Expand Up @@ -37,7 +37,7 @@
"@typescript-eslint/parser": "^6.20.0",
"autoprefixer": "^10.4.17",
"daisyui": "^3.9.3",
"emulators": "8.1.3",
"emulators": "8.1.4",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"postcss": "^8.4.33",
Expand Down
2 changes: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

.jsdos-rso {
canvas, .slider {
canvas, .slider, .soft-keyboard {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
Expand Down
4 changes: 2 additions & 2 deletions src/layers/controls/button.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommandInterface } from "emulators";
import { Layers } from "../dom/layers";
import { namedKeyCodes, KBD_NONE } from "../dom/keys";
import { pointer } from "../dom/pointer";
import { namedKeyCodes, KBD_NONE } from "../../window/dos/controls/keys";
import { pointer } from "../../window/dos/controls/mouse/pointer";
import { LayoutPosition } from "./layout";

export type ActionType = "click" | "hold";
Expand Down
12 changes: 1 addition & 11 deletions src/layers/controls/layers-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createButton } from "./button";
import { keyboard } from "./keyboard";
import { mouse } from "./mouse/mouse-common";
import { options } from "./options";
import { pointer } from "../dom/pointer";
import { pointer } from "../../window/dos/controls/mouse/pointer";
import { LayersInstance } from "../instance";
import nipplejs from "nipplejs";

Expand Down Expand Up @@ -300,23 +300,13 @@ function createKeyboardControl(keyboardControl: LayerControl,
onUp: () => layers.toggleKeyboard(),
}, columnWidth);

const onKeyboardVisibility = (visible: boolean) => {
if (visible) {
button.children[0].classList.add("emulator-control-close-icon");
} else {
button.children[0].classList.remove("emulator-control-close-icon");
}
};
layers.setOnKeyboardVisibility(onKeyboardVisibility);

button.style.position = "absolute";
button.style.left = (centerX - button.widthPx / 2) + "px";
button.style.top = (centerY - button.heightPx / 2) + "px";

layers.mouseOverlay.appendChild(button);
return () => {
layers.mouseOverlay.removeChild(button);
layers.removeOnKeyboardVisibility(onKeyboardVisibility);
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/layers/controls/mouse/mouse-common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CommandInterface } from "emulators";
import { Layers } from "../../dom/layers";
import { pointer, getPointerState } from "../../dom/pointer";
import { pointer, getPointerState } from "../../../window/dos/controls/mouse/pointer";
import { mouseSwipe } from "./mouse-swipe";
import { mouseNotLocked } from "./mouse-not-locked";
import { mouseLocked } from "./mouse-locked";
Expand Down
2 changes: 1 addition & 1 deletion src/layers/controls/mouse/mouse-nipple.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nipplejs from "nipplejs";
import { CommandInterface } from "emulators";
import { Layers } from "../../dom/layers";
import { pointer } from "../../dom/pointer";
import { pointer } from "../../../window/dos/controls/mouse/pointer";

export function mouseNipple(sensitivity: number, layers: Layers, ci: CommandInterface) {
const el = layers.mouseOverlay;
Expand Down
2 changes: 1 addition & 1 deletion src/layers/controls/nipple.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nipplejs from "nipplejs";

import { KBD_NONE } from "../dom/keys";
import { KBD_NONE } from "../../window/dos/controls/keys";

import { CommandInterface } from "emulators";
import { Layers } from "../dom/layers";
Expand Down
16 changes: 1 addition & 15 deletions src/layers/controls/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function options(layers: Layers,
const ident = Math.round(size / 4);

let controlsVisbile = false;
let keyboardVisible = false;
const keyboardVisible = false;

const updateVisibility = () => {
const display = controlsVisbile ? "flex" : "none";
Expand Down Expand Up @@ -51,19 +51,6 @@ export function options(layers: Layers,
}, size),
];
const options = children[children.length - 1];
const keyboard = children[children.length - 2].children[0];

const onKeyboardVisibility = (visible: boolean) => {
keyboardVisible = visible;

if (visible) {
keyboard.classList.add("emulator-control-close-icon");
} else {
keyboard.classList.remove("emulator-control-close-icon");
}
};
layers.setOnKeyboardVisibility(onKeyboardVisibility);
onKeyboardVisibility(layers.keyboardVisible);

const container = createDiv("emulator-options");
const intialDisplay = keyboardVisible ? "flex" : "none";
Expand All @@ -87,7 +74,6 @@ export function options(layers: Layers,

return () => {
layers.mouseOverlay.removeChild(container);
layers.removeOnKeyboardVisibility(onKeyboardVisibility);
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/layers/dom/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pointer } from "./pointer";
import { pointer } from "../../window/dos/controls/mouse/pointer";

export function createDiv(className: string, innerHtml?: string) {
const el = document.createElement("div");
Expand Down
Loading

0 comments on commit bce4163

Please sign in to comment.