1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:49:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/container.hpp
2021-04-11 14:46:51 +02:00

64 lines
1.5 KiB
C++

#ifndef MGUI_CONTAINER_H
#define MGUI_CONTAINER_H
#include "windowbase.hpp"
#include "referenceinterface.hpp"
#include "itemmodel.hpp"
namespace MyGUI
{
class Gui;
class Widget;
}
namespace MWGui
{
class ContainerWindow;
class ItemView;
class SortFilterItemModel;
}
namespace MWGui
{
class ContainerWindow : public WindowBase, public ReferenceInterface
{
public:
ContainerWindow(DragAndDrop* dragAndDrop);
void setPtr(const MWWorld::Ptr& container) override;
void onClose() override;
void clear() override { resetReference(); }
void onFrame(float dt) override { checkReferenceAvailable(); }
void resetReference() override;
private:
DragAndDrop* mDragAndDrop;
MWGui::ItemView* mItemView;
SortFilterItemModel* mSortModel;
ItemModel* mModel;
int mSelectedItem;
MyGUI::Button* mDisposeCorpseButton;
MyGUI::Button* mTakeButton;
MyGUI::Button* mCloseButton;
void onItemSelected(int index);
void onBackgroundSelected();
void dragItem(MyGUI::Widget* sender, int count);
void dropItem();
void onCloseButtonClicked(MyGUI::Widget* _sender);
void onTakeAllButtonClicked(MyGUI::Widget* _sender);
void onDisposeCorpseButtonClicked(MyGUI::Widget* sender);
/// @return is taking the item allowed?
bool onTakeItem(const ItemStack& item, int count);
void onReferenceUnavailable() override;
};
}
#endif // CONTAINER_H