mirror of
https://github.com/RGBCube/serenity
synced 2025-09-13 14:37:58 +00:00
LibCore+Userland: Make Core::Timer::create_repeating() return ErrorOr
The FIXMEs must flow!
This commit is contained in:
parent
1d4f287582
commit
a15d44f019
12 changed files with 19 additions and 17 deletions
|
@ -140,7 +140,8 @@ void Field::initialize()
|
|||
++m_time_elapsed;
|
||||
m_time_label.set_text(human_readable_digital_time(m_time_elapsed));
|
||||
},
|
||||
this);
|
||||
this)
|
||||
.release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// Square with mine will be filled with background color later, i.e. red
|
||||
m_mine_palette.set_color(Gfx::ColorRole::Base, Color::from_rgb(0xff4040));
|
||||
|
|
|
@ -111,7 +111,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
uint64_t seconds_elapsed = 0;
|
||||
|
||||
auto timer = Core::Timer::create_repeating(1000, [&]() {
|
||||
auto timer = TRY(Core::Timer::create_repeating(1000, [&]() {
|
||||
++seconds_elapsed;
|
||||
|
||||
uint64_t hours = seconds_elapsed / 3600;
|
||||
|
@ -119,7 +119,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
uint64_t seconds = seconds_elapsed % 60;
|
||||
|
||||
statusbar.set_text(2, DeprecatedString::formatted("Time: {:02}:{:02}:{:02}", hours, minutes, seconds));
|
||||
});
|
||||
}));
|
||||
|
||||
game.on_game_start = [&]() {
|
||||
seconds_elapsed = 0;
|
||||
|
|
|
@ -158,11 +158,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
uint64_t seconds_elapsed = 0;
|
||||
|
||||
auto timer = Core::Timer::create_repeating(1000, [&]() {
|
||||
auto timer = TRY(Core::Timer::create_repeating(1000, [&]() {
|
||||
++seconds_elapsed;
|
||||
|
||||
statusbar.set_text(2, DeprecatedString::formatted("Time: {}", format_seconds(seconds_elapsed)));
|
||||
});
|
||||
}));
|
||||
|
||||
game.on_game_start = [&]() {
|
||||
seconds_elapsed = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue