Skip to content

Commit aefbccd

Browse files
committed
null unsafety
1 parent a1e6951 commit aefbccd

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

.vscode/launch.json

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
{
22
"configurations": [
33
{
4-
"type": "electron",
5-
"request": "launch",
64
"name": "HTML5-watch",
7-
"appDir": "${workspaceFolder}/build/debug-html5",
8-
"sourceMaps": true,
9-
"preLaunchTask": "Build Electron-watch",
10-
"postDebugTask": "postDebugKill"
11-
},
12-
{
13-
"type": "electron",
145
"request": "launch",
15-
"name": "Kha: HTML5",
16-
"appDir": "${workspaceFolder}/build/debug-html5",
17-
"sourceMaps": true,
18-
"preLaunchTask": "Kha: Build for Debug HTML5"
6+
"type": "pwa-chrome",
7+
"cwd": "${workspaceFolder}/build/debug-html5",
8+
"runtimeExecutable": "${command:kha.findKhaElectron}",
9+
"runtimeArgs": [
10+
"--no-sandbox",
11+
"."
12+
],
13+
"outFiles": [
14+
"${workspaceFolder}/build/debug-html5/*.js"
15+
],
16+
"preLaunchTask": "Build Electron-watch",
17+
"postDebugTask": "postDebugKill",
18+
"internalConsoleOptions": "openOnSessionStart"
1919
},
2020
{
2121
"type": "krom",
2222
"request": "launch",
2323
"name": "Kha: Krom",
24-
"preLaunchTask": "Kha: Build for Krom"
24+
"preLaunchTask": "Kha: Build for Krom",
25+
"internalConsoleOptions": "openOnSessionStart"
2526
}
2627
],
2728
"compounds": []
28-
}
29+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ node Kha/make html5 --watch
1919
- Add this block to `khafile.js` (before `resolve(project);`):
2020
```js
2121
if (process.argv.includes("--watch")) { // run only in watch mode
22+
project.targetOptions.html5.unsafeEval = true; // allow eval in electron
2223
let libPath = project.addLibrary('hotml'); // client code for code-patching
2324
project.addDefine('js_classic'); // to support constructors patching, optional
2425
// start websocket server that will send type diffs to client

khafile.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project.addParameter('-dce full');
1212
project.targetOptions.html5.disableContextMenu = true;
1313

1414
if (process.argv.includes("--watch")) {
15+
project.targetOptions.html5.unsafeEval = true;
1516
let libPath = project.addLibrary('hotml');
1617
project.addDefine('js_classic');
1718
const path = require('path');

src/Game.hx

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class Game extends Screen {
2727
final rects2:Array<Rect2> = [];
2828

2929
public function init() {
30-
// Assets.loadBlob("blob_txt", (blob) -> {
31-
// trace(blob);
32-
// });
30+
Assets.loadBlob("blob_txt", (blob) -> {
31+
trace(blob);
32+
});
3333
}
3434

3535
override function onUpdate():Void {

0 commit comments

Comments
 (0)