2012-04-15 15:52:39 +00:00
|
|
|
#ifndef MGUI_CONTAINER_H
|
|
|
|
#define MGUI_CONTAINER_H
|
|
|
|
|
2013-04-10 04:32:05 +00:00
|
|
|
#include "windowbase.hpp"
|
2012-05-26 23:14:33 +00:00
|
|
|
#include "referenceinterface.hpp"
|
|
|
|
|
2013-05-11 16:38:27 +00:00
|
|
|
#include "itemmodel.hpp"
|
2012-04-15 15:52:39 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Environment;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MyGUI
|
|
|
|
{
|
2012-04-30 11:01:18 +00:00
|
|
|
class Gui;
|
|
|
|
class Widget;
|
2012-04-15 15:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class WindowManager;
|
2012-04-30 11:01:18 +00:00
|
|
|
class ContainerWindow;
|
2013-05-11 16:38:27 +00:00
|
|
|
class ItemView;
|
|
|
|
class SortFilterItemModel;
|
2012-04-15 15:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-05-11 16:38:27 +00:00
|
|
|
class ContainerWindow : public WindowBase, public ReferenceInterface
|
2012-05-12 11:12:37 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
ContainerWindow(DragAndDrop* dragAndDrop);
|
2012-05-12 11:12:37 +00:00
|
|
|
|
2017-09-22 19:26:41 +00:00
|
|
|
void setPtr(const MWWorld::Ptr& container);
|
2017-09-22 15:10:53 +00:00
|
|
|
virtual void onClose();
|
2017-09-23 20:16:56 +00:00
|
|
|
void clear() { resetReference(); }
|
2013-05-11 16:38:27 +00:00
|
|
|
|
2017-09-23 20:00:15 +00:00
|
|
|
void onFrame(float dt) { checkReferenceAvailable(); }
|
|
|
|
|
2014-07-07 21:37:59 +00:00
|
|
|
virtual void resetReference();
|
|
|
|
|
2013-05-11 16:38:27 +00:00
|
|
|
private:
|
|
|
|
DragAndDrop* mDragAndDrop;
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2013-05-11 16:38:27 +00:00
|
|
|
MWGui::ItemView* mItemView;
|
|
|
|
SortFilterItemModel* mSortModel;
|
|
|
|
ItemModel* mModel;
|
2014-05-15 01:12:52 +00:00
|
|
|
int mSelectedItem;
|
2012-05-12 20:44:12 +00:00
|
|
|
|
2013-03-07 13:00:13 +00:00
|
|
|
MyGUI::Button* mDisposeCorpseButton;
|
2012-05-12 11:12:37 +00:00
|
|
|
MyGUI::Button* mTakeButton;
|
|
|
|
MyGUI::Button* mCloseButton;
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2013-05-11 16:38:27 +00:00
|
|
|
void onItemSelected(int index);
|
|
|
|
void onBackgroundSelected();
|
|
|
|
void dragItem(MyGUI::Widget* sender, int count);
|
|
|
|
void dropItem();
|
2012-05-11 14:34:36 +00:00
|
|
|
void onCloseButtonClicked(MyGUI::Widget* _sender);
|
2012-05-11 14:58:07 +00:00
|
|
|
void onTakeAllButtonClicked(MyGUI::Widget* _sender);
|
2013-03-07 13:00:13 +00:00
|
|
|
void onDisposeCorpseButtonClicked(MyGUI::Widget* sender);
|
2012-05-26 23:14:33 +00:00
|
|
|
|
2014-01-07 02:01:33 +00:00
|
|
|
/// @return is taking the item allowed?
|
|
|
|
bool onTakeItem(const ItemStack& item, int count);
|
|
|
|
|
2012-05-26 23:14:33 +00:00
|
|
|
virtual void onReferenceUnavailable();
|
2012-04-15 15:52:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // CONTAINER_H
|