summaryrefslogtreecommitdiff
path: root/Userland/Games
AgeCommit message (Collapse)Author
2023-05-27Chess+ChessEngine: Fix stockfish by setting correct blocking flagBen Wiederhake
Stockfish apparently cannot handle non-blocking I/O, and it does not make sense to assume that all chess engines can do so. Fixes #18946.
2023-05-24Userland: Remove remaining users of Duration::now_realtime()kleines Filmröllchen
This is a clear sign that they want to use a UnixDateTime instead. This also adds support for placing durations and date times into SQL databases via their millisecond offset to UTC.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-23LibGfx+Everywhere: Change `Gfx::Rect` to be endpoint exclusiveJelle Raaijmakers
Previously, calling `.right()` on a `Gfx::Rect` would return the last column's coordinate still inside the rectangle, or `left + width - 1`. This is called 'endpoint inclusive' and does not make a lot of sense for `Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would return 4 as its right side. This same problem exists for `.bottom()`. This changes `Gfx::Rect` to be endpoint exclusive, which gives us the nice property that `width = right - left` and `height = bottom - top`. It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly the same. All users of `Gfx::Rect` have been updated accordingly.
2023-05-23Chess: Make the resign button have no effect after the game endsTim Ledbetter
2023-05-23Chess: Don't ask the engine to make a move if the game is finishedTim Ledbetter
Previously, the engine would attempt to make a move if the engine was changed after the game had ended. This change also allows the player to always flip the board when the game is finished, instead of only being able to flip the board on their turn.
2023-05-23Base+Userland: Apply Human Interface Guidelines to Object textthankyouverycool
Corrects a slew of titles, buttons, labels, menu items and status bars for capitalization, ellipses and punctuation. Rewords a few actions and dialogs to use uniform language and punctuation.
2023-05-10Chess+GameSettings: Optionally highlight the king when in checkTim Ledbetter
When either king is in check, its square is now highlighted with a red background. This behavior can be toggled in GameSettings.
2023-05-09AK: Add the `Input` word to input-only buffered streamsLucas CHOLLET
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-07Chess: Slightly improve error propagation during startupBen Wiederhake
2023-05-07Chess: Avoid IODevice and DeprecatedFileBen Wiederhake
2023-05-06Base+Snake: Capitalize snake skin namesCubic Love
In Snake, the menu for choosing a skin looked messy due to inconsistent capitalization. Two skins names were entirely lowercase. For the sprite-based skins, the menu takes the name of each skin's directory, so I have capitalized these. Capitalizing the original snake skin required more change than simply renaming a directory.
2023-05-05LibChess+Chess: Ensure no pawns have moved when invoking 50 move ruleTim Ledbetter
The 50 and 75 move rules are no longer invoked if a pawn has advanced in the last 50 or 75 moves respectively.
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
2023-05-05Base+Minesweeper: Move assets from /icons/ to /graphics/Cubic Love
The graphics directory is a more suitable home for game assets.
2023-05-05Base+FlappyBug: Move assets from /icons/ to /graphics/Cubic Love
The graphics directory is a more suitable home for game assets.
2023-05-05Base+ColorLines: Move assets from /icons/ to /graphics/Cubic Love
The graphics directory is a more suitable home for game assets.
2023-05-05Base+LibChess: Move assets from /icons/ to /graphics/Cubic Love
The graphics directory is a more suitable home for game assets.
2023-05-03Chess: Spawn new engine process immediately after engine is selectedTim Ledbetter
A new engine process is now started immediately, rather than waiting until a move needs to be made. This means that if the engine is playing as black, it can start up while the human player is making a move. This is noticable with stockfish, which can be slow to start up.
2023-05-03Chess: Allow stockfish to be used if availableTim Ledbetter
The stockfish chess engine can now be selected from the engine menu if the port has been installed.
2023-04-30LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStylethankyouverycool
Previously, Frames could set both these properties along with a thickness to confusing effect: Most shapes of the same shadowing only differentiated at a thickness >= 2, and some not at all. This led to a lot of creative but ultimately superfluous choices in the code. Instead let's streamline our options, automate thickness, and get the right look without so much guesswork. Plain shadowing has been consolidated into a single Plain style, and 0 thickness can be had by setting style to NoFrame.
2023-04-30LibGUI: Remove Label icons and replace instances with ImageWidgetthankyouverycool
These icons are a relic of GLabel and were never implemented to accomodate both image and text. This convenience can always be added in the future, but no current instance assumes or needs it, so let's replace them all with ImageWidget to show clearer intent.
2023-04-30LibGUI+Userland: Port Labels to Stringthankyouverycool
2023-04-29Chess: Don't attempt to update the board when clicking out of boundsTim Ledbetter
Previously, clicking outside the bounds of the board when the window was resized, could cause a crash.
2023-04-29Chess: Display appropriate dialog when engine move ends the gameTim Ledbetter
A dialog is now displayed when an engine move results in a checkmate or a draw. In the case of threefold repetition or the fifty move rule, the engine will always accept a draw. A human player is asked if they would like to accept a draw.
2023-04-28Chess: Send a ucinewgame command to the engine on starting a new gameTim Ledbetter
This fixes an issue where the engine would crash when starting a new game playing as white.
2023-04-24LibChess: Return ErrorOr<String> from to-algebraic/fen methodsSam Atkins
Also, avoid creating temporary Strings for numbers, and stop appending empty StringViews.
2023-04-24LibChess: Add and use Square::{file,rank}_char() methodsSam Atkins
This saves us having to build and allocate a String, just to then use one character of it.
2023-04-21Spider: Fix crash when completing a deckJamie Mansfield
This resolves a regression caused by 8a48246ed1a93983668a25f5b9b0af0e745e3f04.
2023-04-20Chess: Gracefully handle ChessEngine disconnectionsTim Ledbetter
The GUI now tracks when it becomes disconnected from ChessEngine. If not currently waiting for a move from ChessEngine, it will automatically reconnect on the next engine move. If a disconnection occurs while waiting for a move, the player is asked whether they want to try again or not.
2023-04-20Chess: Send a quit command to ChessEngine when it is no longer in useTim Ledbetter
The chess GUI now instructs the ChessEngine to gracefully exit by sending a UCI quit command.
2023-04-19LibGUI+Userland: Make Menu::*add_submmenu take name using new stringKarol Kosek
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-04-18MasterWord: Use numeric InputBox for settingsthankyouverycool
And use proper ellipses and capitalization in related action text.
2023-04-18LibGUI+Userland: Improve error and font handling for InputBoxthankyouverycool
Adds fallible factories, ports DeprecatedString, and rebuilds the layout to accomodate system font changes.
2023-04-17Minesweeper: Simplify resizing game windowthankyouverycool
Instead of propagating field size changes to main and manually calculating window size, use auto shrink to automatically resize the window after changes to the board.
2023-04-17MasterWord: Rectify resizing game windowthankyouverycool
Previously resizing the window did not take into account the height of the status bar. The board now fixes its size on reset and allows the Window to auto shrink to the perfect dimensions.
2023-04-17MasterWord: Set icon before showing windowthankyouverycool
2023-04-15LibGfx+Userland: Add width_rounded_up() helperthankyouverycool
2023-04-09Everywhere: Remove unused DeprecatedString includesBen Wiederhake
2023-04-09BrickGame: Remember the "Show Shadow Piece" setting between executionsKarol Baraniecki
by using the ConfigServer.
2023-04-09BrickGame: Add a menu option to disable the shadow drop hintKarol Baraniecki
2023-04-09BrickGame: Show where a piece would end up when after a fast dropKarol Baraniecki
To show it to the player, draw a faint outline of where the piece would end up.
2023-04-09BrickGame: Use title case in menu items consistentlyKarol Baraniecki
by fixing the "Toggle pause" option
2023-04-09BrickGame: Add a missing [[nodiscard]] for consistencyKarol Baraniecki
Every other function there returning a RenderRequest has one, so might as well. Don't add it to check_and_remove_full_rows(), because it's only used inside other functions returning a RenderRequest, when it's already clear a render will happen.
2023-04-09BrickGame: Port from DeprecatedStrings to StringsKarol Baraniecki
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-20Snake: Implement image-based skinsSam Atkins
Co-authored-by: HawDevelopment <hawdevelopment@gmail.com>
2023-03-20Snake: Move geometry types into Geometry.h and add Direction enumSam Atkins
2023-03-20Snake: Remember if game was paused when picking colorSam Atkins
If we were paused before, don't start the game after closing the dialog.