1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

Don't list non-usable items in QuickKeysMenu selection (Fixes #1427)

This commit is contained in:
scrawl 2014-06-10 03:28:21 +02:00
parent 271aac3fcc
commit c0c1db4490
3 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "spellwindow.hpp"
#include "itemwidget.hpp"
#include "sortfilteritemmodel.hpp"
namespace MWGui
@ -134,6 +135,7 @@ namespace MWGui
}
mItemSelectionDialog->setVisible(true);
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayerPtr());
mItemSelectionDialog->setFilter(SortFilterItemModel::Filter_OnlyUsableItems);
mAssignDialog->setVisible (false);
}

View File

@ -14,6 +14,7 @@
#include <components/esm/loadweap.hpp>
#include "../mwworld/class.hpp"
#include "../mwworld/nullaction.hpp"
namespace
{
@ -126,6 +127,10 @@ namespace MWGui
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
return false;
if ((mFilter & Filter_OnlyUsableItems) && typeid(*base.getClass().use(base)) == typeid(MWWorld::NullAction)
&& base.getClass().getScript(base).empty())
return false;
return true;
}

View File

@ -36,6 +36,7 @@ namespace MWGui
static const int Filter_OnlyEnchanted = (1<<1);
static const int Filter_OnlyEnchantable = (1<<2);
static const int Filter_OnlyChargedSoulstones = (1<<3);
static const int Filter_OnlyUsableItems = (1<<4); // Only items with a Use action
private: