From 755a7db35dfeef3ab39113b327e729c91a9fad45 Mon Sep 17 00:00:00 2001 From: Semphris Date: Wed, 7 Oct 2020 23:43:05 -0400 Subject: [PATCH 1/2] Allows access to Cheat and Debug menus when playtesting a level fro mthe editor --- src/supertux/game_session.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index ff814bb75bc..6311ef24e5f 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -18,6 +18,7 @@ #include "audio/sound_manager.hpp" #include "control/input_manager.hpp" +#include "editor/editor.hpp" #include "gui/menu_manager.hpp" #include "math/vector.hpp" #include "object/camera.hpp" @@ -328,7 +329,9 @@ GameSession::update(float dt_sec, const Controller& controller) on_escape_press(); } - if (controller.pressed(Control::CHEAT_MENU) && g_config->developer_mode) + if (controller.pressed(Control::CHEAT_MENU) && + (g_config->developer_mode || (Editor::current() && Editor::current()->is_testing_level())) + ) { if (!MenuManager::instance().is_active()) { @@ -337,7 +340,9 @@ GameSession::update(float dt_sec, const Controller& controller) } } - if (controller.pressed(Control::DEBUG_MENU) && g_config->developer_mode) + if (controller.pressed(Control::DEBUG_MENU) && + (g_config->developer_mode || (Editor::current() && Editor::current()->is_testing_level())) + ) { if (!MenuManager::instance().is_active()) { From 87880aa74eb0b962f6531debd5422018866a2b79 Mon Sep 17 00:00:00 2001 From: Semphris Date: Wed, 7 Oct 2020 23:47:20 -0400 Subject: [PATCH 2/2] Removed access to debug menu, as it had impacts outside the editor and didn't seem as necessary (it's one line, if anyone wants to re-enable it) --- src/supertux/game_session.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index 6311ef24e5f..70563a12631 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -340,9 +340,7 @@ GameSession::update(float dt_sec, const Controller& controller) } } - if (controller.pressed(Control::DEBUG_MENU) && - (g_config->developer_mode || (Editor::current() && Editor::current()->is_testing_level())) - ) + if (controller.pressed(Control::DEBUG_MENU) && g_config->developer_mode) { if (!MenuManager::instance().is_active()) {