Age | Commit message (Collapse) | Author |
|
...and CardGame::pick_up_cards_from_stack() which is its only caller.
|
|
Also, be smarter about appending cards to the deck: we can
unchecked_append them to the deck, since we already ensured enough
capacity earlier.
|
|
|
|
Very few of these calls can propagate their errors yet, but one step at
a time. :^)
|
|
`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.
|
|
|
|
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.
|
|
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.
|
|
These are not needed anymore since the introduction of the new
get_root_session_id syscall.
|
|
clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
|
|
The FIXMEs must flow!
|
|
|
|
It's the only one, so the `try` prefix is unnecessary now.
|
|
MOAR FIXMES! ;^)
|
|
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. :^)
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
|
|
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. :^)
|
|
|
|
And while we're at it, handle the CardStack allocation (and failure
thereof) internally.
|
|
|
|
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.
|
|
|
|
If the card beneath the card currently being dragged is a valid drop
target, we will highlight it to indicate this to the user.
|
|
|
|
|
|
Replace the C_OBJECT factory functions with a custom try_create() which
loads the various bitmaps. Any failures there are now propagated.
|
|
|
|
|
|
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.
|
|
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.
|
|
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).
|
|
|
|
|
|
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 :))
|
|
This patch makes use of a new "set_snake_base_color()" function to
change the snake's base color to the picked value.
|
|
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.
|
|
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 ;)
|
|
`try_save_file_deprecated`
This precedes the addition of a new api using `Core::Stream`
|
|
This makes Action shortcuts work again. :^)
|
|
This makes Action shortcuts work again. :^)
|
|
This makes Action shortcuts work again. :^)
|
|
This makes Action shortcuts work again. :^)
|
|
This makes Action shortcuts work again. :^)
|
|
This fixes a pleasant 8 FIXMEs. :^)
|
|
This fixes a whopping 29 FIXMEs. :^)
|
|
|