From 0ebdb5abf092184095fe7ef0fb0e558481656d04 Mon Sep 17 00:00:00 2001 From: Evan Barger Date: Sat, 4 Apr 2020 11:24:54 -0400 Subject: [PATCH] Upload multiple games at once --- README.md | 1 - index.html | 4 ++-- script/app.js | 11 ++++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f1e780a..85d636a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ This tool can build the data necessary to flash new games to a [Nintendo Power G - Pokemon Classic Font: https://www.dafont.com/pokemon-classic.font ## Ideas -- Upload multiple games at once - Move more templating into components - Add ability to upload arbitrary 128x8 images for menu entries - Save settings to local storage diff --git a/index.html b/index.html index 9ccdece..9f5003d 100644 --- a/index.html +++ b/index.html @@ -85,9 +85,9 @@ - + diff --git a/script/app.js b/script/app.js index 7a102c1..2b0f35b 100644 --- a/script/app.js +++ b/script/app.js @@ -42,9 +42,14 @@ let app = new Vue({ e.target.value = ''; }, addROM: function(e) { - let fileReader = new FileReader() - fileReader.onload = () => this.roms.push(new ROM(fileReader.result, this.fontIndex)); - fileReader.readAsArrayBuffer(e.target.files[0]); + const files = e.target.files; + for (let i = 0; i < files.length; i++) { + let fileReader = new FileReader(); + fileReader.onload = () => { + this.roms.push(new ROM(fileReader.result, this.fontIndex)); + } + fileReader.readAsArrayBuffer(files[i]); + } this.processor.roms = this.roms;