Skip to content

Commit 000b266

Browse files
authored
Merge pull request #4 from TheOtterlord/v0.2.0
V0.2.0
2 parents ba8e5a4 + 614e4c5 commit 000b266

17 files changed

Lines changed: 274 additions & 78 deletions

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## 0.2.0 Alpha
10+
11+
The auto-updater is back!
12+
I've also added a settings menu that over time will be populated with more options to customise DeckMaster.
13+
14+
### Added
15+
16+
- Basic settings menu
17+
- Ability to reset settings
18+
- Setting to change YGOPro path
19+
- In-app notifications API
20+
- New auto-updater
21+
- Default keybinding for settings (Ctrl+,)
22+
23+
924
## 0.1.2 Alpha
1025

1126
A few fixes and improvements

ROADMAP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
This roadmap shows what needs to be completed before the initial full version (`1.0.0`).
44
Things may be added/removed over time if I change my mind about what should be in `1.0.0`.
55

6-
- [ ] Settings menu
7-
- [ ] Keyboard shortcut API
6+
- [ ] Settings menu (WIP)
7+
- [x] Keyboard shortcut API
88
- [ ] Undo/Redo system
99
- [ ] Context menu when right click on deck or a card in deck
1010
- [ ] Combo Editor (using `.ycb` extension (**Y**u-Gi-Oh! **C**om**b**o))

css/master.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,48 @@ header {
266266
border-radius: 4px;
267267
transition: background 0.4s;
268268
}
269+
270+
.settings {
271+
background-color: #242424;
272+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
273+
position: fixed;
274+
top: 50%;
275+
left: 50%;
276+
transform: translate(-50%, -50%);
277+
width: 50%;
278+
min-height: 50%;
279+
max-height: 80%;
280+
overflow-y: scroll;
281+
z-index: 10;
282+
}
283+
284+
.settings h1 {
285+
padding: 8px;
286+
}
287+
288+
.settings .ir-flex-row, .settings .ir-flex-row .ir-flex {
289+
margin: 8px;
290+
.notifications {
291+
margin: 16px;
292+
position: fixed;
293+
bottom: 0;
294+
right: 0;
295+
z-index: 11;
296+
width: 250px;
297+
display: flex;
298+
flex-direction: column-reverse;
299+
}
300+
301+
.notifications div {
302+
width: 100%;
303+
background-color: #343434;
304+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
305+
margin: 16px 0;
306+
padding: 8px;
307+
animation: slide-in 1s linear;
308+
}
309+
310+
@keyframes slide-in {
311+
from {opacity: 0;}
312+
to {opacity: 1;}
313+
}

docs/first.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This screen is the setup, and allows you to optionally link YGOPro/EDOPro to the
55

66
## Linking YGOPro/EDOPro
77

8-
If you wish to link YGOPro/EDOPro to the app, click on the button and navigate to the application's folder.
8+
If you wish to link YGOPro/EDOPro to the app, click on the button and navigate to the application's folder.
9+
You can change this later in settings.
910

1011
> HINT: The folder is the one containing `YGOPro.exe` or `EDOPro.exe`
1112

docs/install.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Installation
22

33
You can install DeckMaster's latest version via one of the installers, or by building it from the source code.
4-
Sadly, Mac users currently **must** build from source as I cannot compile for MacOS.
54

65
> NOTE: auto-update is disabled. Please download new versions to install them when they are released. I will try to fix this as soon as possible. Watch the blog for updates: https://theotterholt.blogspot.com/
76
@@ -15,10 +14,10 @@ Sadly, Mac users currently **must** build from source as I cannot compile for Ma
1514
## Windows Installer
1615

1716
Head to the [download](https://github.com/TheOtterlord/deckmaster/releases/latest) page for the most recent version of **DeckMaster**.
18-
Download the `win-installer.exe` file and run it to install the app.
17+
Download the `installer.exe` file and run it to install the app.
1918

20-
You might be warned by Windows not to run the app.
21-
This is because the app is unsigned.
19+
You might be warned by Windows not to run the app.
20+
This is because the app is unsigned.
2221
Code signing can cost a lot of money, and for an individual developing free software, it doesn't make much sense to sign it.
2322

2423
![Microsoft Defender prevents unsigned apps from running without permission](assets/win-protect1.png)
@@ -27,14 +26,14 @@ To continue using the installer, just click `More info`, then `Run anyway`.
2726
If the installer does not work on your architecture, you can always [build from source](#build-from-source).
2827

2928

30-
## Linux Installer
29+
## Linux & macOS Installers
3130

3231
Head to the [download](https://github.com/TheOtterlord/deckmaster/releases/latest) page for the most recent version of **DeckMaster**.
33-
Download the `linux-installer` with your platform's installer extension and run it to install the app.
32+
Download the `linux-installer` with your platform's installer extension (or `installer.dmg` on macOS) and run it to install the app.
3433

35-
You can install the `rpm` build using something like `yum`.
34+
You can install the `rpm` build using a supported package manager like `yum`.
3635

37-
You may be warned by your computer that the app is unknown and unsigned.
36+
You may be warned by your computer that the app is unknown.
3837
This is because the app is not signed.
3938
Code signing can cost a lot of money, and for an indifivual developing free software, it doesn't make much sense to sign my code.
4039
If the installer does not work, you can always [build from source](#build-from-source).
@@ -47,5 +46,5 @@ If you run into any problems, please open an [issue](https://github.com/TheOtter
4746

4847
1. Install [NodeJS](https://nodejs.org)
4948
2. Download the [repository](https://github.com/TheOtterlord/deckmaster/archive/master.zip), and unzip it into an empty folder
50-
3. Run `npm install && npm install electron-builder` to download dependancies
51-
4. Run `npm run dev` to use the app, or run `npm run build` to package it for your platform
49+
3. Run `npm install` to download dependancies
50+
4. Run `npm run dev` to run the app

docs/keys.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Keybindings
2+
3+
This lists the default keybindings used by DeckMaster.
4+
5+
- `Ctrl+F1` Opens the documentation in your default browser
6+
- `Ctrl+O` Opens a new deck
7+
- `Ctrl+S` Saves the current deck
8+
- `Ctrl+,` Opens the settings

docs/settings.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Settings
2+
3+
The settings meny can be accessed via `Help > Settings` or the `Ctrl+,` keybinding.
4+
5+
## YGOPro/EDOPro Path
6+
7+
This setting defines the path to the folder containing your YGOPro/EDOPro app.
8+
The folder should contain `YGOPro.exe` or `EDOPro.exe` along with folders like `pics` and `deck`.
9+
10+
## Reset All Settings
11+
12+
As the name states, this resets all of DeckMaster's settings.
13+
However, this will not delete any decks/combos you have created with DeckMaster.

index.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<link rel="stylesheet" href="css/master.css">
1111
<link rel="stylesheet" href="css/filter.css">
1212
<link rel="stylesheet" href="css/editor.css">
13+
<link rel="stylesheet" href="css/iridium.css">
1314
</head>
1415

1516
<body>
@@ -20,6 +21,7 @@
2021
<script src="js/hg_calc.js"></script>
2122
<script src="js/combowidget.js"></script>
2223
<script src="js/keybind.js"></script>
24+
<script src="js/settings.js"></script>
2325
<script src="js/update.js"></script>
2426
<script src="js/main.js"></script>
2527

@@ -55,6 +57,7 @@
5557
<a href="#" onclick="deckmaster.wiki()">User documentation</a>
5658
<a href="#" onclick="deckmaster.link('https://github.com/TheOtterlord/deckmaster/issues')">Report a bug</a>
5759
<a href="#" onclick="deckmaster.link('https://github.com/TheOtterlord/deckmaster')">GitHub</a>
60+
<a href="#" onclick="open_settings()">Settings</a>
5861
<a href="#" onclick="checkForUpdates()">Check for updates</a>
5962
<a href="#" onclick="deckmaster.link('https://theotterlord.github.io/deckmaster/about')">About</a>
6063
</div>
@@ -288,6 +291,18 @@ <h2 style="padding: 4px;">Filter <span style="color:red;">(EXPERIMENTAL)</span><
288291
</div>
289292
</div>
290293

294+
<div class="settings" style="display: none;">
295+
<h1>Settings</h1>
296+
<div class="ir-flex-row">
297+
<div class="ir-flex">YGOPro/EDOPro Path: </div>
298+
<button class="ir-flex ygopro_connect" onclick="ygoprodeck.linkYGOPro()">No folder selected...</button>
299+
</div>
300+
<div class="ir-flex-row">
301+
<button class="ir-flex ygopro_connect" onclick="deckmaster.reset_all()">Reset All Settings</button>
302+
<button class="ir-flex ygopro_connect" onclick="close_settings()">Close Settings</button>
303+
</div>
304+
</div>
305+
291306
<div class="intro" style="display:none;">
292307
<h2>Welcome</h2>
293308
<p>
@@ -297,13 +312,15 @@ <h2>Welcome</h2>
297312
</p>
298313
<p>
299314
To improve performance, DeckMaster is capable of linking to YGOPro/EDOPro to share the same deck/image storage.
300-
If you would like to do this, please direct us to the app's folder using the button below.
301-
If not, just click "Finish".
315+
If you would like to do this, please direct us to the app's folder containing the YGOPro.exe or EDOPro.exe file using the button below.
316+
If not, just click "Finish". You can change these preferences later in settings.
302317
</p>
303318
<button class="ygopro_connect" onclick="ygoprodeck.linkYGOPro()">No folder selected...</button>
304319
<br><br>
305320
<button onclick="deckmaster.setup()">Finish</button>
306321
</div>
322+
323+
<div class="notifications"></div>
307324
</body>
308325

309-
</html>
326+
</html>

index.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
const { app, BrowserWindow, Menu, MenuItem } = require('electron')
1+
const { app, BrowserWindow, ipcMain } = require('electron')
22
const path = require('path')
33
const url = require('url')
4+
const {autoUpdater} = require("electron-updater")
5+
6+
let win;
47

58
function createWindow () {
6-
let win = new BrowserWindow({
9+
win = new BrowserWindow({
710
icon:'favicon.ico',
811
show: false,
912
backgroundColor: '#202020',
@@ -20,7 +23,7 @@ function createWindow () {
2023
// when deprecated, remove `nodeIntegration: true` but keep this
2124
contextIsolation: false
2225
}
23-
});
26+
});
2427

2528
// open links in native browser
2629
win.webContents.on('new-window', function(e, url) {
@@ -34,14 +37,19 @@ function createWindow () {
3437
pathname: index_path,
3538
protocol: 'file:',
3639
slashes: true
37-
}));
40+
}))
41+
42+
ipcMain.on('update', () => {
43+
autoUpdater.quitAndInstall();
44+
});
3845

3946
win.webContents.on("did-finish-load", () => {
4047
win.webContents.send("cmd", process.argv);
4148
});
4249

4350
// Once loaded, show the screen
4451
win.once('ready-to-show', () => {
52+
autoUpdater.checkForUpdatesAndNotify();
4553
win.maximize();
4654
win.show();
4755
});
@@ -68,3 +76,19 @@ app.on('activate', () => {
6876
createWindow()
6977
}
7078
})
79+
80+
function sendStatusToWindow(text) {
81+
win.webContents.send('message', text);
82+
}
83+
84+
autoUpdater.on('update-downloaded', (info) => {
85+
sendStatusToWindow('update-downloaded');
86+
});
87+
88+
autoUpdater.on('update-available', (info) => {
89+
sendStatusToWindow('update-available');
90+
})
91+
92+
autoUpdater.on('download-progress', (progressObj) => {
93+
sendStatusToWindow('progress:'+Math.round(progressObj.percent));
94+
})

js/api.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
const { dialog } = require('electron').remote;
22

33
const deckmaster = {
4-
version: "v0.1.2",
4+
version: "v0.2.0",
55
notification: (title, text, onclick) => {
66
const notification = new Notification(title, {
77
body: text
88
});
99
notification.onclick = onclick;
1010
},
11+
reset_all: () => {
12+
localStorage.clear();
13+
deckmaster.restart();
14+
},
1115
setup: () => {
1216
localStorage.setItem("settings", JSON.stringify({
1317
"settingsVersion": "0.1.0"

0 commit comments

Comments
 (0)