From fe0ec3a2c7364e319dfd60453dc495222edb37d4 Mon Sep 17 00:00:00 2001 From: Stephen Jianu Date: Mon, 12 Sep 2022 23:58:44 -0500 Subject: [PATCH] Strip out Electron and NodeJS-specific functions to get the game working on a basic level --- README.md | 16 ++++++++++++++++ sources/index.html | 5 ----- sources/scripts/card.js | 1 - sources/scripts/lib/controller.js | 8 -------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9edb616..b64c04f 100644 --- 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. diff --git a/sources/index.html b/sources/index.html index 9560a1e..93bb5b4 100644 --- a/sources/index.html +++ b/sources/index.html @@ -44,9 +44,6 @@ diff --git a/sources/scripts/card.js b/sources/scripts/card.js index a2d325e..c253ea5 100644 --- a/sources/scripts/card.js +++ b/sources/scripts/card.js @@ -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 diff --git a/sources/scripts/lib/controller.js b/sources/scripts/lib/controller.js index 365c368..99c3e5f 100644 --- a/sources/scripts/lib/controller.js +++ b/sources/scripts/lib/controller.js @@ -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() -- 2.39.5