1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 09:39:56 +00:00

remove redundant allowedToInsertItems() function from ItemModel

This commit is contained in:
Andrei Kortunov 2017-11-11 11:54:18 +04:00
parent 99517d83ea
commit 03f129b53c
5 changed files with 3 additions and 19 deletions

View File

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

View File

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

View File

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

View File

@ -79,12 +79,6 @@ namespace MWGui
ProxyItemModel::removeItem(item, count); 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) bool PickpocketItemModel::onDropItem(const MWWorld::Ptr &item, int count)
{ {
// don't allow "reverse pickpocket" (it will be handled by scripts after 1.0) // don't allow "reverse pickpocket" (it will be handled by scripts after 1.0)

View File

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