@wasm-gaming/engine-specs 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/README.md +75 -22
- package/demo/components/drop-area.html +4 -3
- package/demo/components/esc-menu.html +540 -0
- package/demo/components/launcher.html +25 -25
- package/demo/components/sdk-info.html +14 -2
- package/demo/demo.css +5 -0
- package/demo/demo.js +578 -121
- package/demo/demo.sdk.js +3 -0
- package/demo/index.html +58 -1
- package/package.json +1 -1
- package/demo/components/file-info.html +0 -66
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
<form class="launcher" @submit.prevent="onLaunch">
|
|
2
2
|
<section class="sdk">
|
|
3
|
-
<CSdkInfo ...sdkInfo />
|
|
3
|
+
<CSdkInfo ...sdkInfo :messages="messages" />
|
|
4
4
|
</section>
|
|
5
5
|
|
|
6
6
|
<div class="drop-grid" :class.single="!showBIOS">
|
|
7
7
|
<CDropArea
|
|
8
8
|
:if="showBIOS"
|
|
9
|
-
:prompt="requiresBIOS ? 'Drop BIOS File (Required)' : 'Drop BIOS File (Optional)'"
|
|
10
|
-
:asset-hint="biosAssetHint"
|
|
9
|
+
:prompt="requiresBIOS ? (messages.dropBiosPromptRequired || 'Drop BIOS File (Required)') : (messages.dropBiosPromptOptional || 'Drop BIOS File (Optional)')"
|
|
10
|
+
:asset-hint="biosAssetHint || (requiresBIOS ? (messages.biosAssetHintRequired || 'required BIOS firmware file') : (messages.biosAssetHintOptional || 'optional BIOS firmware file'))"
|
|
11
11
|
:accept="biosAccept"
|
|
12
|
-
:button-text="'Pick BIOS'"
|
|
12
|
+
:button-text="messages.pickBiosButton || 'Pick BIOS'"
|
|
13
13
|
:file-name="biosFile?.name"
|
|
14
|
+
:messages="messages"
|
|
14
15
|
@select="onBiosSelect"
|
|
15
16
|
@remove="onBiosRemove"
|
|
16
17
|
/>
|
|
17
18
|
<CDropArea
|
|
18
|
-
:prompt="'Drop ROM File'"
|
|
19
|
-
:asset-hint="romAssetHint"
|
|
19
|
+
:prompt="messages.dropRomPrompt || 'Drop ROM File'"
|
|
20
|
+
:asset-hint="romAssetHint || messages.romAssetHint || 'or choose ROM file from computer'"
|
|
20
21
|
:accept="romAccept"
|
|
21
|
-
:button-text="'Pick ROM'"
|
|
22
|
+
:button-text="messages.pickRomButton || 'Pick ROM'"
|
|
22
23
|
:file-name="romFile?.name"
|
|
24
|
+
:messages="messages"
|
|
23
25
|
@select="onRomSelect"
|
|
24
26
|
@remove="onRomRemove"
|
|
25
27
|
/>
|
|
26
28
|
</div>
|
|
27
29
|
|
|
28
30
|
<button type="submit" class="launch-btn" :disabled="!canLaunch">
|
|
29
|
-
Launch Engine
|
|
31
|
+
{{ messages.launchButton || 'Launch Engine' }}
|
|
30
32
|
</button>
|
|
31
33
|
|
|
32
34
|
<div class="status">{{ status }}</div>
|
|
@@ -36,19 +38,15 @@
|
|
|
36
38
|
CSdkInfo,
|
|
37
39
|
CDropArea,
|
|
38
40
|
sdkInfo,
|
|
39
|
-
onLaunchFiles,
|
|
40
|
-
onSaveBios,
|
|
41
|
-
onSaveRom,
|
|
42
|
-
onRemoveBios,
|
|
43
|
-
onRemoveRom,
|
|
44
41
|
initialRomFile = null,
|
|
45
42
|
initialBiosFile = null,
|
|
46
43
|
romAccept,
|
|
47
|
-
romAssetHint
|
|
44
|
+
romAssetHint,
|
|
48
45
|
biosAccept,
|
|
49
|
-
biosAssetHint
|
|
46
|
+
biosAssetHint,
|
|
50
47
|
requiresBIOS = false,
|
|
51
48
|
showBIOS = false,
|
|
49
|
+
messages = {},
|
|
52
50
|
}">
|
|
53
51
|
let romFile = initialRomFile;
|
|
54
52
|
let biosFile = initialBiosFile;
|
|
@@ -59,13 +57,14 @@
|
|
|
59
57
|
const updateStatus = () => {
|
|
60
58
|
canLaunch = Boolean(romFile && (!requiresBIOS || biosFile));
|
|
61
59
|
if (requiresBIOS && !biosFile && !romFile) {
|
|
62
|
-
status = "Ready - Please select ROM and BIOS files to launch.";
|
|
60
|
+
status = messages.statusSelectBoth || "Ready - Please select ROM and BIOS files to launch.";
|
|
63
61
|
} else if (requiresBIOS && !biosFile) {
|
|
64
|
-
status = "BIOS file is required to launch.";
|
|
62
|
+
status = messages.statusBiosRequired || "BIOS file is required to launch.";
|
|
65
63
|
} else if (!romFile) {
|
|
66
|
-
status = "Ready - Please select a ROM file to launch.";
|
|
64
|
+
status = messages.statusSelectRom || "Ready - Please select a ROM file to launch.";
|
|
67
65
|
} else {
|
|
68
|
-
|
|
66
|
+
const readyMsg = messages.statusReady || "Ready to launch!";
|
|
67
|
+
status = `${readyMsg} (${romFile.name}${biosFile ? ' + BIOS' : ''})`;
|
|
69
68
|
}
|
|
70
69
|
};
|
|
71
70
|
|
|
@@ -87,7 +86,7 @@
|
|
|
87
86
|
}
|
|
88
87
|
romFile = file;
|
|
89
88
|
updateStatus();
|
|
90
|
-
|
|
89
|
+
$emit("save:rom", file);
|
|
91
90
|
};
|
|
92
91
|
|
|
93
92
|
const onBiosSelect = (arg) => {
|
|
@@ -98,19 +97,19 @@
|
|
|
98
97
|
}
|
|
99
98
|
biosFile = file;
|
|
100
99
|
updateStatus();
|
|
101
|
-
|
|
100
|
+
$emit("save:bios", file);
|
|
102
101
|
};
|
|
103
102
|
|
|
104
103
|
const onRomRemove = () => {
|
|
105
104
|
romFile = null;
|
|
106
105
|
updateStatus();
|
|
107
|
-
|
|
106
|
+
$emit("remove:rom");
|
|
108
107
|
};
|
|
109
108
|
|
|
110
109
|
const onBiosRemove = () => {
|
|
111
110
|
biosFile = null;
|
|
112
111
|
updateStatus();
|
|
113
|
-
|
|
112
|
+
$emit("remove:bios");
|
|
114
113
|
};
|
|
115
114
|
|
|
116
115
|
const onLaunch = async () => {
|
|
@@ -119,8 +118,9 @@
|
|
|
119
118
|
return;
|
|
120
119
|
}
|
|
121
120
|
try {
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
const launchingMsg = messages.launchingStatus || "Launching with";
|
|
122
|
+
status = `${launchingMsg} ${romFile.name}...`;
|
|
123
|
+
$emit("launch", { rom: romFile, bios: biosFile });
|
|
124
124
|
} catch (error) {
|
|
125
125
|
const message = error instanceof Error ? error.message : String(error);
|
|
126
126
|
status = `Failed to load engine: ${message}`;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<h1>{{ name }} ({{ id }})</h1>
|
|
2
2
|
<p>{{ description }}</p>
|
|
3
3
|
<div class="row">
|
|
4
|
-
<span class="pill">
|
|
4
|
+
<span class="pill">{{ (messages.versionPrefix || 'Version ') + version }}</span>
|
|
5
5
|
<span class="pill">{{ baseWidth }}x{{ baseHeight }}</span>
|
|
6
|
-
<span class="pill">Asset key:
|
|
6
|
+
<span class="pill">{{ (messages.assetKeyPrefix || 'Asset key: ') + assetKey }}</span>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
+
<script :setup="{
|
|
10
|
+
name,
|
|
11
|
+
id,
|
|
12
|
+
description,
|
|
13
|
+
version,
|
|
14
|
+
baseWidth,
|
|
15
|
+
baseHeight,
|
|
16
|
+
assetKey,
|
|
17
|
+
messages = {},
|
|
18
|
+
}">
|
|
19
|
+
</script>
|
|
20
|
+
|
|
9
21
|
<style>
|
|
10
22
|
h1 {
|
|
11
23
|
margin: 0 0 0.4rem;
|
package/demo/demo.css
CHANGED
|
@@ -57,6 +57,11 @@
|
|
|
57
57
|
--demo-file-info-border: rgba(255, 255, 255, 0.8);
|
|
58
58
|
--demo-file-info-blur: 10px;
|
|
59
59
|
|
|
60
|
+
/* ESC Menu Styling */
|
|
61
|
+
--demo-esc-bg: rgba(0, 0, 0, 0.45);
|
|
62
|
+
--demo-esc-card-bg: rgba(15, 23, 42, 0.92);
|
|
63
|
+
--demo-esc-text: #f8fafc;
|
|
64
|
+
|
|
60
65
|
/* Typography & Fonts */
|
|
61
66
|
--demo-font-sans: "Outfit", system-ui, -apple-system, sans-serif;
|
|
62
67
|
--demo-font-mono: "Space Mono", monospace;
|