default debug action fixes: UITestScene now uses the same grave hotkey to start REPL

This commit is contained in:
John McCardle 2024-03-08 22:25:48 -05:00
parent 5ada446360
commit 9eb9562b9f
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,7 @@ PyScene::PyScene(GameEngine* g) : Scene(g)
registerAction(ActionCode::MOUSEWHEEL + ActionCode::WHEEL_DEL, "wheel_up");
registerAction(ActionCode::MOUSEWHEEL + ActionCode::WHEEL_NEG + ActionCode::WHEEL_DEL, "wheel_down");
registerAction(ActionCode::KEY + sf::Keyboard::Escape, "debug_menu");
registerAction(ActionCode::KEY + sf::Keyboard::Grave, "debug_menu");
}
void PyScene::update()

View File

@ -4,6 +4,8 @@
UITestScene::UITestScene(GameEngine* g) : Scene(g)
{
registerAction(ActionCode::KEY + sf::Keyboard::Grave, "debug_menu");
text.setFont(game->getFont());
text.setString("UITest: surprised to be here? game.py raised an exception.");
text.setCharacterSize(24);
@ -140,6 +142,9 @@ void UITestScene::doAction(std::string name, std::string type)
//if (name.compare("start_game") == 0 and type.compare("start") == 0)
if(ACTION("start_game", "start"))
game->changeScene("py");
else if ACTIONONCE("debug_menu") {
McRFPy_API::REPL();
}
/*
else if(ACTIONONCE("up"))
game->getWindow().setSize(sf::Vector2u(1280, 800));
@ -171,5 +176,5 @@ void UITestScene::sRender()
game->getWindow().display();
McRFPy_API::REPL();
//McRFPy_API::REPL();
}