implemented filters (no gui yet)

actorid
scrawl 13 years ago
parent 24e54a81bd
commit fd18c95c5f

@ -29,6 +29,7 @@ using namespace Widgets;
ContainerBase::ContainerBase(WindowManager& parWindowManager,DragAndDrop* dragAndDrop,std::string guiFile)
: WindowBase(guiFile, parWindowManager),
mDragAndDrop(dragAndDrop),
mFilter(MWWorld::ContainerStore::Type_All),
mContainer()
{
getWidget(mContainerWidget, "Items");
@ -95,6 +96,12 @@ void ContainerBase::setName(std::string contName)
adjustWindowCaption();
}
void ContainerBase::setFilter(int filter)
{
mFilter = filter;
drawItems();
}
void ContainerBase::open(MWWorld::Ptr container)
{
mContainer = container;
@ -117,7 +124,7 @@ void ContainerBase::drawItems()
int index = 0;
for (MWWorld::ContainerStoreIterator iter (containerStore.begin()); iter!=containerStore.end(); ++iter)
for (MWWorld::ContainerStoreIterator iter (containerStore.begin(mFilter)); iter!=containerStore.end(); ++iter)
{
index++;
if(iter->getRefData().getCount() > 0)

@ -52,6 +52,7 @@ namespace MWGui
void open(MWWorld::Ptr container);
void setName(std::string contName);
void setFilter(int filter); ///< set category filter
void Update();
protected:
@ -61,6 +62,8 @@ namespace MWGui
DragAndDrop* mDragAndDrop;
MWWorld::Ptr mContainer;
int mFilter;
void onSelectedItem(MyGUI::Widget* _sender);
void onContainerClicked(MyGUI::Widget* _sender);

Loading…
Cancel
Save