2013-05-11 18:38:27 +02: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 17:01:02 +02:00
|
|
|
PickpocketItemModel (const MWWorld::Ptr& thief, ItemModel* sourceModel, bool hideItems=true);
|
2017-10-03 09:59:31 +04:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool allowedToUseItems() const override;
|
|
|
|
ItemStack getItem (ModelIndex index) override;
|
|
|
|
size_t getItemCount() override;
|
|
|
|
void update() override;
|
|
|
|
void removeItem (const ItemStack& item, size_t count) override;
|
|
|
|
void onClose() override;
|
|
|
|
bool onDropItem(const MWWorld::Ptr &item, int count) override;
|
|
|
|
bool onTakeItem(const MWWorld::Ptr &item, int count) override;
|
2017-10-04 21:25:22 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
MWWorld::Ptr mActor;
|
2017-10-04 23:26:06 +04:00
|
|
|
bool mPickpocketDetected;
|
|
|
|
bool stealItem(const MWWorld::Ptr &item, int count);
|
2013-05-11 18:38:27 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<ItemStack> mHiddenItems;
|
|
|
|
std::vector<ItemStack> mItems;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|