MCPcopy Create free account
hub / github.com/EasyRPG/Player / Update

Method Update

src/game_quit.cpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void Game_Quit::Update() {
40 if (Scene::instance == nullptr || Scene::instance->type == Scene::Title || !Scene::Find(Scene::Title) || !Input::IsPressed(Input::RESET)) {
41 if (time_left != start_time) {
42 Reset();
43 }
44 return;
45 }
46
47 window.SetVisible(true);
48
49 if (time_left > 0) {
50 --time_left;
51 }
52
53 // FIXME Need to write the text every frame in case system graphic changes..
54 auto s = (time_left + DEFAULT_FPS - 1) / DEFAULT_FPS;
55 window.SetText("Restarting in " + std::to_string(s) + " sec ...");
56 window.Update();
57}
58
59void Game_Quit::OnResolutionChange() {
60 window.SetX(Player::screen_width / 2 - window_width / 2);

Callers

nothing calls this directly

Calls 2

SetTextMethod · 0.80
SetVisibleMethod · 0.45

Tested by

no test coverage detected