Skip to content

Commit

Permalink
In PDA and talk window only focus the cursor when using gamepad (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 20, 2025
1 parent f38295a commit d5fd1ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/xrGame/ui/UISecondTaskWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,18 @@ void UITaskListWnd::Show(bool status)
GetMessageTarget()->SetKeyboardCapture(this, true);
focus.LockToWindow(this);

if (m_list->Empty())
if (pInput->IsCurrentInputTypeController())
{
focus.SetFocused(nullptr);
UI().GetUICursor().WarpToWindow(m_list, true);
}
else
{
const auto item = static_cast<UITaskListWndItem*>(m_list->Items()[0]);
item->Focus();
if (m_list->Empty())
{
focus.SetFocused(nullptr);
UI().GetUICursor().WarpToWindow(m_list, true);
}
else
{
const auto item = static_cast<UITaskListWndItem*>(m_list->Items()[0]);
item->Focus();
}
}
}
else
Expand Down
3 changes: 2 additions & 1 deletion src/xrGame/ui/UITalkWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ void CUITalkWnd::UpdateQuestions()
}
}

UITalkDialogWnd->FocusOnFirstQuestion();
if (pInput->IsCurrentInputTypeController())
UITalkDialogWnd->FocusOnFirstQuestion();

m_bNeedToUpdateQuestions = false;
}
Expand Down

0 comments on commit d5fd1ae

Please sign in to comment.