Skip to content

Commit 2b5d7c9

Browse files
committed
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
2 parents 3c3fdda + d1d598a commit 2b5d7c9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

apps/openmw/mwgui/spellbuyingwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ namespace MWGui
240240
else if (arg.button == SDL_CONTROLLER_BUTTON_B)
241241
{
242242
onCancelButtonClicked(mCancelButton);
243+
return true;
243244
}
244245
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK)
245246
{
@@ -271,6 +272,8 @@ namespace MWGui
271272
else
272273
return true;
273274

275+
winMgr->setCursorVisible(!winMgr->getControllerTooltipVisible());
276+
274277
if (mControllerFocus < mSpellButtons.size())
275278
{
276279
// Scroll the list to keep the active item in view

apps/openmw/mwgui/spellcreationdialog.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,12 @@ namespace MWGui
847847
mAvailableFocus = 0;
848848
mEffectFocus = 0;
849849
mRightColumn = false;
850-
if (mAvailableButtons.size() > 0)
850+
if (!mAvailableButtons.empty())
851851
{
852+
MWBase::WindowManager& winMgr = *MWBase::Environment::get().getWindowManager();
853+
winMgr.setCursorVisible(!winMgr.getControllerTooltipVisible());
852854
mAvailableButtons[0]->setStateSelected(true);
853-
if (MWBase::Environment::get().getWindowManager()->getControllerTooltipVisible())
855+
if (winMgr.getControllerTooltipVisible())
854856
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mAvailableButtons[0]);
855857
}
856858
}
@@ -1117,6 +1119,8 @@ namespace MWGui
11171119
else
11181120
return true;
11191121

1122+
winMgr->setCursorVisible(!winMgr->getControllerTooltipVisible());
1123+
11201124
// Scroll the list to keep the active item in view
11211125
if (mAvailableFocus <= 5)
11221126
mAvailableEffectsList->setViewOffset(0);

apps/openmw/mwgui/spellview.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ namespace MWGui
417417

418418
void SpellView::updateControllerFocus(size_t prevFocus, size_t newFocus)
419419
{
420+
MWBase::Environment::get().getWindowManager()->setCursorVisible(
421+
!MWBase::Environment::get().getWindowManager()->getControllerTooltipVisible());
422+
420423
if (mButtons.empty())
421424
return;
422425

0 commit comments

Comments
 (0)