mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-18 09:16:41 +00:00
Dialog window improvements: use LB/RB to move up/down by 5; if only one dialog choice, autoselect it.
This commit is contained in:
parent
3767b60512
commit
7cc25d8916
1 changed files with 15 additions and 1 deletions
|
@ -968,7 +968,9 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (mChoices.size() > 0)
|
if (mChoices.size() > 0)
|
||||||
{
|
{
|
||||||
if (mControllerChoice >= 0 && mControllerChoice < static_cast<int>(mChoices.size()))
|
if (mChoices.size() == 1)
|
||||||
|
onChoiceActivated(mChoices[0].second);
|
||||||
|
else if (mControllerChoice >= 0 && mControllerChoice < static_cast<int>(mChoices.size()))
|
||||||
onChoiceActivated(mChoices[mControllerChoice].second);
|
onChoiceActivated(mChoices[mControllerChoice].second);
|
||||||
}
|
}
|
||||||
else if (mControllerFocus == static_cast<int>(mTopicsList->getItemCount()))
|
else if (mControllerFocus == static_cast<int>(mTopicsList->getItemCount()))
|
||||||
|
@ -1025,6 +1027,18 @@ namespace MWGui
|
||||||
setControllerFocus(mControllerFocus, true);
|
setControllerFocus(mControllerFocus, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER && mChoices.size() == 0)
|
||||||
|
{
|
||||||
|
setControllerFocus(mControllerFocus, false);
|
||||||
|
mControllerFocus = std::max(mControllerFocus - 5, 0);
|
||||||
|
setControllerFocus(mControllerFocus, true);
|
||||||
|
}
|
||||||
|
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER && mChoices.size() == 0)
|
||||||
|
{
|
||||||
|
setControllerFocus(mControllerFocus, false);
|
||||||
|
mControllerFocus = std::min(mControllerFocus + 5, static_cast<int>(mTopicsList->getItemCount()));
|
||||||
|
setControllerFocus(mControllerFocus, true);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue