Skip to content

Commit

Permalink
Stop key scrolling on end turn
Browse files Browse the repository at this point in the history
  • Loading branch information
MeridianOXC committed Dec 2, 2023
1 parent 989a776 commit ddfe762
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Battlescape/BattlescapeState.cpp
Expand Up @@ -1393,6 +1393,9 @@ void BattlescapeState::btnEndTurnClick(Action *)
// Temporarily deactivate the touch buttons at the end of the player's turn
toggleTouchButtons(true, false);

// PEBCAK
_map->getCamera()->stopKeyScrolling();

_txtTooltip->setText("");
_battleGame->requestEndTurn(false);
}
Expand Down
5 changes: 5 additions & 0 deletions src/Battlescape/Camera.cpp
Expand Up @@ -621,6 +621,11 @@ void Camera::resize()
_visibleMapHeight = _map->getHeight() - _map->getIconHeight();
}

void Camera::stopKeyScrolling()
{
_scrollKeyTimer->stop();
}

void Camera::stopMouseScrolling()
{
_scrollMouseTimer->stop();
Expand Down
2 changes: 2 additions & 0 deletions src/Battlescape/Camera.h
Expand Up @@ -104,6 +104,8 @@ class Camera
bool isOnScreen(Position mapPos, const bool unitWalking, const int unitSize, const bool boundary) const;
/// Resize the viewable area.
void resize();
/// stop key scrolling.
void stopKeyScrolling();
/// stop mouse scrolling.
void stopMouseScrolling();
};
Expand Down

0 comments on commit ddfe762

Please sign in to comment.