diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-21 10:48:48 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-21 10:48:48 -0400 |
| commit | 2c2ca14dd8c47ccca6d0db1b728ab4a00dbfb0a4 (patch) | |
| tree | 26b986a0bd88e5111bd30efdba0d35e248f950f9 | |
| parent | 5e37c9a7034edfc4eec4d4ed15224b0f63c736af (diff) | |
| download | ether-2c2ca14dd8c47ccca6d0db1b728ab4a00dbfb0a4.tar.gz ether-2c2ca14dd8c47ccca6d0db1b728ab4a00dbfb0a4.tar.bz2 ether-2c2ca14dd8c47ccca6d0db1b728ab4a00dbfb0a4.zip | |
can't just hold space to get through messages
| -rw-r--r-- | src/sign.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
| diff --git a/src/sign.cpp b/src/sign.cpp index e488108..46a1d6e 100644 --- a/src/sign.cpp +++ b/src/sign.cpp | |||
| @@ -52,10 +52,13 @@ void Sign::displayMessage(std::string text) { | |||
| 52 | 52 | ||
| 53 | void Sign::update(size_t dt, Game& game) { | 53 | void Sign::update(size_t dt, Game& game) { |
| 54 | SDL_Event e; | 54 | SDL_Event e; |
| 55 | bool pressedSpace = false; | ||
| 55 | 56 | ||
| 56 | while (SDL_PollEvent(&e)) { | 57 | while (SDL_PollEvent(&e)) { |
| 57 | if (e.type == SDL_QUIT) { | 58 | if (e.type == SDL_QUIT) { |
| 58 | game.quit = true; | 59 | game.quit = true; |
| 60 | } else if (e.type == SDL_KEYDOWN && e.key.keysym.sym == SDLK_SPACE && e.key.repeat == 0) { | ||
| 61 | pressedSpace = true; | ||
| 59 | } | 62 | } |
| 60 | } | 63 | } |
| 61 | 64 | ||
| @@ -81,8 +84,7 @@ void Sign::update(size_t dt, Game& game) { | |||
| 81 | break; | 84 | break; |
| 82 | } | 85 | } |
| 83 | case SignInstructionState::Visible: { | 86 | case SignInstructionState::Visible: { |
| 84 | const Uint8* state = SDL_GetKeyboardState(NULL); | 87 | if (pressedSpace) { |
| 85 | if (state[SDL_SCANCODE_SPACE]) { | ||
| 86 | bool fullyRevealed = true; | 88 | bool fullyRevealed = true; |
| 87 | for (const SignLine& line : linesToShow) { | 89 | for (const SignLine& line : linesToShow) { |
| 88 | if (line.charsRevealed != line.text.size()) { | 90 | if (line.charsRevealed != line.text.size()) { |
