Commit Graph

359 Commits

Author SHA1 Message Date
Sam Atkins
aac2488d5c LibCards+Games: Replace card "value" int with a Rank enum
Because `card->value() == 11` is a lot less clear than `card->rank() ==
Cards::Rank::Queen`, and also safer.

Put this, along with the `Suit` enum, in the `Cards` namespace directly
instead of inside `Cards::Card`. Slightly less typing that way.
2022-08-22 12:50:41 +02:00
Sam Atkins
163a74e3e2 Spider: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Sam Atkins
c709dc154f Hearts: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Sam Atkins
f9f25271b3 Solitaire: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Lucas CHOLLET
e8115bfdb1 Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
bee5bcda73 Everywhere: Replace hardcoded anon's uid in unveil path with %uid 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
c5b7c9f479 LibCore+LaunchServer: Move portal directory to /tmp/user/%uid
The `/tmp/user` directory is owned by root, this solution prevents
malicious users to interfere with other users' portals.

This commit also moves `launch`'s portal in the user directory.
2022-08-14 21:52:35 +01:00
Karol Kosek
9d7345d17b Chess: Import/Export chessboards using LibFileSystemAccessClient
With this change, the wpath and cpath promises as well as unveiling
user's entire home directory are no longer needed. :^)
2022-08-08 22:03:30 -04:00
thankyouverycool
517c03f920 Minesweeper: Update GML and fix layout issues
Converts Minesweeper's main widget to GML, polishes the custom
game window, formats the clock as human readable digital time, and
defers invoking Field's callback until the main widget has finished
relayout. Fixes inability to downsize the main window when shrinking
field size.
2022-08-05 13:55:13 +02:00
Karol Kosek
6148fd4ed5 Minesweeper: Remove decimal point from the time label
The timer was updating fast enough to be a little distracting for me.
2022-07-24 14:09:48 +01:00
Lucas CHOLLET
70846d701c LaunchServer+SystemServer: Move the portal to a user-specific directory
Various changes are needed to support this:
 - The directory is created by Core::Account on login (and located in
   /tmp).
 - Service's sockets are now deleted on exit (to allow re-creation)
 - SystemServer needs to handle SIGTERM to correctly destroy services.
2022-07-19 11:15:14 +01:00
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
FrHun
f59c167bb0 Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
FrHun
8dd08d47f1 Applications: Remove usages of deprecated implicit conversions
These deprecated conversions are currently in place to make the system
compile, but they are to be removed soon. This prepares that.
2022-06-28 17:52:42 +01:00
Andreas Kling
45de16f195 Userland+Base: Remove Breakout and Pong games
These games were not very playable and definitely not fun.
2022-06-15 17:15:04 +02:00
MacDue
177d9b2a5a Pong: Paint ball antialiased 2022-06-05 16:16:17 +01:00
MacDue
5cb7e4f2f0 Chess: Paint move marker antialiased 2022-06-05 16:16:17 +01:00
MacDue
e2de02d2bb Breakout: Paint ball antialiased 2022-06-05 16:16:17 +01:00
Linus Groh
173dcfb7cb Everywhere: Fix a bunch of typos 2022-05-29 15:22:00 +02:00
Paweł Łukasik
01c7158ffe MasterWord: Check guesses against the word list
Previously guesses were not checked which allowed guesses
like 'aaaaa' to be entered.

Currently there's an option to set if a guess should be checked
against the dictionary and rejected if it doesn't exist there.

Additionally settings from Game menu have been moved to its own
entry - Settings.
2022-05-26 21:44:58 +01:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Martin Frederic
3e6c083754 Pong: Explicitly clear held keys in Game::reset()
The paddle's movement is determined by the currently held keys. A key
is no longer considered held when a matching keyup_event() fires.
However, the event does not fire when the timer has stopped (e.g. due to
a game over condition), which can result in the paddle keeping its
former direction and moving on its own -- even after the player started
a new game. Therefore, any held keys will be cleared explicitly.
2022-04-15 00:13:09 +02:00
Martin Frederic
02d2a300e7 Pong: Restart timer if necessary
When the player runs into a game over condition, Game's timer is
stopped. In order for reset() to work properly, the timer has to be
started again. The condition is tracked via a new member variable,
`m_game_over`. To prevent confusion, game_over() has been renamed to
show_game_over_message().
2022-04-15 00:13:09 +02:00
Martin Frederic
0abdeb474f Pong: Extend Game::reset()
Previously, the method reset the ball and the paddles. Now, it will
also reset and redraw the scores and update the ball's rect.
2022-04-15 00:13:09 +02:00
Martin Frederic
740beea5ce Pong: Add 'New Game' action
This declares Game::reset() public and lets the menu action invoke it.
2022-04-15 00:13:09 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Lenny Maiorani
a51fce6c0f LibCards+Games: Change name of card type to card suit
Playing cards have a `suit` such as `hearts`/`diamonds`, not a
`type`. Make the internal naming consistent with the way playing cards
are typically named.
2022-03-18 23:49:34 +00:00
Lenny Maiorani
56046d3f9b Libraries: Change enums to enum classes in LibCards 2022-03-18 19:59:43 +01:00
Lenny Maiorani
f912a48315 Userland: Change static const variables to static constexpr
`static const` variables can be computed and initialized at run-time
during initialization or the first time a function is called. Change
them to `static constexpr` to ensure they are computed at
compile-time.

This allows some removal of `strlen` because the length of the
`StringView` can be used which is pre-computed at compile-time.
2022-03-18 19:58:57 +01:00
Joe Petrus
011b6df63a Games: Add MasterWord
A simple wordle clone.
2022-03-18 04:55:21 -07:00
Linus Groh
50ad8d2a5a Hearts: Add icon to settings action 2022-03-18 01:10:16 +01:00
Linus Groh
c19486172d Applications+Games: Drop ellipsis from settings action
There is no second step to complete after activating this action.
2022-03-18 01:10:16 +01:00
Linus Groh
fd60c9fac7 Games: Add reload icon to 'New Game' actions 2022-03-18 01:10:16 +01:00
Andreas Kling
a6a8ba80fc LibGfx: Rename Color::from_rgba() => Color::from_argb()
This matches the rename of RGBA32 to ARGB32. It also makes more sense
when you see it used with 32-bit hexadecimal literals:

Before:
    Color::from_rgba(0xaarrggbb)

After:
    Color::from_argb(0xaarrggbb)
2022-03-04 23:40:21 +01:00
Andreas Kling
5c4bb03926 LibGfx+GameOfLife: Remove Gfx::make_rgb() and its one user 2022-03-04 23:40:21 +01:00
thankyouverycool
3aa95dd4d5 LibGUI+Apps: Convert Statusbar Labels to Segments
Segments inherit from Button and let us add clickable widgets
to status bars. This patch also adds proportional, fixed and
autosized modes for segments and lets the status bar consume
all non-clickable segments for override text.
2022-02-24 19:09:41 +01:00
Lenny Maiorani
27c30ca063 Games: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-16 22:08:55 +00:00
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
Vitaly Dyachkov
32b8795091 LibConfig: Rename pledge_domains(String) => pledge_domain(String)
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
2022-02-11 18:06:39 +01:00
kleines Filmröllchen
6ee597369d Meta+Userland: Run the GML formatter on CI and pre-commit
Now that the GML formatter is both perserving comments and also mostly
agrees to the existing GML style, it can be used to auto-format all the
GML files in the system. This commit does not only contain the scripts
for running the formatting on CI and the pre-commit hook, but also
initially formats all the existing GML files so that the hook is
successfull.
2022-02-07 18:39:50 +01:00
Hendiadyoin1
fbb798f98c AK: Move integral log2 and exp to IntegerMath.h 2022-02-06 17:52:33 +00:00
kleines Filmröllchen
1a8c8d2383 Chess: Don't use Vector in a literal iterator 2022-01-28 23:40:25 +01:00
David Lindbom
1e773256bf Snake: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
3a197eea92 Pong: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
ae6d326388 Minesweeper: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
7cb713e043 Hearts: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
2cb0a35dbe GameOfLife: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
570d63b601 FlappyBug: Add link to help pages in menu 2022-01-13 03:45:17 -08:00