mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-06 09:04:30 +00:00
Merge branch 'spellviewcursor' into 'master'
Hide the cursor in spell lists when controller tooltips are on (#8770) Closes #8770 See merge request OpenMW/openmw!4979
This commit is contained in:
commit
2b5d7c9d7d
3 changed files with 12 additions and 2 deletions
|
|
@ -240,6 +240,7 @@ namespace MWGui
|
||||||
else if (arg.button == SDL_CONTROLLER_BUTTON_B)
|
else if (arg.button == SDL_CONTROLLER_BUTTON_B)
|
||||||
{
|
{
|
||||||
onCancelButtonClicked(mCancelButton);
|
onCancelButtonClicked(mCancelButton);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK)
|
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK)
|
||||||
{
|
{
|
||||||
|
|
@ -271,6 +272,8 @@ namespace MWGui
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
winMgr->setCursorVisible(!winMgr->getControllerTooltipVisible());
|
||||||
|
|
||||||
if (mControllerFocus < mSpellButtons.size())
|
if (mControllerFocus < mSpellButtons.size())
|
||||||
{
|
{
|
||||||
// Scroll the list to keep the active item in view
|
// Scroll the list to keep the active item in view
|
||||||
|
|
|
||||||
|
|
@ -847,10 +847,12 @@ namespace MWGui
|
||||||
mAvailableFocus = 0;
|
mAvailableFocus = 0;
|
||||||
mEffectFocus = 0;
|
mEffectFocus = 0;
|
||||||
mRightColumn = false;
|
mRightColumn = false;
|
||||||
if (mAvailableButtons.size() > 0)
|
if (!mAvailableButtons.empty())
|
||||||
{
|
{
|
||||||
|
MWBase::WindowManager& winMgr = *MWBase::Environment::get().getWindowManager();
|
||||||
|
winMgr.setCursorVisible(!winMgr.getControllerTooltipVisible());
|
||||||
mAvailableButtons[0]->setStateSelected(true);
|
mAvailableButtons[0]->setStateSelected(true);
|
||||||
if (MWBase::Environment::get().getWindowManager()->getControllerTooltipVisible())
|
if (winMgr.getControllerTooltipVisible())
|
||||||
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mAvailableButtons[0]);
|
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mAvailableButtons[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1117,6 +1119,8 @@ namespace MWGui
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
winMgr->setCursorVisible(!winMgr->getControllerTooltipVisible());
|
||||||
|
|
||||||
// Scroll the list to keep the active item in view
|
// Scroll the list to keep the active item in view
|
||||||
if (mAvailableFocus <= 5)
|
if (mAvailableFocus <= 5)
|
||||||
mAvailableEffectsList->setViewOffset(0);
|
mAvailableEffectsList->setViewOffset(0);
|
||||||
|
|
|
||||||
|
|
@ -417,6 +417,9 @@ namespace MWGui
|
||||||
|
|
||||||
void SpellView::updateControllerFocus(size_t prevFocus, size_t newFocus)
|
void SpellView::updateControllerFocus(size_t prevFocus, size_t newFocus)
|
||||||
{
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->setCursorVisible(
|
||||||
|
!MWBase::Environment::get().getWindowManager()->getControllerTooltipVisible());
|
||||||
|
|
||||||
if (mButtons.empty())
|
if (mButtons.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue