diff --git a/Userland/Games/2048/BoardView.cpp b/Userland/Games/2048/BoardView.cpp index 0ed39eb3b3d..960775a549f 100644 --- a/Userland/Games/2048/BoardView.cpp +++ b/Userland/Games/2048/BoardView.cpp @@ -45,7 +45,7 @@ void BoardView::set_board(Game::Board const* board) void BoardView::pick_font() { - DeprecatedString best_font_name; + String best_font_name; int best_font_size = -1; auto& font_database = Gfx::FontDatabase::the(); font_database.for_each_font([&](Gfx::Font const& font) { @@ -53,7 +53,7 @@ void BoardView::pick_font() return; auto size = font.pixel_size_rounded_up(); if (size * 2 <= m_cell_size && size > best_font_size) { - best_font_name = font.qualified_name(); + best_font_name = String::from_deprecated_string(font.qualified_name()).release_value_but_fixme_should_propagate_errors(); best_font_size = size; } }); @@ -234,7 +234,7 @@ void BoardView::paint_event(GUI::PaintEvent& event) auto rect = Gfx::IntRect::centered_on(center, tile_size); painter.fill_rect(rect, background_color_for_cell(sliding_tile.value_from)); - painter.draw_text(rect, DeprecatedString::number(sliding_tile.value_from), font(), Gfx::TextAlignment::Center, text_color_for_cell(sliding_tile.value_from)); + painter.draw_text(rect, String::number(sliding_tile.value_from).release_value_but_fixme_should_propagate_errors(), font(), Gfx::TextAlignment::Center, text_color_for_cell(sliding_tile.value_from)); } } else { for (size_t column = 0; column < columns(); ++column) { @@ -249,7 +249,7 @@ void BoardView::paint_event(GUI::PaintEvent& event) auto entry = tiles[row][column]; painter.fill_rect(rect, background_color_for_cell(entry)); if (entry > 0) - painter.draw_text(rect, DeprecatedString::number(entry), font(), Gfx::TextAlignment::Center, text_color_for_cell(entry)); + painter.draw_text(rect, String::number(entry).release_value_but_fixme_should_propagate_errors(), font(), Gfx::TextAlignment::Center, text_color_for_cell(entry)); } } } diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 2c678091f07..59984e2a3ec 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -144,7 +144,7 @@ ErrorOr serenity_main(Main::Arguments arguments) case Game::MoveOutcome::Won: { update(); auto want_to_continue = GUI::MessageBox::show(window, - DeprecatedString::formatted("You won the game in {} turns with a score of {}. Would you like to continue?", game.turns(), game.score()), + String::formatted("You won the game in {} turns with a score of {}. Would you like to continue?", game.turns(), game.score()).release_value_but_fixme_should_propagate_errors(), "Congratulations!"sv, GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); @@ -157,7 +157,7 @@ ErrorOr serenity_main(Main::Arguments arguments) case Game::MoveOutcome::GameOver: update(); GUI::MessageBox::show(window, - DeprecatedString::formatted("You reached {} in {} turns with a score of {}", game.largest_tile(), game.turns(), game.score()), + String::formatted("You reached {} in {} turns with a score of {}", game.largest_tile(), game.turns(), game.score()).release_value_but_fixme_should_propagate_errors(), "You lost!"sv, GUI::MessageBox::Type::Information); start_a_new_game();