1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
openmw-tes3mp/apps/openmw/mwgui/inventorywindow.hpp

133 lines
3.3 KiB
C++
Raw Normal View History

2012-04-21 08:51:01 +00:00
#ifndef MGUI_Inventory_H
#define MGUI_Inventory_H
#include "windowpinnablebase.hpp"
2013-07-31 19:40:29 +00:00
#include "mode.hpp"
2012-05-12 20:44:12 +00:00
2015-01-10 01:50:43 +00:00
#include "../mwworld/ptr.hpp"
#include "../mwrender/characterpreview.hpp"
2015-01-10 01:50:43 +00:00
namespace osg
2015-05-20 00:18:20 +00:00
{
class Group;
2015-05-20 00:18:20 +00:00
}
namespace Resource
{
class ResourceSystem;
}
2012-04-21 08:51:01 +00:00
namespace MWGui
{
2015-01-10 01:50:43 +00:00
namespace Widgets
{
class MWDynamicStat;
}
2013-05-11 16:38:27 +00:00
class ItemView;
class SortFilterItemModel;
class TradeItemModel;
class DragAndDrop;
class ItemModel;
class InventoryWindow : public WindowPinnableBase
2012-04-21 08:51:01 +00:00
{
public:
InventoryWindow(DragAndDrop* dragAndDrop, osg::Group* parent, Resource::ResourceSystem* resourceSystem);
virtual void onOpen();
/// start trading, disables item drag&drop
2013-05-11 16:38:27 +00:00
void setTrading(bool trading);
void onFrame(float dt);
2012-05-15 20:45:46 +00:00
void pickUpObject (MWWorld::Ptr object);
MWWorld::Ptr getAvatarSelectedItem(int x, int y);
2015-01-10 01:50:43 +00:00
void rebuildAvatar();
SortFilterItemModel* getSortFilterModel();
2013-05-11 16:38:27 +00:00
TradeItemModel* getTradeModel();
ItemModel* getModel();
void updateItemView();
2013-05-15 15:54:18 +00:00
void updatePlayer();
void clear();
void useItem(const MWWorld::Ptr& ptr);
2013-07-31 19:40:29 +00:00
void setGuiMode(GuiMode mode);
/// Cycle to previous/next weapon
void cycle(bool next);
2013-05-11 16:38:27 +00:00
private:
DragAndDrop* mDragAndDrop;
int mSelectedItem;
2013-05-11 16:38:27 +00:00
MWWorld::Ptr mPtr;
MWGui::ItemView* mItemView;
SortFilterItemModel* mSortModel;
TradeItemModel* mTradeModel;
2012-05-12 19:28:04 +00:00
MyGUI::Widget* mAvatar;
2012-09-12 22:54:32 +00:00
MyGUI::ImageBox* mAvatarImage;
2012-05-12 19:28:04 +00:00
MyGUI::TextBox* mArmorRating;
2013-03-31 11:13:46 +00:00
Widgets::MWDynamicStat* mEncumbranceBar;
2012-05-12 19:28:04 +00:00
MyGUI::Widget* mLeftPane;
MyGUI::Widget* mRightPane;
2012-05-12 19:28:04 +00:00
MyGUI::Button* mFilterAll;
MyGUI::Button* mFilterWeapon;
MyGUI::Button* mFilterApparel;
MyGUI::Button* mFilterMagic;
MyGUI::Button* mFilterMisc;
MWWorld::Ptr mSkippedToEquip;
2013-07-31 19:40:29 +00:00
GuiMode mGuiMode;
2012-09-14 15:10:10 +00:00
int mLastXSize;
int mLastYSize;
2012-09-14 12:34:18 +00:00
std::unique_ptr<MyGUI::ITexture> mPreviewTexture;
std::unique_ptr<MWRender::InventoryPreview> mPreview;
2012-09-14 12:34:18 +00:00
bool mTrading;
2013-05-11 16:38:27 +00: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);
void onWindowResize(MyGUI::Window* _sender);
2012-05-12 19:44:33 +00:00
void onFilterChanged(MyGUI::Widget* _sender);
void onAvatarClicked(MyGUI::Widget* _sender);
2012-05-12 20:44:12 +00:00
void onPinToggled();
void onTitleDoubleClicked();
2012-05-15 20:45:46 +00:00
void updateEncumbranceBar();
2013-05-11 16:38:27 +00:00
void notifyContentChanged();
2015-05-20 00:18:20 +00:00
void dirtyPreview();
void updatePreviewSize();
void updateArmorRating();
2013-12-03 17:42:35 +00:00
void adjustPanes();
/// Unequips count items from mSelectedItem, if it is equipped, and then updates mSelectedItem in case the items were re-stacked
void ensureSelectedItemUnequipped(int count);
2012-04-21 08:51:01 +00:00
};
}
2012-04-21 08:51:01 +00:00
#endif // Inventory_H