🔧 Fancy things up a bit

This commit is contained in:
Felix Rieseberg 2018-08-24 20:55:18 -07:00
parent 86674b6090
commit aa62c10700
7 changed files with 25 additions and 8 deletions

View file

@ -9,6 +9,13 @@ if (require('electron-squirrel-startup')) { // eslint-disable-line global-requir
app.quit()
}
if (app.isPackaged) {
require('update-electron-app')({
repo: 'felixrieseberg/windows95',
updateInterval: '1 hour'
})
}
let mainWindow
const createWindow = () => {

View file

@ -1,5 +1,5 @@
const { remote } = require('electron')
const fs = require('fs-extra')
const { remote, shell } = require('electron')
const path = require('path')
const { STATE_PATH, resetState, restoreState, saveState } = require('./state')
@ -9,5 +9,10 @@ window.windows95 = {
resetState,
saveState,
showDiskImage() {
const imagePath = path.join(__dirname, 'images/windows95.img')
shell.showItemInFolder(imagePath)
},
quit: () => remote.app.quit()
}

View file

@ -2,6 +2,7 @@ export function setupState () {
window.appState = {
cursorCaptured: false,
floppyFile: null,
bootFresh: false
bootFresh: false,
infoInterval: null
}
}

View file

@ -4,6 +4,9 @@ export function setupButtons (start) {
// Start
$('.btn-start').addEventListener('click', () => start())
// Disk Image
$('#show-disk-image').addEventListener('click', () => windows95.showDiskImage())
// Reset
$('#reset').addEventListener('click', () => windows95.resetState())

View file

@ -27,6 +27,7 @@
<div class="btn" id="reset">Reset Machine & Delete State</div>
<div class="btn" id="floppy">Insert Floppy Disk</div>
<div class="btn" id="discard-state">Discard State & Boot From Scratch</div>
<div class="btn" id="show-disk-image">Show Disk Image</div>
<input id="file-input" type='file'>
</div>
<div id="information">

5
src/renderer/info.js Normal file
View file

@ -0,0 +1,5 @@
export function setupInfo() {
window.appState.infoInterval = setInterval(() => {
if (window.emulator && window.emulator.get_statistics) {}
})
}

View file

@ -19,11 +19,6 @@ async function main () {
url: './bios/vgabios.bin'
},
hda: {
url: '../images/windows96.img',
async: true,
size: 242049024
},
hdb: {
url: '../images/windows95.img',
async: true,
size: 242049024