From b5b8ba9498c218c429396f349522b23bfbe2411c Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 4 Jul 2026 17:46:35 +0300 Subject: [PATCH] Don't show exit button on web builds & start windowed by default --- source/application.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/application.cpp b/source/application.cpp index ce9588f..7068d7f 100644 --- a/source/application.cpp +++ b/source/application.cpp @@ -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_; 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_;