Strip out Electron and NodeJS-specific functions to get the game working on a basic...
authorStephen Jianu <stephen@stephenjianu.com>
Tue, 13 Sep 2022 04:58:44 +0000 (23:58 -0500)
committerStephen Jianu <stephen@stephenjianu.com>
Tue, 13 Sep 2022 04:58:44 +0000 (23:58 -0500)
README.md
sources/index.html
sources/scripts/card.js
sources/scripts/lib/controller.js

index 9edb616d7246bae158ec4e15b4b02fa7b40becf4..b64c04fff40dac3a7feddc2ed9a5935cb34de25c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,2 +1,18 @@
 # DonsolJavascript
 Javascript version of Donsol
+
+### Original authors
+The original Javascript+Electron version of Donsol was created by Hundred Rabbits.
+
+### About this branch
+This branch ("web") will be used for development on the web-based version of Donsol, which in turn is heavily based on the main branch, stripping out parts related to Electron and NodeJS.
+None of this is official; it's a passion project, so please do not contact Hundred Rabbits regarding issues with this web version of the game.
+
+### Limitations
+In the project's current state, you can play the base game of Donsol, with some limitations.
+The following do not currently work:
+* Card faces do not render properly, as these were previously loaded with NodeJS functions that aren't available to use in a pure browser-based application (as far as I'm aware). I have an idea on how to accomplish this.
+* Aspects of the game that relied on being selected from a menu in the Electron version currently have no way of being toggled. These include things like difficulty selection and themeing support.
+
+### Contributing
+If you wish to contribute to the project, please follow the standard practice of forking this repository and submitting a pull request.
index 9560a1ef3be5c874dc35cf9fbc54fbd68af6cd50..93bb5b40f0b776e15735de4319accda01ae17ba6 100644 (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>
index a2d325e09cb5b9195f9afcbc732d4b0736507c50..c253ea596ba69e516c1ad6eb1bd4982bf3e66919 100644 (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
index 365c368b68f981cc9c77e69e81ce4c4172c84103..99c3e5fb5b7903e722fea32fb540d2efb6087f65 100644 (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()