remove redundant allowedToInsertItems() function from ItemModel

new-script-api
Andrei Kortunov 7 years ago
parent 99517d83ea
commit 03f129b53c

@ -52,10 +52,9 @@ namespace MWGui
void ContainerWindow::onItemSelected(int index)
{
if (mDragAndDrop->mIsOnDragAndDrop)
if (mDragAndDrop->mIsOnDragAndDrop && mModel)
{
if (mModel && mModel->allowedToInsertItems())
dropItem();
dropItem();
return;
}
@ -105,7 +104,7 @@ namespace MWGui
void ContainerWindow::onBackgroundSelected()
{
if (mDragAndDrop->mIsOnDragAndDrop && mModel && mModel->allowedToInsertItems())
if (mDragAndDrop->mIsOnDragAndDrop && mModel)
dropItem();
}

@ -94,11 +94,6 @@ namespace MWGui
return true;
}
bool ItemModel::allowedToInsertItems() const
{
return true;
}
bool ItemModel::onDropItem(const MWWorld::Ptr &item, int count)
{
return true;

@ -72,9 +72,6 @@ namespace MWGui
/// Is the player allowed to use items from this item model? (default true)
virtual bool allowedToUseItems() const;
/// Is the player allowed to insert items into this model? (default true)
virtual bool allowedToInsertItems() const;
virtual void onClose()
{
}

@ -79,12 +79,6 @@ namespace MWGui
ProxyItemModel::removeItem(item, count);
}
bool PickpocketItemModel::allowedToInsertItems() const
{
// don't allow "reverse pickpocket" (it will be handled by scripts after 1.0)
return false;
}
bool PickpocketItemModel::onDropItem(const MWWorld::Ptr &item, int count)
{
// don't allow "reverse pickpocket" (it will be handled by scripts after 1.0)

@ -17,7 +17,6 @@ namespace MWGui
virtual size_t getItemCount();
virtual void update();
virtual void removeItem (const ItemStack& item, size_t count);
virtual bool allowedToInsertItems() const;
virtual void onClose();
virtual bool onDropItem(const MWWorld::Ptr &item, int count);
virtual bool onTakeItem(const MWWorld::Ptr &item, int count);

Loading…
Cancel
Save