2013-05-11 16:38:27 +00:00
|
|
|
#ifndef MWGUI_PICKPOCKET_ITEM_MODEL_H
|
|
|
|
#define MWGUI_PICKPOCKET_ITEM_MODEL_H
|
|
|
|
|
|
|
|
#include "itemmodel.hpp"
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
|
|
|
/// @brief The pickpocket item model randomly hides item stacks based on a specified chance. Equipped items are always hidden.
|
|
|
|
class PickpocketItemModel : public ProxyItemModel
|
|
|
|
{
|
|
|
|
public:
|
2014-08-25 15:01:02 +00:00
|
|
|
PickpocketItemModel (const MWWorld::Ptr& thief, ItemModel* sourceModel, bool hideItems=true);
|
2017-10-03 05:59:31 +00:00
|
|
|
|
|
|
|
virtual bool allowedToUseItems() const;
|
2013-05-11 16:38:27 +00:00
|
|
|
virtual ItemStack getItem (ModelIndex index);
|
|
|
|
virtual size_t getItemCount();
|
|
|
|
virtual void update();
|
|
|
|
virtual void removeItem (const ItemStack& item, size_t count);
|
2016-03-05 18:53:24 +00:00
|
|
|
virtual bool allowedToInsertItems() const;
|
2017-10-04 19:26:06 +00:00
|
|
|
virtual void onClose();
|
|
|
|
virtual bool onDropItem(const MWWorld::Ptr &item, int count);
|
|
|
|
virtual bool onTakeItem(const MWWorld::Ptr &item, int count);
|
2017-10-04 17:25:22 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
MWWorld::Ptr mActor;
|
2017-10-04 19:26:06 +00:00
|
|
|
bool mPickpocketDetected;
|
|
|
|
bool stealItem(const MWWorld::Ptr &item, int count);
|
2013-05-11 16:38:27 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<ItemStack> mHiddenItems;
|
|
|
|
std::vector<ItemStack> mItems;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|