You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.8 KiB
C++
80 lines
1.8 KiB
C++
#ifndef MGUI_CONTAINER_H
|
|
#define MGUI_CONTAINER_H
|
|
|
|
#include "windowbase.hpp"
|
|
#include "referenceinterface.hpp"
|
|
|
|
#include "itemmodel.hpp"
|
|
|
|
namespace MWWorld
|
|
{
|
|
class Environment;
|
|
}
|
|
|
|
namespace MyGUI
|
|
{
|
|
class Gui;
|
|
class Widget;
|
|
}
|
|
|
|
namespace MWGui
|
|
{
|
|
class WindowManager;
|
|
class ContainerWindow;
|
|
class ItemView;
|
|
class SortFilterItemModel;
|
|
}
|
|
|
|
|
|
namespace MWGui
|
|
{
|
|
class DragAndDrop
|
|
{
|
|
public:
|
|
bool mIsOnDragAndDrop;
|
|
MyGUI::Widget* mDraggedWidget;
|
|
MyGUI::Widget* mDragAndDropWidget;
|
|
ItemModel* mSourceModel;
|
|
ItemView* mSourceView;
|
|
SortFilterItemModel* mSourceSortModel;
|
|
ItemStack mItem;
|
|
int mDraggedCount;
|
|
|
|
void startDrag (int index, SortFilterItemModel* sortModel, ItemModel* sourceModel, ItemView* sourceView, int count);
|
|
void drop (ItemModel* targetModel, ItemView* targetView);
|
|
|
|
void finish();
|
|
};
|
|
|
|
class ContainerWindow : public WindowBase, public ReferenceInterface
|
|
{
|
|
public:
|
|
ContainerWindow(DragAndDrop* dragAndDrop);
|
|
|
|
void open(const MWWorld::Ptr& container, bool loot=false);
|
|
|
|
private:
|
|
DragAndDrop* mDragAndDrop;
|
|
|
|
MWGui::ItemView* mItemView;
|
|
SortFilterItemModel* mSortModel;
|
|
ItemModel* mModel;
|
|
size_t 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);
|
|
|
|
virtual void onReferenceUnavailable();
|
|
};
|
|
}
|
|
#endif // CONTAINER_H
|