2012-04-15 15:52:39 +00:00
|
|
|
#ifndef MGUI_CONTAINER_H
|
|
|
|
#define MGUI_CONTAINER_H
|
|
|
|
|
|
|
|
#include <components/esm_store/store.hpp>
|
|
|
|
#include "../mwclass/container.hpp"
|
|
|
|
#include <sstream>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include "window_base.hpp"
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
#include "../mwworld/containerstore.hpp"
|
2012-05-06 09:04:07 +00:00
|
|
|
#include <vector>
|
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;
|
2012-04-15 15:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2012-04-30 11:01:18 +00:00
|
|
|
class DragAndDrop
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool mIsOnDragAndDrop;
|
|
|
|
ContainerWindow* mContainerWindow;
|
|
|
|
MyGUI::Widget* mDraggedWidget;
|
|
|
|
MyGUI::Widget* mDragAndDropWidget;
|
2012-05-11 10:50:30 +00:00
|
|
|
MWWorld::ContainerStore mStore;
|
2012-05-06 09:04:07 +00:00
|
|
|
MWWorld::Ptr mItem;
|
2012-04-30 11:01:18 +00:00
|
|
|
};
|
2012-04-15 15:52:39 +00:00
|
|
|
|
|
|
|
class ContainerWindow : public WindowBase
|
|
|
|
{
|
2012-04-30 11:01:18 +00:00
|
|
|
public:
|
2012-05-11 09:52:07 +00:00
|
|
|
ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
|
|
|
|
ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop,
|
2012-04-30 11:01:18 +00:00
|
|
|
std::string guiFile);
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-05-11 14:27:24 +00:00
|
|
|
void open(MWWorld::Ptr container);
|
2012-04-30 11:01:18 +00:00
|
|
|
void setName(std::string contName);
|
|
|
|
void Update();
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-04-30 11:01:18 +00:00
|
|
|
virtual ~ContainerWindow();
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-04-30 11:01:18 +00:00
|
|
|
protected:
|
2012-04-21 18:35:45 +00:00
|
|
|
std::vector<MyGUI::WidgetPtr> mContainerWidgets;
|
|
|
|
MyGUI::ItemBoxPtr mContainerWidget;
|
2012-04-15 15:52:39 +00:00
|
|
|
|
|
|
|
MyGUI::ButtonPtr takeButton;
|
|
|
|
MyGUI::ButtonPtr closeButton;
|
2012-04-30 11:01:18 +00:00
|
|
|
DragAndDrop* mDragAndDrop;
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-05-06 09:04:07 +00:00
|
|
|
MWWorld::Ptr mContainer;
|
|
|
|
bool mIsValid;//is in the right GUI Mode
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-05-06 09:04:07 +00:00
|
|
|
void drawItems();
|
2012-04-15 15:52:39 +00:00
|
|
|
|
2012-04-15 19:02:54 +00:00
|
|
|
void onByeClicked(MyGUI::Widget* _sender);
|
2012-04-26 17:35:45 +00:00
|
|
|
void onSelectedItem(MyGUI::Widget* _sender);
|
2012-04-30 11:01:18 +00:00
|
|
|
void onContainerClicked(MyGUI::Widget* _sender);
|
2012-04-26 17:35:45 +00:00
|
|
|
void onMouseMove(MyGUI::Widget* _sender, int _left, int _top);
|
2012-04-15 15:52:39 +00:00
|
|
|
|
|
|
|
//MWWorld::Ptr& mContainer;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // CONTAINER_H
|