Skip to content

Commit d50f9e5

Browse files
committed
Smoothened out some designs
1 parent e361036 commit d50f9e5

File tree

8 files changed

+228
-126
lines changed

8 files changed

+228
-126
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
![demo](img/demo/general_screen.png)
44

5-
## Usage
5+
## Installation
6+
7+
There should be a Windows installer available, if you don't use Windows, install from scratch.
8+
9+
### From Scratch
610

711
```
812
git clone https://github.com/r2dev2bb8/WayChess.git
@@ -12,6 +16,26 @@ python3 installer.py
1216
python3 gui.py
1317
```
1418

19+
## Usage
20+
21+
Keybindings:
22+
23+
| Key | Function |
24+
| ---------- | ---------------- |
25+
| ``<-`` | Move back |
26+
| ``->`` | Move forward |
27+
| ``f`` | Flip board |
28+
| ``s`` | Save database |
29+
| ``ctrl+n`` | Create game |
30+
| ``n`` | Next game |
31+
| ``b`` | Previous game |
32+
| ``e`` | Toggle engine |
33+
| ``o`` | Load a pgn |
34+
| ``x`` | Toggle explorer |
35+
| ``q`` | Quit application |
36+
37+
38+
1539
## Goals
1640

1741
- [x] Open source chess gui

core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import os
2+
13
import chess
24
import chess.pgn
5+
from easygui import filesavebox, fileopenbox
36

47

58
class Database:
@@ -20,8 +23,15 @@ def __init__(self, file):
2023
def add(self, item=chess.pgn.Game()):
2124
self.games.append(item)
2225

26+
27+
def new_file(self):
28+
file = fileopenbox("Which file to open?", "WayChess", filetypes=("pgn",))
29+
self.__init__(file)
30+
2331

2432
def save(self, file=None):
33+
if not os.path.isfile(file):
34+
self.file = filesavebox("Save to which file?", "WayChess", filetypes=("pgn",))
2535
if file is None:
2636
file = self.file
2737
with open(file, 'w+') as fout:

0 commit comments

Comments
 (0)