Commit Graph

35 Commits

Author SHA1 Message Date
Tom
99d6b3b80b Chess: Use the hourglass cursor while waiting for the ChessEngine 2020-12-22 23:37:25 +01:00
William Marlow
39364bdda4 Build: Embed application icons directly in the executables.
New serenity_app() targets can be defined which allows application
icons to be emedded directly into the executable. The embedded
icons will then be used when creating an icon for that file in
LibGUI.
2020-12-21 00:12:59 +01:00
Brendan Coles
172707a945 Chess: Prevent board changes when waiting for ChessEngine to move 2020-12-17 19:45:05 +01:00
Itamar
9a9d655abe Chess: Add LibCore as a dependency
This fixes Dynamic Loader crash because of an unresolved LibCore symbol
2020-12-14 23:05:53 +01:00
AnicJov
e119d7d6b9 Chess: Added ability to put markings on the board
With this patch you can use right-click to mark a square on the board.
You can add modifier keys to the click to change to alternate color
(with CTRL) or secondary color (with Shift). If you right-click and
drag from one square to another you will create an arrow. The
markings go away as soon as you left-click on the board or the board
state changes.

Note: The arrows sometimes look weird, and horizontal ones get cut
      off. They also don't account for alpha. This is not a bug in
      Chess code, rather, likely in the fill_path() function that's
      used to draw the arrows. If anyone might know what's up with
      that I urge you to take a look. :)
2020-12-10 20:40:51 +01:00
AnicJov
f631e73519 Chess: Added abilty to import PGN files
This patch allows the user to load games using PGN files. The parsing
is not complete and has a bunch of work left to be done, but it's
okay for our use case here. It can load all of the games our PGN
exporter can save. As the Chess program impoves so can the PGN parser.
2020-12-10 20:40:51 +01:00
AnicJov
4d9837d792 Chess: Add ability to replay moves
This patch allows the user to go back and forward in move history
to replay moves from the game. This is view-only however, and as soon
as a move is made the board returns to it's current state. This will
work well for replaying games loaded in with PGN files, once that's
implemented.
2020-12-10 20:40:51 +01:00
AnicJov
cf8fce368a Chess: Added ability to copy board state as FEN
You can now copy the board state as Forsyth-Edwards Notation. You can
then paste this into other chess programs/games, or into ours when
it gets implemented.
2020-12-10 20:40:51 +01:00
AnicJov
b000a884c8 Chess: Change keyboard shortcuts
Use some better keyboard shortcuts that make more sense and are more
common, instead of random function keys.
2020-12-10 20:40:51 +01:00
AnicJov
fe1628746c Chess: Add ability to export game as PGN file
This patch adds an option to the menubar for exporting the current
game as a PGN file. This file can then be read by other chess
programs (and ours eventually) to replay the game or analyze it.
The implementation is mostly PGN spec compliant, however the code
could use some more work. Particularly the `const_cast`s...
But it's a start. :^)

Fixup: Chess: Fixed hard-coded home path in unveil() call

Fixup: Chess: Removed castling flags from Move struct

The castling detection logic is done inside Move::to_algebraic()
now, removing the need for is_castle_short and is_castle_long flags
inside of the Move struct.
2020-12-06 15:51:34 +01:00
AnicJov
01b62cc7f4 Chess: Added ability to resign and flip the board
This patch adds options to the app's menubar to resign the game and
flip the board.
2020-12-06 15:51:34 +01:00
AnicJov
694f68ab86 Chess: Change default piece set
As much as I like the "test" piece set, I think "stelar7" is a much
better first impression for anyone opening the Chess game, so I
consider it a much more sensible default.
2020-12-06 15:51:34 +01:00
Brendan Coles
9f8a8e07c2 Games: Use pledge and unveil 2020-11-02 13:16:01 +01:00
Brendan Coles
7c5e488de2 Games: Use GUI::Icon::default_icon to set application icon 2020-11-01 10:29:27 +01:00
Brendan Coles
e569f7fd1c Applications: Use application icons for dialog windows 2020-10-31 13:48:15 +01:00
Linus Groh
82956a08b3 LibCore: Rename File::ShouldCloseFile{Description => Descriptor}
From https://youtu.be/YNSAZIW3EM0?t=1474:

"Hmm... I don't think that name is right! From the perspective of
userspace, this is a file descriptor. File description is what the
kernel internally keeps track of, but as far as userspace is concerned,
he just has a file descriptor. [...] Maybe that name should be changed."

Core::File even has a member of this enum type... called
m_should_close_file_descriptor - so let's just rename it :^)
2020-10-25 13:59:41 +01:00
Linus Groh
bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
Peter Elliott
274be68102 Chess: Allow resizing Chess using resize_aspect_ratio(1,1) 2020-08-23 01:05:22 +02:00
Peter Elliott
b0ffd4e946 Chess: Optionaly display coordinates at edge of board 2020-08-23 01:05:22 +02:00
Peter Elliott
1e57e32a93 ChessEngine: Add ChessEngine
This engine is pretty bad, but doesn't let itself get checkmated
2020-08-21 12:26:30 +02:00
Peter Elliott
fb62eed058 Chess: Add support for UCI engines 2020-08-21 12:26:30 +02:00
Peter Elliott
d2cb5e0f48 Chess: Refactor game logic into LibChess for use in engines
In the future UCI protocol stuff will also go into LibChess.
2020-08-21 12:26:30 +02:00
Peter Elliott
ffece9cfba Chess: Add serialization of moves and squares 2020-08-21 12:26:30 +02:00
Peter Elliott
6c2d0dea91 Chess: Fix generation of promotion moves 2020-08-21 12:26:30 +02:00
Tibor Nagy
e3d1ea34ff Games: Add missing separators to the application menus 2020-08-17 17:39:56 +02:00
Abu Sakib
1ec0f54de1 Chess: Add Help menuitem 2020-08-17 12:12:19 +02:00
Brian Gianforcaro
eed9f2bac3 Chess: Uninitialized member in PromotionalDialog, found by Coverity 2020-08-17 09:17:57 +02:00
Peter Elliott
d90f8abe9d Chess: Add new ways to draw.
new ways:
Insufficent material
Threefold/Fivefold repitition
50 move/75 move rule
2020-08-15 20:54:02 +02:00
Peter Elliott
abd1f7e563 Chess: Add pawn promotion to any piece 2020-08-15 20:54:02 +02:00
Peter Elliott
9d40472721 Chess: Add En-passant 2020-08-15 20:54:02 +02:00
Peter Elliott
e91542a3cf Chess: Add menu options for setting board theme and piece set 2020-08-15 20:54:02 +02:00
Peter Elliott
7b71f4759f Chess: Highlight last move 2020-08-15 20:54:02 +02:00
Peter Elliott
f2c1782d86 Chess: Add win/draw conditions, and display them. 2020-08-15 20:54:02 +02:00
Peter Elliott
e05372cee2 Chess: Add legal move checking 2020-08-15 20:54:02 +02:00
Peter Elliott
7333916252 Chess: Add basic ChessWidget and ugly piece set 2020-08-15 20:54:02 +02:00