1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 23:49:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/container.hpp

71 lines
1.5 KiB
C++
Raw Normal View History

2012-04-15 15:52:39 +00:00
#ifndef MGUI_CONTAINER_H
#define MGUI_CONTAINER_H
#include "windowbase.hpp"
#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:
ContainerWindow(DragAndDrop* dragAndDrop);
2012-05-12 11:12:37 +00:00
void setPtr(const MWWorld::Ptr& container);
virtual void onClose();
2017-09-23 20:16:56 +00:00
void clear() { resetReference(); }
2013-05-11 16:38:27 +00:00
void onFrame(float dt) { checkReferenceAvailable(); }
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;
int mSelectedItem;
2012-05-12 20:44:12 +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);
void onDisposeCorpseButtonClicked(MyGUI::Widget* sender);
/// @return is taking the item allowed?
bool onTakeItem(const ItemStack& item, int count);
virtual void onReferenceUnavailable();
2012-04-15 15:52:39 +00:00
};
}
#endif // CONTAINER_H