Spaces:
Running
Running
switch to godot 3.4
Browse files- godot.javascript.opt.tools.threads.engine.js +0 -11
- godot.javascript.opt.tools.threads.js +0 -0
- godot.javascript.opt.tools.threads.service.worker.js +41 -73
- godot.javascript.opt.tools.threads.wasm +2 -2
- godot.javascript.opt.tools.threads.wrapped.js +0 -0
- godot.javascript.opt.tools.threads.zip +2 -2
- godot.javascript.opt.tools.threads/.DS_Store +0 -0
- godot.tools.html +11 -41
- godot.tools.js +0 -0
- godot.tools.wasm +2 -2
- index.html +11 -41
- service.worker.js +41 -73
- style.css +0 -28
godot.javascript.opt.tools.threads.engine.js
CHANGED
@@ -240,13 +240,6 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
|
|
240 |
* @default
|
241 |
*/
|
242 |
experimentalVK: false,
|
243 |
-
/**
|
244 |
-
* The progressive web app service worker to install.
|
245 |
-
* @memberof EngineConfig
|
246 |
-
* @default
|
247 |
-
* @type {string}
|
248 |
-
*/
|
249 |
-
serviceWorker: '',
|
250 |
/**
|
251 |
* @ignore
|
252 |
* @type {Array.<string>}
|
@@ -390,7 +383,6 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
|
|
390 |
this.persistentDrops = parse('persistentDrops', this.persistentDrops);
|
391 |
this.experimentalVK = parse('experimentalVK', this.experimentalVK);
|
392 |
this.focusCanvas = parse('focusCanvas', this.focusCanvas);
|
393 |
-
this.serviceWorker = parse('serviceWorker', this.serviceWorker);
|
394 |
this.gdnativeLibs = parse('gdnativeLibs', this.gdnativeLibs);
|
395 |
this.fileSizes = parse('fileSizes', this.fileSizes);
|
396 |
this.args = parse('args', this.args);
|
@@ -681,9 +673,6 @@ const Engine = (function () {
|
|
681 |
preloader.preloadedFiles.length = 0; // Clear memory
|
682 |
me.rtenv['callMain'](me.config.args);
|
683 |
initPromise = null;
|
684 |
-
if (me.config.serviceWorker && 'serviceWorker' in navigator) {
|
685 |
-
navigator.serviceWorker.register(me.config.serviceWorker);
|
686 |
-
}
|
687 |
resolve();
|
688 |
});
|
689 |
});
|
|
|
240 |
* @default
|
241 |
*/
|
242 |
experimentalVK: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
/**
|
244 |
* @ignore
|
245 |
* @type {Array.<string>}
|
|
|
383 |
this.persistentDrops = parse('persistentDrops', this.persistentDrops);
|
384 |
this.experimentalVK = parse('experimentalVK', this.experimentalVK);
|
385 |
this.focusCanvas = parse('focusCanvas', this.focusCanvas);
|
|
|
386 |
this.gdnativeLibs = parse('gdnativeLibs', this.gdnativeLibs);
|
387 |
this.fileSizes = parse('fileSizes', this.fileSizes);
|
388 |
this.args = parse('args', this.args);
|
|
|
673 |
preloader.preloadedFiles.length = 0; // Clear memory
|
674 |
me.rtenv['callMain'](me.config.args);
|
675 |
initPromise = null;
|
|
|
|
|
|
|
676 |
resolve();
|
677 |
});
|
678 |
});
|
godot.javascript.opt.tools.threads.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
godot.javascript.opt.tools.threads.service.worker.js
CHANGED
@@ -3,9 +3,8 @@
|
|
3 |
// that they need an Internet connection to run the project if desired.
|
4 |
// Incrementing CACHE_VERSION will kick off the install event and force
|
5 |
// previously cached resources to be updated from the network.
|
6 |
-
const CACHE_VERSION = "4.
|
7 |
-
const
|
8 |
-
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
|
9 |
const OFFLINE_URL = "offline.html";
|
10 |
// Files that will be cached on load.
|
11 |
const CACHED_FILES = ["godot.tools.html", "offline.html", "godot.tools.js", "godot.tools.worker.js", "godot.tools.audio.worklet.js", "logo.svg", "favicon.png"];
|
@@ -14,35 +13,26 @@ const CACHABLE_FILES = ["godot.tools.wasm"];
|
|
14 |
const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES);
|
15 |
|
16 |
self.addEventListener("install", (event) => {
|
17 |
-
event.waitUntil(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
});
|
19 |
|
20 |
self.addEventListener("activate", (event) => {
|
21 |
-
event.waitUntil(
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
})
|
29 |
-
);
|
30 |
});
|
31 |
|
32 |
-
async function fetchAndCache(event, cache, isCachable) {
|
33 |
-
// Use the preloaded response, if it's there
|
34 |
-
let response = await event.preloadResponse;
|
35 |
-
if (!response) {
|
36 |
-
// Or, go over network.
|
37 |
-
response = await self.fetch(event.request);
|
38 |
-
}
|
39 |
-
if (isCachable) {
|
40 |
-
// And update the cache
|
41 |
-
cache.put(event.request, response.clone());
|
42 |
-
}
|
43 |
-
return response;
|
44 |
-
}
|
45 |
-
|
46 |
self.addEventListener("fetch", (event) => {
|
47 |
const isNavigate = event.request.mode === "navigate";
|
48 |
const url = event.request.url || "";
|
@@ -52,54 +42,32 @@ self.addEventListener("fetch", (event) => {
|
|
52 |
const isCachable = FULL_CACHE.some(v => v === local) || (base === referrer && base.endsWith(CACHED_FILES[0]));
|
53 |
if (isNavigate || isCachable) {
|
54 |
event.respondWith(async function () {
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
try {
|
63 |
-
// Try network if some cached file is missing (so we can display offline page in case).
|
64 |
-
return await fetchAndCache(event, cache, isCachable);
|
65 |
-
} catch (e) {
|
66 |
-
// And return the hopefully always cached offline page in case of network failure.
|
67 |
-
console.error("Network error: ", e);
|
68 |
-
return await caches.match(OFFLINE_URL);
|
69 |
-
}
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
}());
|
80 |
}
|
81 |
});
|
82 |
-
|
83 |
-
self.addEventListener("message", (event) => {
|
84 |
-
// No cross origin
|
85 |
-
if (event.origin != self.origin) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
const id = event.source.id || "";
|
89 |
-
const msg = event.data || "";
|
90 |
-
// Ensure it's one of our clients.
|
91 |
-
self.clients.get(id).then(function (client) {
|
92 |
-
if (!client) {
|
93 |
-
return; // Not a valid client.
|
94 |
-
}
|
95 |
-
if (msg === "claim") {
|
96 |
-
self.skipWaiting().then(() => self.clients.claim());
|
97 |
-
} else if (msg === "clear") {
|
98 |
-
caches.delete(CACHE_NAME);
|
99 |
-
} else if (msg === "update") {
|
100 |
-
self.skipWaiting().then(() => self.clients.claim()).then(() => self.clients.matchAll()).then(all => all.forEach(c => c.navigate(c.url)));
|
101 |
-
} else {
|
102 |
-
onClientMessage(event);
|
103 |
-
}
|
104 |
-
});
|
105 |
-
});
|
|
|
3 |
// that they need an Internet connection to run the project if desired.
|
4 |
// Incrementing CACHE_VERSION will kick off the install event and force
|
5 |
// previously cached resources to be updated from the network.
|
6 |
+
const CACHE_VERSION = "3.4.4.rc.custom_build";
|
7 |
+
const CACHE_NAME = "GodotEngine-cache";
|
|
|
8 |
const OFFLINE_URL = "offline.html";
|
9 |
// Files that will be cached on load.
|
10 |
const CACHED_FILES = ["godot.tools.html", "offline.html", "godot.tools.js", "godot.tools.worker.js", "godot.tools.audio.worklet.js", "logo.svg", "favicon.png"];
|
|
|
13 |
const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES);
|
14 |
|
15 |
self.addEventListener("install", (event) => {
|
16 |
+
event.waitUntil(async function () {
|
17 |
+
const cache = await caches.open(CACHE_NAME);
|
18 |
+
// Clear old cache (including optionals).
|
19 |
+
await Promise.all(FULL_CACHE.map(path => cache.delete(path)));
|
20 |
+
// Insert new one.
|
21 |
+
const done = await cache.addAll(CACHED_FILES);
|
22 |
+
return done;
|
23 |
+
}());
|
24 |
});
|
25 |
|
26 |
self.addEventListener("activate", (event) => {
|
27 |
+
event.waitUntil(async function () {
|
28 |
+
if ("navigationPreload" in self.registration) {
|
29 |
+
await self.registration.navigationPreload.enable();
|
30 |
+
}
|
31 |
+
}());
|
32 |
+
// Tell the active service worker to take control of the page immediately.
|
33 |
+
self.clients.claim();
|
|
|
|
|
34 |
});
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
self.addEventListener("fetch", (event) => {
|
37 |
const isNavigate = event.request.mode === "navigate";
|
38 |
const url = event.request.url || "";
|
|
|
42 |
const isCachable = FULL_CACHE.some(v => v === local) || (base === referrer && base.endsWith(CACHED_FILES[0]));
|
43 |
if (isNavigate || isCachable) {
|
44 |
event.respondWith(async function () {
|
45 |
+
try {
|
46 |
+
// Use the preloaded response, if it's there
|
47 |
+
let request = event.request.clone();
|
48 |
+
let response = await event.preloadResponse;
|
49 |
+
if (!response) {
|
50 |
+
// Or, go over network.
|
51 |
+
response = await fetch(event.request);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
+
if (isCachable) {
|
54 |
+
// Update the cache
|
55 |
+
const cache = await caches.open(CACHE_NAME);
|
56 |
+
cache.put(request, response.clone());
|
57 |
+
}
|
58 |
+
return response;
|
59 |
+
} catch (error) {
|
60 |
+
const cache = await caches.open(CACHE_NAME);
|
61 |
+
if (event.request.mode === "navigate") {
|
62 |
+
// Check if we have full cache.
|
63 |
+
const cached = await Promise.all(FULL_CACHE.map(name => cache.match(name)));
|
64 |
+
const missing = cached.some(v => v === undefined);
|
65 |
+
const cachedResponse = missing ? await caches.match(OFFLINE_URL) : await caches.match(CACHED_FILES[0]);
|
66 |
+
return cachedResponse;
|
67 |
+
}
|
68 |
+
const cachedResponse = await caches.match(event.request);
|
69 |
+
return cachedResponse;
|
70 |
}
|
71 |
}());
|
72 |
}
|
73 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
godot.javascript.opt.tools.threads.wasm
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a390630633cdc5dfca6c15f9abf92b797ead61561ee1bbe211066abc7ce72b2
|
3 |
+
size 38752316
|
godot.javascript.opt.tools.threads.wrapped.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
godot.javascript.opt.tools.threads.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e1e62876866875fd9f2cf81bd6e04bd7262888eefc6bc1474d7ce9738fc32b8
|
3 |
+
size 17239261
|
godot.javascript.opt.tools.threads/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
godot.tools.html
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
<link id="-gd-engine-icon" rel="icon" type="image/png" href="favicon.png" />
|
24 |
<link rel="apple-touch-icon" type="image/png" href="favicon.png" />
|
25 |
<link rel="manifest" href="manifest.json" />
|
26 |
-
<title>Godot Engine Web Editor (4.
|
27 |
<style>
|
28 |
*:focus {
|
29 |
/* More visible outline for better keyboard navigation. */
|
@@ -265,7 +265,6 @@
|
|
265 |
<button id="btn-close-editor" class="btn close-btn" disabled="disabled" onclick="closeEditor()">×</button>
|
266 |
<button id="btn-tab-game" class="btn tab-btn" disabled="disabled" onclick="showTab('game')">Game</button>
|
267 |
<button id="btn-close-game" class="btn close-btn" disabled="disabled" onclick="closeGame()">×</button>
|
268 |
-
<button id="btn-tab-update" class="btn tab-btn" style="display: none;">Update</button>
|
269 |
</div>
|
270 |
<div id="tabs">
|
271 |
<div id="tab-loader">
|
@@ -273,7 +272,7 @@
|
|
273 |
<br />
|
274 |
<img src="logo.svg" alt="Godot Engine logo" width="1024" height="414" style="width: auto; height: auto; max-width: min(85%, 50vh); max-height: 250px" />
|
275 |
<br />
|
276 |
-
4.
|
277 |
<br />
|
278 |
<a href="releases/">Need an old version?</a>
|
279 |
<br />
|
@@ -282,7 +281,8 @@
|
|
282 |
<label for="videoMode" style="margin-right: 1rem">Video driver:</label>
|
283 |
<select id="videoMode">
|
284 |
<option value="" selected="selected">Auto</option>
|
285 |
-
<option value="
|
|
|
286 |
</select>
|
287 |
<br />
|
288 |
<br />
|
@@ -295,7 +295,7 @@
|
|
295 |
<br />
|
296 |
<button class="btn" onclick="clearPersistence()" style="margin-bottom: 1.5rem">Clear persistent data</button>
|
297 |
<br />
|
298 |
-
<a href="https://docs.godotengine.org/en/
|
299 |
</div>
|
300 |
</div>
|
301 |
<div id="tab-editor" style="display: none;">
|
@@ -325,39 +325,10 @@
|
|
325 |
<div id="status-notice" class="godot" style="display: none;"></div>
|
326 |
</div>
|
327 |
</div>
|
328 |
-
<script
|
329 |
window.addEventListener("load", () => {
|
330 |
-
function notifyUpdate(sw) {
|
331 |
-
const btn = document.getElementById("btn-tab-update");
|
332 |
-
btn.onclick = function () {
|
333 |
-
if (!window.confirm("Are you sure you want to update?\nClicking \"OK\" will reload all active instances!")) {
|
334 |
-
return;
|
335 |
-
}
|
336 |
-
sw.postMessage("update");
|
337 |
-
btn.innerHTML = "Updating...";
|
338 |
-
btn.disabled = true;
|
339 |
-
};
|
340 |
-
btn.style.display = "";
|
341 |
-
}
|
342 |
if ("serviceWorker" in navigator) {
|
343 |
-
navigator.serviceWorker.register("service.worker.js")
|
344 |
-
if (reg.waiting) {
|
345 |
-
notifyUpdate(reg.waiting);
|
346 |
-
}
|
347 |
-
reg.addEventListener("updatefound", function () {
|
348 |
-
const update = reg.installing;
|
349 |
-
update.addEventListener("statechange", function () {
|
350 |
-
if (update.state === "installed") {
|
351 |
-
// It's a new install, claim and perform aggressive caching.
|
352 |
-
if (!reg.active) {
|
353 |
-
update.postMessage("claim");
|
354 |
-
} else {
|
355 |
-
notifyUpdate(update);
|
356 |
-
}
|
357 |
-
}
|
358 |
-
});
|
359 |
-
});
|
360 |
-
});
|
361 |
}
|
362 |
|
363 |
if (localStorage.getItem("welcomeModalDismissed") !== 'true') {
|
@@ -372,7 +343,7 @@
|
|
372 |
localStorage.setItem("welcomeModalDismissed", 'true');
|
373 |
}
|
374 |
}
|
375 |
-
|
376 |
<script src="godot.tools.js"></script>
|
377 |
<script>//<![CDATA[
|
378 |
|
@@ -591,9 +562,8 @@
|
|
591 |
const is_project_manager = args.filter(function(v) { return v == '--project-manager' }).length != 0;
|
592 |
const is_game = !is_editor && !is_project_manager;
|
593 |
if (video_driver) {
|
594 |
-
args.push('--
|
595 |
}
|
596 |
-
|
597 |
if (is_game) {
|
598 |
if (game) {
|
599 |
console.error("A game is already running. Close it first");
|
@@ -681,9 +651,9 @@
|
|
681 |
selectVideoMode();
|
682 |
showTab('editor');
|
683 |
setLoaderEnabled(false);
|
684 |
-
const args = ['--project-manager'
|
685 |
if (video_driver) {
|
686 |
-
args.push('--
|
687 |
}
|
688 |
editor.start({'args': args, 'persistentDrops': true}).then(function() {
|
689 |
setStatusMode('hidden');
|
|
|
23 |
<link id="-gd-engine-icon" rel="icon" type="image/png" href="favicon.png" />
|
24 |
<link rel="apple-touch-icon" type="image/png" href="favicon.png" />
|
25 |
<link rel="manifest" href="manifest.json" />
|
26 |
+
<title>Godot Engine Web Editor (3.4.4.rc.custom_build)</title>
|
27 |
<style>
|
28 |
*:focus {
|
29 |
/* More visible outline for better keyboard navigation. */
|
|
|
265 |
<button id="btn-close-editor" class="btn close-btn" disabled="disabled" onclick="closeEditor()">×</button>
|
266 |
<button id="btn-tab-game" class="btn tab-btn" disabled="disabled" onclick="showTab('game')">Game</button>
|
267 |
<button id="btn-close-game" class="btn close-btn" disabled="disabled" onclick="closeGame()">×</button>
|
|
|
268 |
</div>
|
269 |
<div id="tabs">
|
270 |
<div id="tab-loader">
|
|
|
272 |
<br />
|
273 |
<img src="logo.svg" alt="Godot Engine logo" width="1024" height="414" style="width: auto; height: auto; max-width: min(85%, 50vh); max-height: 250px" />
|
274 |
<br />
|
275 |
+
3.4.4.rc.custom_build
|
276 |
<br />
|
277 |
<a href="releases/">Need an old version?</a>
|
278 |
<br />
|
|
|
281 |
<label for="videoMode" style="margin-right: 1rem">Video driver:</label>
|
282 |
<select id="videoMode">
|
283 |
<option value="" selected="selected">Auto</option>
|
284 |
+
<option value="GLES2">WebGL</option>
|
285 |
+
<option value="GLES3">WebGL 2</option>
|
286 |
</select>
|
287 |
<br />
|
288 |
<br />
|
|
|
295 |
<br />
|
296 |
<button class="btn" onclick="clearPersistence()" style="margin-bottom: 1.5rem">Clear persistent data</button>
|
297 |
<br />
|
298 |
+
<a href="https://docs.godotengine.org/en/3.4/tutorials/editor/using_the_web_editor.html">Web editor documentation</a>
|
299 |
</div>
|
300 |
</div>
|
301 |
<div id="tab-editor" style="display: none;">
|
|
|
325 |
<div id="status-notice" class="godot" style="display: none;"></div>
|
326 |
</div>
|
327 |
</div>
|
328 |
+
<script>
|
329 |
window.addEventListener("load", () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
if ("serviceWorker" in navigator) {
|
331 |
+
navigator.serviceWorker.register("service.worker.js");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
}
|
333 |
|
334 |
if (localStorage.getItem("welcomeModalDismissed") !== 'true') {
|
|
|
343 |
localStorage.setItem("welcomeModalDismissed", 'true');
|
344 |
}
|
345 |
}
|
346 |
+
</script>
|
347 |
<script src="godot.tools.js"></script>
|
348 |
<script>//<![CDATA[
|
349 |
|
|
|
562 |
const is_project_manager = args.filter(function(v) { return v == '--project-manager' }).length != 0;
|
563 |
const is_game = !is_editor && !is_project_manager;
|
564 |
if (video_driver) {
|
565 |
+
args.push('--video-driver', video_driver);
|
566 |
}
|
|
|
567 |
if (is_game) {
|
568 |
if (game) {
|
569 |
console.error("A game is already running. Close it first");
|
|
|
651 |
selectVideoMode();
|
652 |
showTab('editor');
|
653 |
setLoaderEnabled(false);
|
654 |
+
const args = ['--project-manager'];
|
655 |
if (video_driver) {
|
656 |
+
args.push('--video-driver', video_driver);
|
657 |
}
|
658 |
editor.start({'args': args, 'persistentDrops': true}).then(function() {
|
659 |
setStatusMode('hidden');
|
godot.tools.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
godot.tools.wasm
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a390630633cdc5dfca6c15f9abf92b797ead61561ee1bbe211066abc7ce72b2
|
3 |
+
size 38752316
|
index.html
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
<link id="-gd-engine-icon" rel="icon" type="image/png" href="favicon.png" />
|
24 |
<link rel="apple-touch-icon" type="image/png" href="favicon.png" />
|
25 |
<link rel="manifest" href="manifest.json" />
|
26 |
-
<title>Godot Engine Web Editor (4.
|
27 |
<style>
|
28 |
*:focus {
|
29 |
/* More visible outline for better keyboard navigation. */
|
@@ -265,7 +265,6 @@
|
|
265 |
<button id="btn-close-editor" class="btn close-btn" disabled="disabled" onclick="closeEditor()">×</button>
|
266 |
<button id="btn-tab-game" class="btn tab-btn" disabled="disabled" onclick="showTab('game')">Game</button>
|
267 |
<button id="btn-close-game" class="btn close-btn" disabled="disabled" onclick="closeGame()">×</button>
|
268 |
-
<button id="btn-tab-update" class="btn tab-btn" style="display: none;">Update</button>
|
269 |
</div>
|
270 |
<div id="tabs">
|
271 |
<div id="tab-loader">
|
@@ -273,7 +272,7 @@
|
|
273 |
<br />
|
274 |
<img src="logo.svg" alt="Godot Engine logo" width="1024" height="414" style="width: auto; height: auto; max-width: min(85%, 50vh); max-height: 250px" />
|
275 |
<br />
|
276 |
-
4.
|
277 |
<br />
|
278 |
<a href="releases/">Need an old version?</a>
|
279 |
<br />
|
@@ -282,7 +281,8 @@
|
|
282 |
<label for="videoMode" style="margin-right: 1rem">Video driver:</label>
|
283 |
<select id="videoMode">
|
284 |
<option value="" selected="selected">Auto</option>
|
285 |
-
<option value="
|
|
|
286 |
</select>
|
287 |
<br />
|
288 |
<br />
|
@@ -295,7 +295,7 @@
|
|
295 |
<br />
|
296 |
<button class="btn" onclick="clearPersistence()" style="margin-bottom: 1.5rem">Clear persistent data</button>
|
297 |
<br />
|
298 |
-
<a href="https://docs.godotengine.org/en/
|
299 |
</div>
|
300 |
</div>
|
301 |
<div id="tab-editor" style="display: none;">
|
@@ -325,39 +325,10 @@
|
|
325 |
<div id="status-notice" class="godot" style="display: none;"></div>
|
326 |
</div>
|
327 |
</div>
|
328 |
-
<script
|
329 |
window.addEventListener("load", () => {
|
330 |
-
function notifyUpdate(sw) {
|
331 |
-
const btn = document.getElementById("btn-tab-update");
|
332 |
-
btn.onclick = function () {
|
333 |
-
if (!window.confirm("Are you sure you want to update?\nClicking \"OK\" will reload all active instances!")) {
|
334 |
-
return;
|
335 |
-
}
|
336 |
-
sw.postMessage("update");
|
337 |
-
btn.innerHTML = "Updating...";
|
338 |
-
btn.disabled = true;
|
339 |
-
};
|
340 |
-
btn.style.display = "";
|
341 |
-
}
|
342 |
if ("serviceWorker" in navigator) {
|
343 |
-
navigator.serviceWorker.register("service.worker.js")
|
344 |
-
if (reg.waiting) {
|
345 |
-
notifyUpdate(reg.waiting);
|
346 |
-
}
|
347 |
-
reg.addEventListener("updatefound", function () {
|
348 |
-
const update = reg.installing;
|
349 |
-
update.addEventListener("statechange", function () {
|
350 |
-
if (update.state === "installed") {
|
351 |
-
// It's a new install, claim and perform aggressive caching.
|
352 |
-
if (!reg.active) {
|
353 |
-
update.postMessage("claim");
|
354 |
-
} else {
|
355 |
-
notifyUpdate(update);
|
356 |
-
}
|
357 |
-
}
|
358 |
-
});
|
359 |
-
});
|
360 |
-
});
|
361 |
}
|
362 |
|
363 |
if (localStorage.getItem("welcomeModalDismissed") !== 'true') {
|
@@ -372,7 +343,7 @@
|
|
372 |
localStorage.setItem("welcomeModalDismissed", 'true');
|
373 |
}
|
374 |
}
|
375 |
-
|
376 |
<script src="godot.tools.js"></script>
|
377 |
<script>//<![CDATA[
|
378 |
|
@@ -591,9 +562,8 @@
|
|
591 |
const is_project_manager = args.filter(function(v) { return v == '--project-manager' }).length != 0;
|
592 |
const is_game = !is_editor && !is_project_manager;
|
593 |
if (video_driver) {
|
594 |
-
args.push('--
|
595 |
}
|
596 |
-
|
597 |
if (is_game) {
|
598 |
if (game) {
|
599 |
console.error("A game is already running. Close it first");
|
@@ -681,9 +651,9 @@
|
|
681 |
selectVideoMode();
|
682 |
showTab('editor');
|
683 |
setLoaderEnabled(false);
|
684 |
-
const args = ['--project-manager'
|
685 |
if (video_driver) {
|
686 |
-
args.push('--
|
687 |
}
|
688 |
editor.start({'args': args, 'persistentDrops': true}).then(function() {
|
689 |
setStatusMode('hidden');
|
|
|
23 |
<link id="-gd-engine-icon" rel="icon" type="image/png" href="favicon.png" />
|
24 |
<link rel="apple-touch-icon" type="image/png" href="favicon.png" />
|
25 |
<link rel="manifest" href="manifest.json" />
|
26 |
+
<title>Godot Engine Web Editor (3.4.4.rc.custom_build)</title>
|
27 |
<style>
|
28 |
*:focus {
|
29 |
/* More visible outline for better keyboard navigation. */
|
|
|
265 |
<button id="btn-close-editor" class="btn close-btn" disabled="disabled" onclick="closeEditor()">×</button>
|
266 |
<button id="btn-tab-game" class="btn tab-btn" disabled="disabled" onclick="showTab('game')">Game</button>
|
267 |
<button id="btn-close-game" class="btn close-btn" disabled="disabled" onclick="closeGame()">×</button>
|
|
|
268 |
</div>
|
269 |
<div id="tabs">
|
270 |
<div id="tab-loader">
|
|
|
272 |
<br />
|
273 |
<img src="logo.svg" alt="Godot Engine logo" width="1024" height="414" style="width: auto; height: auto; max-width: min(85%, 50vh); max-height: 250px" />
|
274 |
<br />
|
275 |
+
3.4.4.rc.custom_build
|
276 |
<br />
|
277 |
<a href="releases/">Need an old version?</a>
|
278 |
<br />
|
|
|
281 |
<label for="videoMode" style="margin-right: 1rem">Video driver:</label>
|
282 |
<select id="videoMode">
|
283 |
<option value="" selected="selected">Auto</option>
|
284 |
+
<option value="GLES2">WebGL</option>
|
285 |
+
<option value="GLES3">WebGL 2</option>
|
286 |
</select>
|
287 |
<br />
|
288 |
<br />
|
|
|
295 |
<br />
|
296 |
<button class="btn" onclick="clearPersistence()" style="margin-bottom: 1.5rem">Clear persistent data</button>
|
297 |
<br />
|
298 |
+
<a href="https://docs.godotengine.org/en/3.4/tutorials/editor/using_the_web_editor.html">Web editor documentation</a>
|
299 |
</div>
|
300 |
</div>
|
301 |
<div id="tab-editor" style="display: none;">
|
|
|
325 |
<div id="status-notice" class="godot" style="display: none;"></div>
|
326 |
</div>
|
327 |
</div>
|
328 |
+
<script>
|
329 |
window.addEventListener("load", () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
if ("serviceWorker" in navigator) {
|
331 |
+
navigator.serviceWorker.register("service.worker.js");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
}
|
333 |
|
334 |
if (localStorage.getItem("welcomeModalDismissed") !== 'true') {
|
|
|
343 |
localStorage.setItem("welcomeModalDismissed", 'true');
|
344 |
}
|
345 |
}
|
346 |
+
</script>
|
347 |
<script src="godot.tools.js"></script>
|
348 |
<script>//<![CDATA[
|
349 |
|
|
|
562 |
const is_project_manager = args.filter(function(v) { return v == '--project-manager' }).length != 0;
|
563 |
const is_game = !is_editor && !is_project_manager;
|
564 |
if (video_driver) {
|
565 |
+
args.push('--video-driver', video_driver);
|
566 |
}
|
|
|
567 |
if (is_game) {
|
568 |
if (game) {
|
569 |
console.error("A game is already running. Close it first");
|
|
|
651 |
selectVideoMode();
|
652 |
showTab('editor');
|
653 |
setLoaderEnabled(false);
|
654 |
+
const args = ['--project-manager'];
|
655 |
if (video_driver) {
|
656 |
+
args.push('--video-driver', video_driver);
|
657 |
}
|
658 |
editor.start({'args': args, 'persistentDrops': true}).then(function() {
|
659 |
setStatusMode('hidden');
|
service.worker.js
CHANGED
@@ -3,9 +3,8 @@
|
|
3 |
// that they need an Internet connection to run the project if desired.
|
4 |
// Incrementing CACHE_VERSION will kick off the install event and force
|
5 |
// previously cached resources to be updated from the network.
|
6 |
-
const CACHE_VERSION = "4.
|
7 |
-
const
|
8 |
-
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
|
9 |
const OFFLINE_URL = "offline.html";
|
10 |
// Files that will be cached on load.
|
11 |
const CACHED_FILES = ["godot.tools.html", "offline.html", "godot.tools.js", "godot.tools.worker.js", "godot.tools.audio.worklet.js", "logo.svg", "favicon.png"];
|
@@ -14,35 +13,26 @@ const CACHABLE_FILES = ["godot.tools.wasm"];
|
|
14 |
const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES);
|
15 |
|
16 |
self.addEventListener("install", (event) => {
|
17 |
-
event.waitUntil(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
});
|
19 |
|
20 |
self.addEventListener("activate", (event) => {
|
21 |
-
event.waitUntil(
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
})
|
29 |
-
);
|
30 |
});
|
31 |
|
32 |
-
async function fetchAndCache(event, cache, isCachable) {
|
33 |
-
// Use the preloaded response, if it's there
|
34 |
-
let response = await event.preloadResponse;
|
35 |
-
if (!response) {
|
36 |
-
// Or, go over network.
|
37 |
-
response = await self.fetch(event.request);
|
38 |
-
}
|
39 |
-
if (isCachable) {
|
40 |
-
// And update the cache
|
41 |
-
cache.put(event.request, response.clone());
|
42 |
-
}
|
43 |
-
return response;
|
44 |
-
}
|
45 |
-
|
46 |
self.addEventListener("fetch", (event) => {
|
47 |
const isNavigate = event.request.mode === "navigate";
|
48 |
const url = event.request.url || "";
|
@@ -52,54 +42,32 @@ self.addEventListener("fetch", (event) => {
|
|
52 |
const isCachable = FULL_CACHE.some(v => v === local) || (base === referrer && base.endsWith(CACHED_FILES[0]));
|
53 |
if (isNavigate || isCachable) {
|
54 |
event.respondWith(async function () {
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
try {
|
63 |
-
// Try network if some cached file is missing (so we can display offline page in case).
|
64 |
-
return await fetchAndCache(event, cache, isCachable);
|
65 |
-
} catch (e) {
|
66 |
-
// And return the hopefully always cached offline page in case of network failure.
|
67 |
-
console.error("Network error: ", e);
|
68 |
-
return await caches.match(OFFLINE_URL);
|
69 |
-
}
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
}());
|
80 |
}
|
81 |
});
|
82 |
-
|
83 |
-
self.addEventListener("message", (event) => {
|
84 |
-
// No cross origin
|
85 |
-
if (event.origin != self.origin) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
const id = event.source.id || "";
|
89 |
-
const msg = event.data || "";
|
90 |
-
// Ensure it's one of our clients.
|
91 |
-
self.clients.get(id).then(function (client) {
|
92 |
-
if (!client) {
|
93 |
-
return; // Not a valid client.
|
94 |
-
}
|
95 |
-
if (msg === "claim") {
|
96 |
-
self.skipWaiting().then(() => self.clients.claim());
|
97 |
-
} else if (msg === "clear") {
|
98 |
-
caches.delete(CACHE_NAME);
|
99 |
-
} else if (msg === "update") {
|
100 |
-
self.skipWaiting().then(() => self.clients.claim()).then(() => self.clients.matchAll()).then(all => all.forEach(c => c.navigate(c.url)));
|
101 |
-
} else {
|
102 |
-
onClientMessage(event);
|
103 |
-
}
|
104 |
-
});
|
105 |
-
});
|
|
|
3 |
// that they need an Internet connection to run the project if desired.
|
4 |
// Incrementing CACHE_VERSION will kick off the install event and force
|
5 |
// previously cached resources to be updated from the network.
|
6 |
+
const CACHE_VERSION = "3.4.4.rc.custom_build";
|
7 |
+
const CACHE_NAME = "GodotEngine-cache";
|
|
|
8 |
const OFFLINE_URL = "offline.html";
|
9 |
// Files that will be cached on load.
|
10 |
const CACHED_FILES = ["godot.tools.html", "offline.html", "godot.tools.js", "godot.tools.worker.js", "godot.tools.audio.worklet.js", "logo.svg", "favicon.png"];
|
|
|
13 |
const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES);
|
14 |
|
15 |
self.addEventListener("install", (event) => {
|
16 |
+
event.waitUntil(async function () {
|
17 |
+
const cache = await caches.open(CACHE_NAME);
|
18 |
+
// Clear old cache (including optionals).
|
19 |
+
await Promise.all(FULL_CACHE.map(path => cache.delete(path)));
|
20 |
+
// Insert new one.
|
21 |
+
const done = await cache.addAll(CACHED_FILES);
|
22 |
+
return done;
|
23 |
+
}());
|
24 |
});
|
25 |
|
26 |
self.addEventListener("activate", (event) => {
|
27 |
+
event.waitUntil(async function () {
|
28 |
+
if ("navigationPreload" in self.registration) {
|
29 |
+
await self.registration.navigationPreload.enable();
|
30 |
+
}
|
31 |
+
}());
|
32 |
+
// Tell the active service worker to take control of the page immediately.
|
33 |
+
self.clients.claim();
|
|
|
|
|
34 |
});
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
self.addEventListener("fetch", (event) => {
|
37 |
const isNavigate = event.request.mode === "navigate";
|
38 |
const url = event.request.url || "";
|
|
|
42 |
const isCachable = FULL_CACHE.some(v => v === local) || (base === referrer && base.endsWith(CACHED_FILES[0]));
|
43 |
if (isNavigate || isCachable) {
|
44 |
event.respondWith(async function () {
|
45 |
+
try {
|
46 |
+
// Use the preloaded response, if it's there
|
47 |
+
let request = event.request.clone();
|
48 |
+
let response = await event.preloadResponse;
|
49 |
+
if (!response) {
|
50 |
+
// Or, go over network.
|
51 |
+
response = await fetch(event.request);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
+
if (isCachable) {
|
54 |
+
// Update the cache
|
55 |
+
const cache = await caches.open(CACHE_NAME);
|
56 |
+
cache.put(request, response.clone());
|
57 |
+
}
|
58 |
+
return response;
|
59 |
+
} catch (error) {
|
60 |
+
const cache = await caches.open(CACHE_NAME);
|
61 |
+
if (event.request.mode === "navigate") {
|
62 |
+
// Check if we have full cache.
|
63 |
+
const cached = await Promise.all(FULL_CACHE.map(name => cache.match(name)));
|
64 |
+
const missing = cached.some(v => v === undefined);
|
65 |
+
const cachedResponse = missing ? await caches.match(OFFLINE_URL) : await caches.match(CACHED_FILES[0]);
|
66 |
+
return cachedResponse;
|
67 |
+
}
|
68 |
+
const cachedResponse = await caches.match(event.request);
|
69 |
+
return cachedResponse;
|
70 |
}
|
71 |
}());
|
72 |
}
|
73 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
style.css
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
body {
|
2 |
-
padding: 2rem;
|
3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
4 |
-
}
|
5 |
-
|
6 |
-
h1 {
|
7 |
-
font-size: 16px;
|
8 |
-
margin-top: 0;
|
9 |
-
}
|
10 |
-
|
11 |
-
p {
|
12 |
-
color: rgb(107, 114, 128);
|
13 |
-
font-size: 15px;
|
14 |
-
margin-bottom: 10px;
|
15 |
-
margin-top: 5px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.card {
|
19 |
-
max-width: 620px;
|
20 |
-
margin: 0 auto;
|
21 |
-
padding: 16px;
|
22 |
-
border: 1px solid lightgray;
|
23 |
-
border-radius: 16px;
|
24 |
-
}
|
25 |
-
|
26 |
-
.card p:last-child {
|
27 |
-
margin-bottom: 0;
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|