Strip out Electron and NodeJS-specific functions to get the game working on a basic level

This commit is contained in:
Stephen Jianu 2022-09-12 23:58:44 -05:00
commit fe0ec3a2c7
4 changed files with 16 additions and 14 deletions

View file

@ -44,9 +44,6 @@
</div>
</div>
<script type="text/javascript">
const {dialog,app} = require('electron').remote;
const fs = require('fs');
let donsol = new Donsol();
donsol.controller.add("default","*","About",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Donsol'); },"CmdOrCtrl+,");
@ -76,8 +73,6 @@
donsol.controller.add("default","Theme","Reset Theme",() => { donsol.theme.reset(); },"CmdOrCtrl+Shift+Backspace")
donsol.controller.add("default","Theme","Download Themes..",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes'); })
donsol.controller.commit();
donsol.install(document.body)
donsol.start();
</script>

View file

@ -26,7 +26,6 @@ function Card (sym, value, type, name = 'Unknown') {
const graphic = document.createElement('div')
graphic.className = 'graphic'
graphic.innerHTML = require('fs').readFileSync(`${__dirname}/media/${this.type}/${this.value}.svg`)
face.appendChild(graphic)
// Name

View file

@ -4,8 +4,6 @@ function Controller () {
this.menu = { default: {} }
this.mode = 'default'
this.app = require('electron').remote.app
this.start = function () {
}
@ -45,10 +43,6 @@ function Controller () {
return f
}
this.commit = function () {
this.app.inject_menu(this.format())
}
this.docs = function () {
console.log('Generating docs..')
const svg = this.generate_svg(this.format())
@ -181,5 +175,3 @@ function Controller () {
{ x: 540, y: 240, width: 90, height: 60, name: 'alt' }
]
}
module.exports = new Controller()