Commit graph

627 commits

Author SHA1 Message Date
dgaston edb10aa17a Chess: Add time controls
This commit adds functionality to the new game dialog to allow time
controls to be selected. The game logic is updated to take into account
losing on time, time bonuses for moves, and exporting the time control
to PGN.
2024-06-05 20:45:38 -04:00
dgaston 215d348600 Chess: Add new game widget
This change paves the way for adding options such as time controls and
variants when creating a new game.
2024-06-05 20:45:38 -04:00
dgaston 2d5cb1e02d Chess: Add display widget for moves
Adds a TextEditor widget to the chess application to display move
history. It is updated whenever Board::apply_move is called to reflect
the current board state.
2024-05-22 23:24:45 -06:00
dgaston 55fe04a6fa Chess: Port application to GML
This commit ports the chess application to GML in order to
facilitate the addition of widgets in the future.
2024-05-16 07:41:05 +01:00
dgaston 10dbadced8 Chess: Add chess application to Chess namespace
This is required to port the application to GML.
2024-05-16 07:41:05 +01:00
dgaston 739cc4b8dc LibChess: Fix crash when importing PGN
Fix the incorrect parsing in `Chess::Move::from_algebraic`
of moves with a capture and promotion (e.g. gxf8=Q) due to
the promoted piece type not being passed through to the
`Board::is_legal` method. This addresses a FIXME regarding
this issue in `ChessWidget.cpp`.
2024-05-11 07:41:57 +01:00
dgaston 8f784243a1 Chess: Improve PGN importing
This commit replaces the `import_pgn` implementation
with a more resiliant parser to handle various edge
cases and give helpful error messages instead of crashing.
2024-05-06 19:25:07 +01:00
Dan Klishch 5ed7cd6e32 Everywhere: Use east const in more places
These changes are compatible with clang-format 16 and will be mandatory
when we eventually bump clang-format version. So, since there are no
real downsides, let's commit them now.
2024-04-19 06:31:19 -04:00
Andreas Kling 1cb5385a29 LibCore: Stop obsessing about tiny OOMs in Core::Timer
Work towards #20405
2024-04-17 07:16:52 +02:00
Aryan Baburajan 72a5c8f3d8 TwentyFourtyEight: Port to GML compilation 2024-04-15 14:01:13 +02:00
Aryan Baburajan 1c75aa98b8 2048: Rename to TwentyFourtyEight for GML compatibility 2024-04-15 14:01:13 +02:00
Shannon Booth e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Cubic Love 15d6b3017a Snake: Set Snake as default skin
Set 'Snake' as the default skin for its aesthetic appeal and color
harmony with the game's icon.
2024-03-13 22:05:31 -06:00
Hugh Davenport 8740a8c056 FlappyBug: Allow shortcuts for quitting and help
As the menus show that ALT-F4 quit and F1 brings up help, we should
make the application do that instead of just undocumented ESC
2024-02-19 00:09:34 +01:00
Jakub Pyszczak ac49617183 2048: Ensure that correct font is requested
Previously, during the start of the game BoardView component tried to
get the font from the database passing empty string as a parameter.
It caused a debug message informing user that the lookup failed.
2024-02-18 21:34:38 +01:00
Sam Atkins c9fb3e07d2 BrickGame: Make action shortcuts work when the game is paused
We previously never called event.ignore(), so the keydown event for F2
or F11 etc would be consumed by the BrickGame widget instead of
bubbling up. Now you can start a new game, or escape fullscreen mode,
even if you've paused the game. :^)
2024-02-11 21:13:06 +00:00
Sam Atkins 7e8cfb60eb AK+Userland: Return String from human_readable_[digital_]time() 2024-01-25 09:07:32 +01:00
Hugh Davenport 7dba28fce8 MasterWord: Add fullscreen option
Required allowing resizing. Perhaps an additional setting to allow
fullscreen, but not resizing? Anyhow, the game still plays well if
you can resize and works as expected.
2024-01-14 15:18:43 -07:00
Hugh Davenport 64edf6913f Games: Add fullscreen option 2024-01-14 15:18:43 -07:00
Sam Atkins 4ed5287792 Solitaire: Hide solve button when game ends
`on_game_start` is not called until the player makes a move, so waiting
until then means that the solve button would still be visible when
starting a new game after completing one. By hiding the button in
`on_game_end`, this happens when the game-over animation starts playing
instead.
2024-01-12 17:16:19 -07:00
Sanil 343d6b001f Hearts: Port to GML compiler 2024-01-09 17:23:39 +01:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
david072 6a4e3d9002 Solitaire: Ability to automatically solve the end of the game
In Solitaire, when the stock stack is empty and all cards have been
revealed, finishing the game is trivial, since you only need to sort the
already visible cards onto the foundation stacks. To simplify this, the
game will now give you the option to finish the game automatically if
these conditions are met. It then sorts the cards with a delay of 100ms
between each card.
2023-12-10 00:02:32 +01:00
Brandon Woodford cdbc2a0dcd Snake: Use new GML compiler 2023-12-07 02:39:20 +01:00
david072 bac7c057e9 Spider: Make non-movable cards disabled :^)
In Spider, cards that can't be moved are now shown as disabled using the
helpers in LibCards. This makes it much easier to see what can be moved
and to where, overall improving the game significantly!
2023-11-24 11:45:32 +00:00
david072 65b9cb63ee Spider: Port to the GML compiler 2023-11-24 11:45:32 +00:00
Tim Schumacher a2f60911fe AK: Rename GenericTraits to DefaultTraits
This feels like a more fitting name for something that provides the
default values for Traits.
2023-11-09 10:05:51 -05:00
Strawby 387decbb01 Spider: Add Manual link to the help-context-menu 2023-11-08 16:26:23 +00:00
Sam Atkins 0875ef770f Chess: Make chess widget resilient to missing piece images
Display a warning when some images are missing, instead of crashing.

Also, don't keep old images around when loading a new set, and make use
of get_piece_graphic() more often.
2023-11-07 19:44:11 +01:00
0GreenClover0 88cc019275 FlappyBug: Unify the way of getting the final score
Previously we would display the score rounded to the nearest integer,
but save the high score by using a static_cast<u32>, which would
always round the score down. This could lead to the final score being
higher than the new high score, when they should be equal.
Now we always round the score to the nearest integer.
2023-11-01 10:43:55 +01:00
Andrew Kaster 1567332e34 Userland+Tests: Remove uses of direct file loading for BitmapFont
Route them through Core::Resource APIs instead.
2023-10-29 13:12:28 -06:00
tetektoza 4db9996cc0 Minesweeper: Port to GML compilation
This patch ports minesweeper to GML compilation,
and introduces a few changes made to associated files.
2023-10-24 21:47:18 +02:00
hanaa12G 10428fc7ce Solitaire: Port to GML compilation 2023-10-23 16:13:05 +01:00
Tim Ledbetter 881581820f GameOfLife: Allow pressing escape to clear the selected pattern 2023-10-07 11:36:57 +02:00
Tim Ledbetter f25f2ba047 GameOfLife: Focus on the game board when not editing settings
This makes single key shortcuts work again :^)
2023-10-07 11:36:57 +02:00
Tim Ledbetter 649c7ee11f GameOfLife: Use the GML compiler 2023-10-07 11:36:57 +02:00
Sam Atkins b53a633388 Hearts: Paint player names in white when background is a dark color 2023-10-04 20:10:04 +02:00
toadkarter 4e2e2027c3 MasterWord: Use GML compiler 2023-10-02 21:31:06 +02:00
Tim Ledbetter 12adaac08d GameOfLife: Don't toggle cells on mouse move when placing patterns
Previously, it was very easy to inadvertently toggle cells when
placing a pattern by dragging the mouse slightly.
2023-09-27 19:12:14 +02:00
Tim Ledbetter 6eaae726fa GameOfLife: Clear the selected pattern when the game starts running 2023-09-27 19:12:14 +02:00
Tim Ledbetter 4b48757586 GameOfLife: Allow ctrl+click to place multiple patterns 2023-09-27 19:12:14 +02:00
Tim Ledbetter b4e134cb52 Userland: Use non-fallible EventReceiver::add() where possible 2023-09-25 10:58:31 +02:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Tim Ledbetter 9cd3477763 GameOfLife: Replace DeprecatedString with String 2023-09-18 11:12:25 -06:00
Tim Ledbetter a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Cubic Love 2767fa78f8 Solitaire: Rearrange Help Menu
Rearrange the Help menu actions so they're in the same order as other
application's Help menus.
2023-09-17 17:26:32 -06:00
Tim Ledbetter 19dfdeeaec GameOfLife: Add a tick counter to the status bar
The counter is incremented after each new generation and reset
whenever any cell on the board is toggled. Resizing the board
does not reset the tick count.
2023-09-17 16:51:58 -06:00
Tim Ledbetter 0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Tim Ledbetter 3c9dee5d5a GameOfLife: Use the same play/pause action in the menu and toolbar
This prevents the menu and toolbar action state getting out of sync,
which could happen previously. The menu item also now shows the
appropriate icon rather than a checkbox.
2023-09-16 11:06:33 +02:00
Tim Ledbetter ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00