diff --git a/src/components/fields/Text.vue b/src/components/fields/Text.vue index 1e71298..f57b8c3 100644 --- a/src/components/fields/Text.vue +++ b/src/components/fields/Text.vue @@ -5,16 +5,18 @@ diff --git a/src/components/system/Save.vue b/src/components/system/Save.vue index 4ae1439..9b23384 100644 --- a/src/components/system/Save.vue +++ b/src/components/system/Save.vue @@ -49,7 +49,7 @@
Last played {{ dateFormat.format(time) }}
- +
Error: Failed to load save with id {{ save.id }}
diff --git a/src/components/system/SavesManager.vue b/src/components/system/SavesManager.vue index 93073e4..c811900 100644 --- a/src/components/system/SavesManager.vue +++ b/src/components/system/SavesManager.vue @@ -20,7 +20,7 @@ { try { const playerData = JSON.parse(decodeURIComponent(escape(atob(text)))); + if (typeof playerData !== "object") { + this.importingFailed = true; + return; + } const id = getUniqueID(); playerData.id = id; localStorage.setItem( diff --git a/src/data/layers/aca/c.ts b/src/data/layers/aca/c.ts index 1c2f6d2..e9142ea 100644 --- a/src/data/layers/aca/c.ts +++ b/src/data/layers/aca/c.ts @@ -468,7 +468,7 @@ export default {
Name your points!
- + I have {{ format(player.points) }} {{ player.layers.c.thingy }} points!
diff --git a/src/game/layers.ts b/src/game/layers.ts index 495aa50..7a43e17 100644 --- a/src/game/layers.ts +++ b/src/game/layers.ts @@ -566,6 +566,7 @@ export function addLayer(layer: RawLayer, player?: Partial): void { } if (layer.hotkeys) { for (const id in layer.hotkeys) { + layer.hotkeys[id].layer = layer.id; setDefault(layer.hotkeys[id], "press", undefined, false); setDefault(layer.hotkeys[id], "unlocked", function() { return layers[this.layer].unlocked; diff --git a/src/util/layers.ts b/src/util/layers.ts index e790ee5..cf7caec 100644 --- a/src/util/layers.ts +++ b/src/util/layers.ts @@ -395,6 +395,9 @@ export const defaultLayerProperties = { } as Omit & Partial> & ThisType; document.onkeydown = function(e) { + if ((e.target as HTMLElement | null)?.tagName === "INPUT") { + return; + } if (player.hasWon && !player.keepGoing) { return; }