summaryrefslogtreecommitdiff
path: root/Userland/Games/Minesweeper
AgeCommit message (Collapse)Author
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-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-12LibCore+Userland: Make Core::Timer::create_repeating() return ErrorOrSam Atkins
The FIXMEs must flow!
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-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.
2022-12-14Minesweeper: Make a factory function for Field and propagate errorsAndreas Kling
This fixes a pleasant 8 FIXMEs. :^)
2022-12-12Minesweeper: Revise the maximum mine limit in custom game settingsArda Cinar
After improving the mine field generation method, fields with greater than 50% mines no longer take too long to generate. So, the mine limit for a given size can be increased to its maximum possible value.
2022-12-12Minesweeper: Make sure icons of cells are set after generating fieldArda Cinar
In reset() function, the icons of labels in the game area were initially set as mine icon or null. And then, after generation, only the number icon was set. In the old field generation algorithm, this did not cause a very visible issue (The displayed mine icons in the game over screen were from a previously generated game field, which was only slightly wrong). However, the newer field generation caused a "no mine icons are shown in the game over screen" issue. To fix that, the label icon is set to null initially, and then it is set to a mine or number bitmap.
2022-12-12Minesweeper: Use a faster method to generate game fieldArda Cinar
The existing method was simply using a "randomly generate until it fits our criteria" method to generate a game field. While this worked OK in most cases, the run time was increasing seriously in boards whose mine count / board size ratio was too big. The new approach simply generates every possible mine location, shuffles the array and picks its head. This uses more memory (shouldn't be a big deal since minesweeper boards are generally miniscule) but runs much quicker. The generation could still use some improvement (regarding error handling), though :^)
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-25Userland: Let applications make use of make_command_palette_action()demostanis
2022-10-12Userland: Properly populate GENERATED_SOURCESAli Mohammad Pur
We previously put the generated headers in SOURCES, which did not mark them as GENERATED (and did not produce a proper dependency). This commit moves all generated headers into GENERATED_SOURCES, and removes useless header SOURCES.
2022-10-03Userland: Tighten promises by removing 'proc' where it isn't usedTimothy Flynn
This is a partial revert of commit 7af5eef. After 97d15e9, the 'proc' promise is not needed for operations using getsid(). This also fixes launching several applications in which 7af5eef added the 'proc' promise only in the second call to pledge().
2022-10-03SystemServer+LoginServer+Userland: Switch to sid-based socketsPeter Elliott
This commit does three things atomically: - switch over Core::Account+SystemServer+LoginServer to sid based socket names. - change socket names with %uid to %sid. - add/update necessary pledges and unveils. Userland: Switch over servers to sid based sockets Userland: Properly pledge and unveil for sid based sockets
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-08-14Everywhere: Replace hardcoded anon's uid in unveil path with `%uid`Lucas CHOLLET
2022-08-14LibCore+LaunchServer: Move portal directory to `/tmp/user/%uid`Lucas CHOLLET
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-05Minesweeper: Update GML and fix layout issuesthankyouverycool
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-07-24Minesweeper: Remove decimal point from the time labelKarol Kosek
The timer was updating fast enough to be a little distracting for me.
2022-07-19LaunchServer+SystemServer: Move the portal to a user-specific directoryLucas CHOLLET
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-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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-06-30Applications+Games+LibGUI: Fix layout problemsFrHun
2022-06-28Applications: Remove usages of deprecated implicit conversionsFrHun
These deprecated conversions are currently in place to make the system compile, but they are to be removed soon. This prepares that.
2022-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-18Games: Add reload icon to 'New Game' actionsLinus Groh
2022-02-16Games: Use default constructors/destructorsLenny Maiorani
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-13Userland: Run gml-formatIdan Horowitz
This brings the existing GML files up to spec with the new requirements
2022-02-11LibConfig: Rename pledge_domains(String) => pledge_domain(String)Vitaly Dyachkov
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-07Meta+Userland: Run the GML formatter on CI and pre-commitkleines Filmröllchen
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-01-13Minesweeper: Add link to help pages in menuDavid Lindbom
2021-12-18Minesweeper: Convert to try_create_default_iconAstraeus-
2021-12-05Games: Cast unused smart-pointer return values to voidSam Atkins
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-27Minesweeper: TRY() all the things in serenity_main() :^)Pedro Pereira
2021-11-24Minesweeper: Replace construct() with TRY(try_create()) patternPedro Pereira
2021-11-23LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCoreAndreas Kling
With this change, System::foo() becomes Core::System::foo(). Since LibCore builds on other systems than SerenityOS, we now have to make sure that wrappers work with just a standard C library underneath.
2021-11-22Everywhere: Use Application::construct() with Main::Arguments directlyMustafa Quraish
Use the updated API everywhere we are currently manually passing in `arguments.argc` and `arguments.argv`.
2021-11-22Minesweeper: Port to LibMainPedro Pereira
Simplified two unveil() and two pledge() by using TRY().
2021-11-15Minesweeper: Decrease min for Columns and Rows on Custom GamePedro Pereira
Since the Beginner difficulty has a 9x9 playing field, it is expected that a Custom Game should allow to create a field with that size.
2021-11-15Minesweeper: Create field from Difficulty enumPedro Pereira
This change makes it easier to generate a new field. Instead of using hard-coded values everywhere, we now just need to keep track of the Difficulty enum value.
2021-11-15Minesweeper: Turn difficulty menu into checkable actionsPedro Pereira
This change makes use of checkable actions to specify the current selected difficulty for the game.
2021-11-14Minesweeper: Add "Custom game..." difficultyPedro Pereira
This adds a dialog window which allows us to customize the size of the board and the amount of mines that will be placed. The current max amount of mines is 50% of the total number of cells due to the fact that the generator algorithm takes too long to create a board for higher percentages of mines.
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()Andreas Kling
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-02Demos+DevTools+Games: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-10-29Minesweeper: Set time label to a fixed widthMusab Kılıç
This ensures the label width doesn't sporadically change as time elapses
2021-10-27Everywhere: Rename left/right-click to primary/secondaryFiliph Sandström
This resolves #10641.
2021-08-30Minesweeper: Use AK::get_random_uniform() instead of rand()Andreas Kling