forked from mirror/openmw-tes3mp
drop item on avatar from external container bugfix
This commit is contained in:
parent
fca9f1fc5f
commit
c5185cf2e4
3 changed files with 2 additions and 9 deletions
|
@ -136,8 +136,6 @@ void ContainerBase::onSelectedItemImpl(MyGUI::Widget* _sender, int count)
|
||||||
static_cast<MyGUI::TextBox*>(mSelectedItem->getChildAt(0)->getChildAt(0))->setCaption(
|
static_cast<MyGUI::TextBox*>(mSelectedItem->getChildAt(0)->getChildAt(0))->setCaption(
|
||||||
getCountString(mDragAndDrop->mDraggedCount));
|
getCountString(mDragAndDrop->mDraggedCount));
|
||||||
|
|
||||||
mDragAndDrop->mWasInInventory = isInventory();
|
|
||||||
|
|
||||||
drawItems();
|
drawItems();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->setDragDrop(true);
|
MWBase::Environment::get().getWindowManager()->setDragDrop(true);
|
||||||
|
|
|
@ -36,17 +36,11 @@ namespace MWGui
|
||||||
class DragAndDrop
|
class DragAndDrop
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DragAndDrop() :
|
|
||||||
mWasInInventory(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool mIsOnDragAndDrop;
|
bool mIsOnDragAndDrop;
|
||||||
MyGUI::Widget* mDraggedWidget;
|
MyGUI::Widget* mDraggedWidget;
|
||||||
MyGUI::Widget* mDragAndDropWidget;
|
MyGUI::Widget* mDragAndDropWidget;
|
||||||
ContainerBase* mDraggedFrom;
|
ContainerBase* mDraggedFrom;
|
||||||
int mDraggedCount;
|
int mDraggedCount;
|
||||||
bool mWasInInventory; // was the item in inventory before it was dragged
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ContainerBase
|
class ContainerBase
|
||||||
|
|
|
@ -157,6 +157,7 @@ namespace MWGui
|
||||||
ptr.getRefData().setCount(origCount - mDragAndDrop->mDraggedCount);
|
ptr.getRefData().setCount(origCount - mDragAndDrop->mDraggedCount);
|
||||||
it = invStore.add(ptr);
|
it = invStore.add(ptr);
|
||||||
(*it).getRefData().setCount(mDragAndDrop->mDraggedCount);
|
(*it).getRefData().setCount(mDragAndDrop->mDraggedCount);
|
||||||
|
ptr = *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \todo scripts
|
/// \todo scripts
|
||||||
|
@ -169,7 +170,7 @@ namespace MWGui
|
||||||
// the "Take" button should not be visible.
|
// the "Take" button should not be visible.
|
||||||
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
||||||
// without screwing up future book windows
|
// without screwing up future book windows
|
||||||
if (mDragAndDrop->mWasInInventory)
|
if (mDragAndDrop->mDraggedFrom == this)
|
||||||
{
|
{
|
||||||
mWindowManager.getBookWindow()->setTakeButtonShow(false);
|
mWindowManager.getBookWindow()->setTakeButtonShow(false);
|
||||||
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
|
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
|
||||||
|
|
Loading…
Reference in a new issue