fix loading game from textarea (copy/paste)
This commit is contained in:
parent
c8b6c772ab
commit
23b99b8ea7
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pixsy"
|
name = "pixsy"
|
||||||
version = "0.72.7"
|
version = "0.72.8"
|
||||||
description = "convert images to Bitsy rooms"
|
description = "convert images to Bitsy rooms"
|
||||||
authors = ["Max Bradbury <max@tinybird.info>"]
|
authors = ["Max Bradbury <max@tinybird.info>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://tinybird.dev/max/image-to-bitsy"
|
repository = "https://tinybird.dev/max/pixsy"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
|
@ -126,7 +126,6 @@ async function run() {
|
||||||
el("game").addEventListener("change", function() {
|
el("game").addEventListener("change", function() {
|
||||||
readFile(this, function (e) {
|
readFile(this, function (e) {
|
||||||
textareaGameDataInput.value = e.target.result;
|
textareaGameDataInput.value = e.target.result;
|
||||||
console.log(load_game(e.target.result));
|
|
||||||
checkGameData();
|
checkGameData();
|
||||||
}, "text");
|
}, "text");
|
||||||
});
|
});
|
||||||
|
@ -152,7 +151,10 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkGameData() {
|
function checkGameData() {
|
||||||
if (textareaGameDataInput.value.length > 0) {
|
let result = load_game(textareaGameDataInput.value)
|
||||||
|
console.log(result);
|
||||||
|
|
||||||
|
if (result === "Loaded game") {
|
||||||
buttonGameDataProceed.removeAttribute("disabled");
|
buttonGameDataProceed.removeAttribute("disabled");
|
||||||
setPaletteDropdown();
|
setPaletteDropdown();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue