summaryrefslogtreecommitdiff
path: root/Userland/Games
AgeCommit message (Collapse)Author
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.
2023-03-13Everywhere: Remove unintentional partial stream reads and writesTim Schumacher
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
2023-03-13BrickGame: Add a "Pause" option to the Game menuKarol Baraniecki
This is how the menu looks like after this commit: β”Œβ”€β”€β”€β”€β” β”‚Gameβ”‚ Help β”œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ New game F2 β”‚ β”‚ Toggle pause P β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Quit Alt+F4 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2023-03-13BrickGame: Show a box with "Paused" in it when the game is pausedKarol Baraniecki
Looks a bit like this: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Paused β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2023-03-13BrickGame: Disallow manual piece movement while pausedKarol Baraniecki
This make the pause feature feel much better.
2023-03-13BrickGame: Stop bricks from falling when pausedKarol Baraniecki
Allows for pausing with either the `P` or `Escape` keys. In this commit you can still rotate pieces when paused - which makes for an interesting "stop-time" cheat mechanic, but probably isn't yet what we want.
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-06Everywhere: Stop using NonnullOwnPtrVectorAndreas Kling
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06Everywhere: Remove NonnullRefPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-04Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()Andreas Kling
The only remaining clients of this API are specific to bitmap fonts and editing thereof.
2023-02-25Everywhere: Use _{short_,}string to create Strings from literalsLinus Groh
2023-02-21Userland: Fix remaining smart pointer const-correctness issuesAndreas Kling
2023-02-18LibGUI+Userland: Stop returning Layout from `Widget::(try_)set_layout()`Sam Atkins
Nobody uses this return value any more. It also lets us remove a whole bunch of `(void)` casts. :^)
2023-02-18Userland: Specify margins and spacing in the GUI::Layout constructorSam Atkins
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.