2012-04-21 10:51:01 +02:00
|
|
|
#ifndef MGUI_Inventory_H
|
|
|
|
#define MGUI_Inventory_H
|
|
|
|
|
2012-09-15 00:57:29 +02:00
|
|
|
#include "../mwrender/characterpreview.hpp"
|
|
|
|
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowpinnablebase.hpp"
|
2013-03-31 13:13:46 +02:00
|
|
|
#include "widgets.hpp"
|
2013-07-31 21:40:29 +02:00
|
|
|
#include "mode.hpp"
|
2012-05-12 22:44:12 +02:00
|
|
|
|
2012-04-21 10:51:01 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-05-11 18:38:27 +02:00
|
|
|
class ItemView;
|
|
|
|
class SortFilterItemModel;
|
|
|
|
class TradeItemModel;
|
|
|
|
class DragAndDrop;
|
|
|
|
class ItemModel;
|
|
|
|
|
|
|
|
class InventoryWindow : public WindowPinnableBase
|
2012-04-21 10:51:01 +02:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 14:46:21 -04:00
|
|
|
InventoryWindow(DragAndDrop* dragAndDrop);
|
2012-04-21 11:05:30 +02:00
|
|
|
|
2012-05-25 15:24:33 +02:00
|
|
|
virtual void open();
|
2012-05-12 18:24:47 +02:00
|
|
|
|
2013-04-03 00:27:29 +02:00
|
|
|
void doRenderUpdate();
|
|
|
|
|
2012-05-18 17:27:55 +02:00
|
|
|
/// start trading, disables item drag&drop
|
2013-05-11 18:38:27 +02:00
|
|
|
void setTrading(bool trading);
|
2012-05-18 17:27:55 +02:00
|
|
|
|
2012-05-19 14:55:09 +02:00
|
|
|
void onFrame();
|
2012-05-15 22:45:46 +02:00
|
|
|
|
2012-06-02 14:19:02 +02:00
|
|
|
void pickUpObject (MWWorld::Ptr object);
|
|
|
|
|
2012-09-14 14:34:18 +02:00
|
|
|
MyGUI::IntCoord getAvatarScreenCoord();
|
|
|
|
|
2012-09-15 00:57:29 +02:00
|
|
|
MWWorld::Ptr getAvatarSelectedItem(int x, int y);
|
|
|
|
|
2012-11-10 11:41:12 +04:00
|
|
|
void rebuildAvatar() {
|
|
|
|
mPreview.rebuild();
|
|
|
|
}
|
|
|
|
|
2013-05-11 18:38:27 +02:00
|
|
|
TradeItemModel* getTradeModel();
|
|
|
|
ItemModel* getModel();
|
|
|
|
|
|
|
|
void updateItemView();
|
|
|
|
|
2013-05-15 17:54:18 +02:00
|
|
|
void updatePlayer();
|
|
|
|
|
2014-01-13 06:15:22 +01:00
|
|
|
void useItem(const MWWorld::Ptr& ptr);
|
|
|
|
|
2013-07-31 21:40:29 +02:00
|
|
|
void setGuiMode(GuiMode mode);
|
|
|
|
|
2013-05-11 18:38:27 +02:00
|
|
|
private:
|
|
|
|
DragAndDrop* mDragAndDrop;
|
|
|
|
|
2013-04-03 00:27:29 +02:00
|
|
|
bool mPreviewDirty;
|
2013-05-11 18:38:27 +02:00
|
|
|
size_t mSelectedItem;
|
|
|
|
|
|
|
|
MWWorld::Ptr mPtr;
|
|
|
|
|
|
|
|
MWGui::ItemView* mItemView;
|
|
|
|
SortFilterItemModel* mSortModel;
|
|
|
|
TradeItemModel* mTradeModel;
|
2013-04-03 00:27:29 +02:00
|
|
|
|
2012-05-12 21:28:04 +02:00
|
|
|
MyGUI::Widget* mAvatar;
|
2012-09-13 00:54:32 +02:00
|
|
|
MyGUI::ImageBox* mAvatarImage;
|
2012-05-12 21:28:04 +02:00
|
|
|
MyGUI::TextBox* mArmorRating;
|
2013-03-31 13:13:46 +02:00
|
|
|
Widgets::MWDynamicStat* mEncumbranceBar;
|
2012-05-12 21:28:04 +02:00
|
|
|
|
2012-05-13 11:25:35 +02:00
|
|
|
MyGUI::Widget* mLeftPane;
|
|
|
|
MyGUI::Widget* mRightPane;
|
|
|
|
|
2012-05-12 21:28:04 +02:00
|
|
|
MyGUI::Button* mFilterAll;
|
|
|
|
MyGUI::Button* mFilterWeapon;
|
|
|
|
MyGUI::Button* mFilterApparel;
|
|
|
|
MyGUI::Button* mFilterMagic;
|
|
|
|
MyGUI::Button* mFilterMisc;
|
|
|
|
|
2014-01-13 06:15:22 +01:00
|
|
|
MWWorld::Ptr mSkippedToEquip;
|
|
|
|
|
2013-07-31 21:40:29 +02:00
|
|
|
GuiMode mGuiMode;
|
|
|
|
|
2012-09-14 17:10:10 +02:00
|
|
|
int mLastXSize;
|
|
|
|
int mLastYSize;
|
2012-09-14 14:34:18 +02:00
|
|
|
|
2012-09-15 00:57:29 +02:00
|
|
|
MWRender::InventoryPreview mPreview;
|
2012-09-14 14:34:18 +02:00
|
|
|
|
2012-05-18 17:27:55 +02:00
|
|
|
bool mTrading;
|
|
|
|
|
2013-05-11 18:38:27 +02:00
|
|
|
void onItemSelected(int index);
|
|
|
|
void onItemSelectedFromSourceModel(int index);
|
|
|
|
|
|
|
|
void onBackgroundSelected();
|
|
|
|
|
|
|
|
void sellItem(MyGUI::Widget* sender, int count);
|
|
|
|
void dragItem(MyGUI::Widget* sender, int count);
|
|
|
|
|
2012-05-12 18:24:47 +02:00
|
|
|
void onWindowResize(MyGUI::Window* _sender);
|
2012-05-12 21:44:33 +02:00
|
|
|
void onFilterChanged(MyGUI::Widget* _sender);
|
2012-05-15 18:05:53 +02:00
|
|
|
void onAvatarClicked(MyGUI::Widget* _sender);
|
2012-05-12 22:44:12 +02:00
|
|
|
void onPinToggled();
|
2012-05-15 18:05:53 +02:00
|
|
|
|
2012-05-15 22:45:46 +02:00
|
|
|
void updateEncumbranceBar();
|
2013-05-11 18:38:27 +02:00
|
|
|
void notifyContentChanged();
|
2013-12-03 18:42:35 +01:00
|
|
|
|
|
|
|
void adjustPanes();
|
2012-04-21 10:51:01 +02:00
|
|
|
};
|
|
|
|
}
|
2012-05-17 13:36:25 +02:00
|
|
|
|
2012-04-21 10:51:01 +02:00
|
|
|
#endif // Inventory_H
|