1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

2048: Intialize settings window with current values

Currently, each time you open the settings window in 2048, it displays
the default values rather than the current values. This is confusing, so
display the current values instead.
This commit is contained in:
Timothy Flynn 2021-05-18 08:47:52 -04:00 committed by Andreas Kling
parent 63a1be1406
commit f02a13c884
3 changed files with 17 additions and 8 deletions

View file

@ -11,9 +11,13 @@
#include <LibGUI/CheckBox.h>
#include <LibGUI/Label.h>
#include <LibGUI/SpinBox.h>
#include <math.h>
GameSizeDialog::GameSizeDialog(GUI::Window* parent)
GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t target, bool evil_ai)
: GUI::Dialog(parent)
, m_board_size(board_size)
, m_target_tile_power(log2(target))
, m_evil_ai(evil_ai)
{
set_rect({ 0, 0, 200, 150 });
set_title("New Game");