Update shell

This commit is contained in:
Thomas
2026-03-05 17:38:46 +00:00
parent b54a53b9c8
commit 635869f226
5 changed files with 267 additions and 9 deletions

View File

@@ -117,7 +117,7 @@
<button class="ctrl-btn" id="btn-save" title="Save level (download .lvl)">Save</button>
<button class="ctrl-btn" id="btn-load" title="Load .lvl from disk">Load</button>
<span class="ctrl-sep">|</span>
<select id="level-select" title="Open a built-in level in the editor">
<select id="level-select" title="Load a built-in level">
<option value="">-- Open level --</option>
</select>
<span class="ctrl-sep">|</span>
@@ -263,12 +263,12 @@
var path = this.value;
if (!path) return;
if (typeof _editor_load_vfs_file === 'function') {
/* Pass the path string to C */
/* Load the level into gameplay (MODE_PLAY) via main.c */
if (typeof _game_load_level === 'function') {
var len = lengthBytesUTF8(path) + 1;
var buf = _malloc(len);
stringToUTF8(path, buf, len);
_editor_load_vfs_file(buf);
_game_load_level(buf);
_free(buf);
}