1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

Games: Wrong parent window passed to GUI::MessageBox

We were passing the wrong parent window to GUI::MessageBox making
it impossible to exit the message window.
This commit is contained in:
Monroe Clinton 2022-10-02 12:30:11 -04:00 committed by Andreas Kling
parent 2a9128efe3
commit 67300af248
2 changed files with 3 additions and 3 deletions

View file

@ -112,11 +112,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Config::write_i32("2048"sv, ""sv, "target_tile"sv, target_tile);
Config::write_bool("2048"sv, ""sv, "evil_ai"sv, evil_ai);
GUI::MessageBox::show(window, "New settings have been saved and will be applied on a new game"sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
GUI::MessageBox::show(size_dialog, "New settings have been saved and will be applied on a new game"sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
return;
}
GUI::MessageBox::show(window, "New settings have been set and will be applied on the next game"sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
GUI::MessageBox::show(size_dialog, "New settings have been set and will be applied on the next game"sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
};
auto start_a_new_game = [&] {
// Do not leak game states between games.

View file

@ -84,7 +84,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Config::write_string("Hearts"sv, ""sv, "player_name"sv, player_name);
GUI::MessageBox::show(window, "Settings have been successfully saved and will take effect in the next game."sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
GUI::MessageBox::show(settings_dialog, "Settings have been successfully saved and will take effect in the next game."sv, "Settings Changed Successfully"sv, GUI::MessageBox::Type::Information);
};
auto game_menu = TRY(window->try_add_menu("&Game"));