mirror of
https://github.com/orangeglo/gbnp.git
synced 2026-08-27 11:04:06 -05:00
Add multiple font options
This commit is contained in:
@@ -13,7 +13,8 @@ let app = new Vue({
|
||||
processor: new Processor([]),
|
||||
filename: 'GBNP',
|
||||
mapData: '',
|
||||
romData: ''
|
||||
romData: '',
|
||||
fontIndex: 0
|
||||
},
|
||||
created: function() {
|
||||
this.processor.menu = this.menu;
|
||||
@@ -24,6 +25,11 @@ let app = new Vue({
|
||||
},
|
||||
romOverflow: function() { return this.processor.romOverflow(); }
|
||||
},
|
||||
watch: {
|
||||
fontIndex: function() {
|
||||
for (let i = 0; i < this.roms.length; i++) { this.roms[i].updateBitmap(this.fontIndex); }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addMenu: function(e) {
|
||||
let fileReader = new FileReader()
|
||||
@@ -34,7 +40,7 @@ let app = new Vue({
|
||||
},
|
||||
addROM: function(e) {
|
||||
let fileReader = new FileReader()
|
||||
fileReader.onload = () => this.roms.push(new ROM(fileReader.result));
|
||||
fileReader.onload = () => this.roms.push(new ROM(fileReader.result, this.fontIndex));
|
||||
fileReader.readAsArrayBuffer(e.target.files[0]);
|
||||
|
||||
this.processor.roms = this.roms;
|
||||
@@ -67,8 +73,8 @@ let app = new Vue({
|
||||
},
|
||||
updateMenuText: function(rom, val) {
|
||||
if (rom.bitmapTimeoutHandle) { clearTimeout(rom.bitmapTimeoutHandle); }
|
||||
rom.bitmapTimeoutHandle = setTimeout(function() {
|
||||
rom.updateMenuText(val);
|
||||
rom.bitmapTimeoutHandle = setTimeout(() => {
|
||||
rom.updateMenuText(val, this.fontIndex);
|
||||
}, 500);
|
||||
},
|
||||
stopPropagation: function(e) { e.stopImmediatePropagation(); },
|
||||
|
||||
Reference in New Issue
Block a user