Don't show exit button on web builds & start windowed by default

This commit is contained in:
Nikita Lisitsa 2026-07-04 17:46:35 +03:00
parent 986d2f17b6
commit b5b8ba9498

View file

@ -2548,7 +2548,11 @@ namespace gmtk
private:
context const & context_;
#ifdef __EMSCRIPTEN__
bool is_windowed_ = true;
#else
bool is_windowed_ = false;
#endif
std::unique_ptr<audio::engine> audio_;
audio::mixer_ptr mixer_;
@ -2659,7 +2663,9 @@ namespace gmtk
menu_buttons_.push_back({"Challenge mode", [this]{ start_new_game(true, false, true); }});
menu_buttons_.push_back({"Sandbox mode", [this]{ start_new_game(true, true, true); }});
menu_buttons_.push_back({is_windowed_ ? "Windowed" : "Fullscreen", [this]{ is_windowed_ ^= true; context_.windowed(is_windowed_); set_start_menu_buttons(); }});
#ifndef __EMSCRIPTEN__
menu_buttons_.push_back({"Exit", [this]{ stop(); }});
#endif
}
void set_escape_menu_buttons()
@ -2675,7 +2681,9 @@ namespace gmtk
}});
menu_buttons_.push_back({"Main menu", [this]{ set_start_menu(); }});
menu_buttons_.push_back({is_windowed_ ? "Windowed" : "Fullscreen", [this]{ is_windowed_ ^= true; context_.windowed(is_windowed_); set_escape_menu_buttons(); }});
#ifndef __EMSCRIPTEN__
menu_buttons_.push_back({"Exit", [this]{ stop(); }});
#endif
}
void set_victory_menu_buttons()
@ -2685,7 +2693,9 @@ namespace gmtk
menu_buttons_.push_back({"One more turn", [this]{ in_victory_menu_ = false; }});
menu_buttons_.push_back({"Play again", [this]{ start_new_game(is_challenge_mode_, is_sandbox_mode_, true); }});
menu_buttons_.push_back({"Main menu", [this]{ set_start_menu(); }});
#ifndef __EMSCRIPTEN__
menu_buttons_.push_back({"Exit", [this]{ stop(); }});
#endif
}
random::generator map_rng_;