Commit graph

296 commits

Author SHA1 Message Date
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Umar Haroon
53e1ee2cb7 2048: Added Redo Support 2021-05-11 10:22:27 +01:00
Linus Groh
83d980ab9e Chess+Help: Remove erroneous ampersand from app name
This is not applicable here, the alt shortcut is set elsewhere.
2021-05-07 20:37:28 +01:00
Timothy Flynn
e8b508516a Solitaire: Decrease new game animation delay
The current setting is an awful long time to wait for a game to start.
2021-05-05 21:38:45 +02:00
Timothy Flynn
a07c178a02 Solitaire: Add statusbar segment to display elapsed time
The timer begins after the new-game animation ends, and stops when
either the game-over animation begins or the new-game animation is
started again.
2021-05-05 21:38:45 +02:00
Timothy Flynn
b2576b7e45 Solitaire: Add a GUI::Statusbar to the Solitaire window
This will display the score (instead of updating the window title) and
any hovered action text.
2021-05-05 21:38:45 +02:00
Timothy Flynn
59193dd6b3 Solitaire: Only start timer when the timer event is needed
The timer is no longer used to trigger a paint event for all updates; it
is only used to paint the new-game and game-over animations. So only run
the timer during those events.
2021-05-05 21:38:45 +02:00
Timothy Flynn
4fc9c1d710 Solitaire: Refactor painting logic to accomodate to-be-added widgets
A series of events led to this change: The goal is to add more widgets
to the Solitaire GML, such as a GUI::Statusbar. To do so without this
change, the window ends up with some black artifacts between the main
Solitaire frame and the added elements, because the GML specifies the
main widget to have fill_with_background_color=false. However, setting
that property to true results in the background color of the widget
interferring with the Solitaire frame trying to manually paint its
background green. This results in flickering and some elements in the
Solitaire frame being painted over by the main background color.

To avoid all of that behavior, this sets fill_with_background_color=true
and the Solitaire frame's background color to green in the GML. Further,
the frame now only queues a paint update on the specific Gfx::Rect areas
that need to be updated. This also means we no longer need to track if a
stack of cards is dirty, because we only trigger a paint event for dirty
stacks.
2021-05-05 21:38:45 +02:00
Timothy Flynn
bb7b76e505 Solitaire: Don't invoke srand multiple times
This doesn't need to be invoked each time the game wants something
random.
2021-05-05 21:38:45 +02:00
Timothy Flynn
a540ec3519 Solitaire: Convert Solitaire GUI to a frame
Looks a bit nicer as a frame with inset edges.
2021-05-05 21:38:45 +02:00
Timothy Flynn
0ff4eec8a8 Solitaire: Convert Solitaire window to be created from GML
No functionial change here, but this more easily allows for adding GUI
elements to the Solitaire window. This nests the SolitaireWidget as a
child of the main window's widget so that the SolitaireWidget does not
color the entire window green when it paints its background.
2021-05-05 21:38:45 +02:00
Timothy Flynn
e1492e9a62 Solitaire: Place files in Solitaire namespace and rename main widget
The purpose is to allow the Solitaire widget to be used in GML. The
macro to register a widget requires a namespace, so this moves all files
in the application to the Solitaire namespace. This also renames the
SolitaireWidget class to Game - this is to avoid the redundancy /
verbosity of typing "Solitaire::SolitaireWidget", and matches many other
games in Serenity (Breakout, 2048, etc.).
2021-05-05 21:38:45 +02:00
Timothy Flynn
15f0ee1727 Solitaire: Replace self-owned timer with Core::Object's timer
This is just a bit nicer than owning a separate timer in the Solitaire
application because LibCore will prevent timer events from firing when
e.g. the window is not visible. Therefore SolitaireWidget doesn't need
need to check for such conditions.
2021-05-05 21:38:45 +02:00
Timothy Flynn
cfc3a2ebac Solitaire: Bump stacked cards down to reveal suit
Stacks of cards currently cover the suit completely and players must
click-and-drag cards out of the way to see the suit beneath other cards.
This bumps the stacks down a bit to let players peek the suit without
having to take any action.
2021-05-05 21:38:45 +02:00
Andreas Kling
04c3cddb1e Snake: Spruce up the GUI a tiny bit
Give the game window a GUI::Frame appearance, and make sure the
menus have Alt shortcuts. :^)
2021-05-04 17:32:19 +02:00
Andreas Kling
62125796c3 Minesweeper: Tweak main UI layout a little bit
Move the clock/flag icons closer to their respective text labels.
2021-05-03 18:07:35 +02:00
Andreas Kling
6e4e3cefb2 Minesweeper: Add a tasteful separator line between menubar and UI 2021-05-03 17:08:28 +02:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Matthew Olsson
88cfaf7bf0 LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
2021-05-02 22:48:06 +02:00
Andreas Kling
4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Andreas Kling
d8787e0e12 Chess: Alt shortcuts and book title capitalization in menus 2021-04-14 21:32:37 +02:00
Andreas Kling
cfe7f6fe50 Pong: Alt shortcuts in top-level menus 2021-04-14 21:25:02 +02:00
Andreas Kling
8529053ffe 2048: Alt shortcuts and book title capitalization in menus 2021-04-14 21:25:02 +02:00
Jean-Baptiste Boric
900fe5633a Minesweeper: Use one premade mine palette for all mine widgets
Fixes #6283
2021-04-13 21:52:34 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Andreas Kling
a7ad0f14bf Minesweeper: Fix UI layout and focus behavior
Click-to-focus was visually annoying. Switch to tab-to-focus.
2021-04-06 17:55:47 +02:00
Andreas Kling
3bb36dbd3f 2048: Give the board view a nice GUI::Frame look :^) 2021-04-05 11:42:54 +02:00
lucastarche
17b7779271 Chess: Added option to toggle showing moves 2021-03-27 23:37:06 +01:00
lucastarche
42f7f9d0f8 Chess: Show available moves from current piece 2021-03-27 23:37:06 +01:00
Andreas Kling
78b12e1521 Userland: Turn all application menus into window menus :^) 2021-03-25 22:14:09 +01:00
Andreas Kling
e0f32626bc LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888x
The previous names (RGBA32 and RGB32) were misleading since that's not
the actual byte order in memory. The new names reflect exactly how the
color values get laid out in bitmap data.
2021-03-16 11:50:03 +01:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Brendan Coles
44aeab43a0 Chess: Allow right click to cancel drag move while dragging a piece 2021-02-18 12:52:11 +01:00
Brendan Coles
a11c065e82 Chess: pledge thread
`thread` is required by the file browse dialog
when importing or exporting PGN files.
2021-02-18 10:23:08 +01:00
Linus Groh
b55c9f6bba Conway: Set minumum window size to game columns x rows
The game renders no cells when the game widget height is < rows or width
is < columns, so let's set a minimum window size here.
2021-02-18 07:34:47 +01:00
Ben Wiederhake
3179065466 Conway: Add interactivity 2021-01-22 22:14:08 +01:00
Ben Wiederhake
e849c62f55 Conway: Don't run misleading srand()
The randomness is taken from arc4random() which is independent from srand/rand/rand_r,
so there's no need to call srand(). At best, it confuses the reader to think that
there would eventually be a call to rand().
2021-01-20 19:19:34 +01:00
Andreas Kling
d312011708 Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"
Now that WindowServer broadcasts the system theme using an anonymous
file, we need clients to pledge "recvfd" so they can receive it.

Some programs keep the "shared_buffer" pledge since it's still used for
a handful of things.
2021-01-16 19:30:32 +01:00
Andreas Kling
c71807a3fc Everywhere: Convert a handful of String::format() => formatted() 2021-01-16 14:52:04 +01:00
TheMorc
b2086c8d77 Demos+Games: Pledge "sendfd" in demos and games 2021-01-15 18:47:07 +01:00
Andreas Kling
20915795a8 Everywhere: Pledge "sendfd" in WindowServer client programs
This is needed for the new way we transfer window backing stores.
2021-01-15 14:10:32 +01:00
Andreas Kling
aa939c4b4b Games: Move to Userland/Games/ 2021-01-12 12:04:23 +01:00