From 23b99b8ea792446f6817d9e93102d5e528561357 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 2 May 2021 11:45:06 +0100 Subject: [PATCH] fix loading game from textarea (copy/paste) --- Cargo.toml | 4 ++-- script.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3738210..9a3557a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "pixsy" -version = "0.72.7" +version = "0.72.8" description = "convert images to Bitsy rooms" authors = ["Max Bradbury "] edition = "2018" license = "MIT" -repository = "https://tinybird.dev/max/image-to-bitsy" +repository = "https://tinybird.dev/max/pixsy" [lib] crate-type = ["cdylib"] diff --git a/script.js b/script.js index 73c63be..294b84b 100644 --- a/script.js +++ b/script.js @@ -126,7 +126,6 @@ async function run() { el("game").addEventListener("change", function() { readFile(this, function (e) { textareaGameDataInput.value = e.target.result; - console.log(load_game(e.target.result)); checkGameData(); }, "text"); }); @@ -152,7 +151,10 @@ async function run() { } function checkGameData() { - if (textareaGameDataInput.value.length > 0) { + let result = load_game(textareaGameDataInput.value) + console.log(result); + + if (result === "Loaded game") { buttonGameDataProceed.removeAttribute("disabled"); setPaletteDropdown(); } else {