mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
Don't list non-usable items in QuickKeysMenu selection (Fixes #1427)
This commit is contained in:
parent
271aac3fcc
commit
c0c1db4490
@ -24,6 +24,7 @@
|
|||||||
#include "spellwindow.hpp"
|
#include "spellwindow.hpp"
|
||||||
|
|
||||||
#include "itemwidget.hpp"
|
#include "itemwidget.hpp"
|
||||||
|
#include "sortfilteritemmodel.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
@ -134,6 +135,7 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
mItemSelectionDialog->setVisible(true);
|
mItemSelectionDialog->setVisible(true);
|
||||||
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayerPtr());
|
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||||
|
mItemSelectionDialog->setFilter(SortFilterItemModel::Filter_OnlyUsableItems);
|
||||||
|
|
||||||
mAssignDialog->setVisible (false);
|
mAssignDialog->setVisible (false);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <components/esm/loadweap.hpp>
|
#include <components/esm/loadweap.hpp>
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
#include "../mwworld/nullaction.hpp"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -126,6 +127,10 @@ namespace MWGui
|
|||||||
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
|
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if ((mFilter & Filter_OnlyUsableItems) && typeid(*base.getClass().use(base)) == typeid(MWWorld::NullAction)
|
||||||
|
&& base.getClass().getScript(base).empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ namespace MWGui
|
|||||||
static const int Filter_OnlyEnchanted = (1<<1);
|
static const int Filter_OnlyEnchanted = (1<<1);
|
||||||
static const int Filter_OnlyEnchantable = (1<<2);
|
static const int Filter_OnlyEnchantable = (1<<2);
|
||||||
static const int Filter_OnlyChargedSoulstones = (1<<3);
|
static const int Filter_OnlyChargedSoulstones = (1<<3);
|
||||||
|
static const int Filter_OnlyUsableItems = (1<<4); // Only items with a Use action
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user