mirror of
https://github.com/orangeglo/gbnp.git
synced 2026-10-02 03:36:37 -05:00
Upload multiple games at once
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
<tr>
|
||||
<td>
|
||||
<button v-on:click="triggerAddRomLabel" class="upload" :disabled="!menu.ready() || romOverflow" type="button">
|
||||
<label for="romFileInput" ref="addRomLabel" v-on:click="stopPropagation">Add Game</label>
|
||||
<label for="romFileInput" ref="addRomLabel" v-on:click="stopPropagation">Add Games</label>
|
||||
</button>
|
||||
<input style="display: none" id="romFileInput" type="file" v-on:change="addROM" :disabled="!menu.ready() || romOverflow" accept=".gb,.gbc">
|
||||
<input style="display: none" id="romFileInput" type="file" v-on:change="addROM" :disabled="!menu.ready() || romOverflow" accept=".gb,.gbc" multiple>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user