fix loading game from textarea (copy/paste)

This commit is contained in:
Max Bradbury 2021-05-02 11:45:06 +01:00
parent c8b6c772ab
commit 23b99b8ea7
2 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,11 @@
[package]
name = "pixsy"
version = "0.72.7"
version = "0.72.8"
description = "convert images to Bitsy rooms"
authors = ["Max Bradbury <max@tinybird.info>"]
edition = "2018"
license = "MIT"
repository = "https://tinybird.dev/max/image-to-bitsy"
repository = "https://tinybird.dev/max/pixsy"
[lib]
crate-type = ["cdylib"]

View File

@ -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 {