From 6f710a773ed3beeb6f6368684413174c3e1f7233 Mon Sep 17 00:00:00 2001 From: ArnoAnsems <43150430+ArnoAnsems@users.noreply.github.com> Date: Fri, 23 Apr 2021 23:33:49 +0200 Subject: [PATCH] Fix entering numbers in warp cheat dialog --- src/Catacomb3D/Catacomb3DMenu.cpp | 4 ++-- src/Engine/EngineCore.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Catacomb3D/Catacomb3DMenu.cpp b/src/Catacomb3D/Catacomb3DMenu.cpp index f671243..ab2e549 100644 --- a/src/Catacomb3D/Catacomb3DMenu.cpp +++ b/src/Catacomb3D/Catacomb3DMenu.cpp @@ -603,8 +603,8 @@ const std::string& Catacomb3DMenu::GetNewSaveGameName() const void Catacomb3DMenu::AddNewSavedGame(const PlayerInput& playerInput, const std::string& name) { - m_guiMenu.AddChild(new GuiElementButton(playerInput, name, { GuiActionLoadGame, (int16_t)(m_savedGames.size() - 1) }, m_renderableText), 0, 0, restoreGameListId); - m_guiMenu.AddChild(new GuiElementButton(playerInput, name, { GuiActionSaveGame, (int16_t)(m_savedGames.size() - 1) }, m_renderableText), 0, 0, saveGameListId); + m_guiMenu.AddChild(new GuiElementSaveSlotStaticCat3D(playerInput, name, { GuiActionLoadGame, (int16_t)(m_savedGames.size() - 1) }, m_renderableText, m_flashIcon), 0, 0, restoreGameListId); + m_guiMenu.AddChild(new GuiElementSaveSlotStaticCat3D(playerInput, name, { GuiActionSaveGame, (int16_t)(m_savedGames.size() - 1) }, m_renderableText, m_flashIcon), 0, 0, saveGameListId); } void Catacomb3DMenu::OpenRestoreGameMenu() diff --git a/src/Engine/EngineCore.cpp b/src/Engine/EngineCore.cpp index 2a431b0..7e5bbee 100644 --- a/src/Engine/EngineCore.cpp +++ b/src/Engine/EngineCore.cpp @@ -841,13 +841,17 @@ bool EngineCore::Think() } else { - for (uint8_t i = 0x31; i < 0x39; i++) + if (m_state == InGame) { - if (m_playerInput.IsKeyJustPressed(i)) + for (uint8_t i = 0x31; i < 0x39; i++) { - ReadScroll(i - 0x31); + if (m_playerInput.IsKeyJustPressed(i)) + { + ReadScroll(i - 0x31); + } } } + if (m_playerInput.IsKeyJustPressed(SDLK_n)) // N { KeyNPressed();