mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: re-enable R key for camera reset with chat input safeguard
Allow R key to reset camera position/rotation when chat input is not active. Previously disabled due to conflict with chat reply command. Now uses the same safety check as movement keys (ImGui::GetIO().WantTextInput). Implements edge-triggered reset on R key press, matching X key (sit) pattern.
This commit is contained in:
parent
a3e0d36a72
commit
a8fd977a53
1 changed files with 8 additions and 2 deletions
|
|
@ -377,6 +377,13 @@ void CameraController::update(float deltaTime) {
|
|||
if (mounted_) sitting = false;
|
||||
xKeyWasDown = xDown;
|
||||
|
||||
// Reset camera with R key (edge-triggered) — only when UI doesn't want keyboard
|
||||
bool rDown = !uiWantsKeyboard && input.isKeyPressed(SDL_SCANCODE_R);
|
||||
if (rDown && !rKeyWasDown) {
|
||||
reset();
|
||||
}
|
||||
rKeyWasDown = rDown;
|
||||
|
||||
// Stand up on any movement key or jump while sitting (WoW behaviour)
|
||||
if (!uiWantsKeyboard && sitting && !movementSuppressed) {
|
||||
bool anyMoveKey =
|
||||
|
|
@ -1851,8 +1858,7 @@ void CameraController::update(float deltaTime) {
|
|||
wasJumping = nowJump;
|
||||
wasFalling = !grounded && verticalVelocity <= 0.0f;
|
||||
|
||||
// R key disabled — was camera reset, conflicts with chat reply
|
||||
rKeyWasDown = false;
|
||||
// R key is now handled above with chat safeguard (WantTextInput check)
|
||||
}
|
||||
|
||||
void CameraController::processMouseMotion(const SDL_MouseMotionEvent& event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue