1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 14:15:36 +00:00

drop item on avatar from external container bugfix

This commit is contained in:
scrawl 2012-05-17 12:09:53 +02:00
parent fca9f1fc5f
commit c5185cf2e4
3 changed files with 2 additions and 9 deletions

View file

@ -136,8 +136,6 @@ void ContainerBase::onSelectedItemImpl(MyGUI::Widget* _sender, int count)
static_cast<MyGUI::TextBox*>(mSelectedItem->getChildAt(0)->getChildAt(0))->setCaption(
getCountString(mDragAndDrop->mDraggedCount));
mDragAndDrop->mWasInInventory = isInventory();
drawItems();
MWBase::Environment::get().getWindowManager()->setDragDrop(true);

View file

@ -36,17 +36,11 @@ namespace MWGui
class DragAndDrop
{
public:
DragAndDrop() :
mWasInInventory(false)
{
}
bool mIsOnDragAndDrop;
MyGUI::Widget* mDraggedWidget;
MyGUI::Widget* mDragAndDropWidget;
ContainerBase* mDraggedFrom;
int mDraggedCount;
bool mWasInInventory; // was the item in inventory before it was dragged
};
class ContainerBase

View file

@ -157,6 +157,7 @@ namespace MWGui
ptr.getRefData().setCount(origCount - mDragAndDrop->mDraggedCount);
it = invStore.add(ptr);
(*it).getRefData().setCount(mDragAndDrop->mDraggedCount);
ptr = *it;
}
/// \todo scripts
@ -169,7 +170,7 @@ namespace MWGui
// the "Take" button should not be visible.
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
// without screwing up future book windows
if (mDragAndDrop->mWasInInventory)
if (mDragAndDrop->mDraggedFrom == this)
{
mWindowManager.getBookWindow()->setTakeButtonShow(false);
mWindowManager.getScrollWindow()->setTakeButtonShow(false);