summaryrefslogtreecommitdiff
path: root/Userland/Games
AgeCommit message (Collapse)Author
2023-01-22LibCards+Games: Return ErrorOr from CardStack::add_all_grabbed_cards()Sam Atkins
...and CardGame::pick_up_cards_from_stack() which is its only caller.
2023-01-22LibCards+Games: Return ErrorOr from deck-creation factory functions :^)Sam Atkins
Also, be smarter about appending cards to the deck: we can unchecked_append them to the deck, since we already ensured enough capacity earlier.
2023-01-22LibCards+Game: Return ErrorOr from CardGame::drop_cards_on_stack()Sam Atkins
2023-01-22LibCards+Games+GamesSettings: Return ErrorOr from CardStack::push()Sam Atkins
Very few of these calls can propagate their errors yet, but one step at a time. :^)
2023-01-22LibCards+Solitaire: Rename `CardStack::move_to_stack()` -> `take_all()`Sam Atkins
`a.move_to_stack(b)` sounded too much like it moves a's cards to b, when it actually moves b's cards to a.
2023-01-20ColorLines: Use AK::shuffle() for shufflingSam Atkins
2023-01-15Spider: Confirm ending the current game in more situationsSam Atkins
As for Solitaire, we previously had a warning when trying to exit Spider while a game was in progress. This adds the same functionality to other actions that would end the current game: Starting a new one, or changing the number of suits. When changing the number of suits, we do apply the setting, so it will take effect for the next game that is started.
2023-01-15Solitaire: Confirm ending the current game in more situationsSam Atkins
We previously had a warning when trying to exit Solitaire while a game was in progress. This adds the same functionality to other actions that would end the current game: Starting a new one, or changing the number of cards drawn. When changing the number of cards drawn, we do apply the setting, so it will take effect for the next game that is started.
2023-01-13Userland: Remove a bunch of unveil calls on /sys/kernel/processesLiav A
These are not needed anymore since the introduction of the new get_root_session_id syscall.
2023-01-12LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOrSam Atkins
clang-format sure has some interesting opinions about where to put a method call that comes after a lambda. :thonk:
2023-01-12LibCore+Userland: Make Core::Timer::create_repeating() return ErrorOrSam Atkins
The FIXMEs must flow!
2023-01-07Chess: Port to `Core::Stream`Lucas CHOLLET
2023-01-07LibGUI+Userland: Rename `try_load_from_gml()` -> `load_from_gml()` :^)Sam Atkins
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07Userland: Replace all uses of `load_from_gml` with `try_load_from_gml`Sam Atkins
MOAR FIXMES! ;^)
2023-01-07LibFileSystemAccessClient: Rename try_* functions to try_*_deprecatedKarol Kosek
These functions return the deprecated `Core::File` class, so let's mark it as such to avoid possible confusion between future non try_* functions which will use Core::Stream family classes and to possibly grab someone's attention. :^)
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06Solitaire: Replace animation Card with manual paintingSam Atkins
Repeatedly allocation a new Card object is unnecessary, and makes propagating OOM awkward. We also don't need a full card, just which suit/rank it is and its position. So, let's save all the extra allocation and just paint the card bitmap directly.
2023-01-06Spider: Highlight valid target stack when hovering over itSam Atkins
This is largely copied and pasted from Solitaire. Moving this into LibCards somehow would be nice but I can't think of a nice way to do so right now.
2023-01-06Spider: Make Game creation fallibleSam Atkins
2023-01-06Spider: Save and load u32 config values as u32sSam Atkins
2023-01-06Solitaire: Save and load u32 config values as u32sSam Atkins
This removes a bunch of awkward i32 casts. Being able to read/write enum types directly would be even nicer, but I'm not going there right now. :^)
2023-01-06Solitaire: Make Game creation fallibleSam Atkins
2023-01-06LibCards+Games: Make `CardGame::add_stack()` fallibleSam Atkins
And while we're at it, handle the CardStack allocation (and failure thereof) internally.
2023-01-06Solitaire: Preview cards in a stack with the right mouse buttonTimothy Flynn
2023-01-06LibCards+Solitaire: Elevate card highlight management to the card stackTimothy Flynn
Instead of indicating which individual cards should be highlighted, card games now indicate which stack is highlighted. This lets the stack draw empty stacks with a highlight (e.g. the Foundation stack in Solitaire). If the stack is non-empty, the stack can delegate highlighting to the top-most card.
2023-01-05Games: Add a Cards Settings menu item to Hearts, Solitaire, and SpiderTimothy Flynn
2023-01-05Solitaire: Highlight cards beneath dragged cards that are valid targetsTimothy Flynn
If the card beneath the card currently being dragged is a valid drop target, we will highlight it to indicate this to the user.
2023-01-03LibGfx: Make Font::width() return a floatAndreas Kling
2023-01-02Solitaire: Add link to help pageEvan Smal
2023-01-01Snake: Make initialization from GML fallibleSam Atkins
Replace the C_OBJECT factory functions with a custom try_create() which loads the various bitmaps. Any failures there are now propagated.
2022-12-31Flood: Get the color scheme from the system themeimplicitfield
2022-12-31Everywhere: Move Base/res/terminal-colors to Base/res/color-schemesimplicitfield
2022-12-23Snake: Use a statusbar to display the current and high scoreTimothy Flynn
The food bitmaps would sometimes be placed underneath the score text, which was a bit hard to see. Use a statusbar like we do in other games like Solitaire. Note the default height change of the Snake window is to make the inner game widget fit exactly 20x20 cells.
2022-12-23Snake: Convert the game window to GMLTimothy Flynn
Unfortunately, GML widget registration requires a non-fallible construct method to create the widget. So this does a bit of manual error checking when loading the food bitmaps.
2022-12-23Snake: Move GUI into Snake namespace and rename SnakeGame to GameTimothy Flynn
The former is required for GML, and the latter is to avoid the verbosity and redundancy of Snake::SnakeGame (and matches most other games in the system).
2022-12-23Snake: Save configured base color to Snake's configuration fileTimothy Flynn
2022-12-23GameOfLife: Propagate errors while loading bmpericLemanissier
2022-12-19Snake: Ignore default keydown eventsBaitinq
Before this patch, all key down events except arrow keys or WASD were not propagated, so keyboard shortcuts in the application didn't work. This patch fixes this :))
2022-12-19Snake: Add snake color chooser game menu actionBaitinq
This patch makes use of a new "set_snake_base_color()" function to change the snake's base color to the picked value.
2022-12-19Snake: Don't hardcode the snake painting logicBaitinq
This patch adds a m_snake_base_color variable which dictates the color of the head of the snake and from which the rest of the snake color's are derived from by darkening the base color.
2022-12-19Snake: Add pause/continue game menu actionBaitinq
This patch adds an action in the Snake's game menu that allows for easy pausing/unpausing of the game state. In order to do this, the commit adds new pause()/start() functions in the SnakeGame class ;)
2022-12-14LibFileSystemAccessClient: Rename `try_save_file` =>Lucas CHOLLET
`try_save_file_deprecated` This precedes the addition of a new api using `Core::Stream`
2022-12-14MasterWord: Ignore unhandled keydown eventsSam Atkins
This makes Action shortcuts work again. :^)
2022-12-14Hearts: Ignore unhandled keydown eventsSam Atkins
This makes Action shortcuts work again. :^)
2022-12-14Chess: Ignore unhandled keydown eventsSam Atkins
This makes Action shortcuts work again. :^)
2022-12-14BrickGame: Ignore unhandled keydown eventsSam Atkins
This makes Action shortcuts work again. :^)
2022-12-14Solitaire: Ignore unhandled keydown eventsSam Atkins
This makes Action shortcuts work again. :^)
2022-12-14Minesweeper: Make a factory function for Field and propagate errorsAndreas Kling
This fixes a pleasant 8 FIXMEs. :^)
2022-12-14Snake: Make a factory function for SnakeGame and propagate errorsAndreas Kling
This fixes a whopping 29 FIXMEs. :^)
2022-12-12Games: Add ColorLinesOleg Kosenkov