mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
fixed another item dropping bug
This commit is contained in:
parent
0f811edb47
commit
477f1b42ab
@ -118,6 +118,17 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
|
|||||||
containerStore.add(object);
|
containerStore.add(object);
|
||||||
object.getRefData().setCount (origCount - mDragAndDrop->mDraggedCount);
|
object.getRefData().setCount (origCount - mDragAndDrop->mDraggedCount);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// check that we don't exceed the allowed weight (only for containers, not for inventory)
|
||||||
|
if (isInventory())
|
||||||
|
{
|
||||||
|
float curWeight = MWWorld::Class::get(mContainer).getEncumbrance(mContainer);
|
||||||
|
float capacity = MWWorld::Class::get(mContainer).getCapacity(mContainer);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mDragAndDrop->mIsOnDragAndDrop = false;
|
mDragAndDrop->mIsOnDragAndDrop = false;
|
||||||
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
|
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
|
||||||
|
@ -77,7 +77,7 @@ namespace MWGui
|
|||||||
|
|
||||||
void openContainer(MWWorld::Ptr container);
|
void openContainer(MWWorld::Ptr container);
|
||||||
void setFilter(Filter filter); ///< set category filter
|
void setFilter(Filter filter); ///< set category filter
|
||||||
void Update();
|
virtual void Update();
|
||||||
void drawItems();
|
void drawItems();
|
||||||
|
|
||||||
virtual void notifyContentChanged() { }
|
virtual void notifyContentChanged() { }
|
||||||
|
@ -269,6 +269,9 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
|
|||||||
float mouseX = cursorPosition.left / float(viewSize.width);
|
float mouseX = cursorPosition.left / float(viewSize.width);
|
||||||
float mouseY = cursorPosition.top / float(viewSize.height);
|
float mouseY = cursorPosition.top / float(viewSize.height);
|
||||||
|
|
||||||
|
int origCount = object.getRefData().getCount();
|
||||||
|
object.getRefData().setCount(mDragAndDrop->mDraggedCount);
|
||||||
|
|
||||||
if (world->canPlaceObject(mouseX, mouseY))
|
if (world->canPlaceObject(mouseX, mouseY))
|
||||||
world->placeObject(object, mouseX, mouseY);
|
world->placeObject(object, mouseX, mouseY);
|
||||||
else
|
else
|
||||||
@ -280,7 +283,7 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
|
|||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
// remove object from the container it was coming from
|
// remove object from the container it was coming from
|
||||||
object.getRefData().setCount(object.getRefData().getCount() - mDragAndDrop->mDraggedCount);
|
object.getRefData().setCount(origCount - mDragAndDrop->mDraggedCount);
|
||||||
mDragAndDrop->mDraggedFrom->notifyContentChanged();
|
mDragAndDrop->mDraggedFrom->notifyContentChanged();
|
||||||
|
|
||||||
mDragAndDrop->mIsOnDragAndDrop = false;
|
mDragAndDrop->mIsOnDragAndDrop = false;
|
||||||
|
@ -242,7 +242,13 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InventoryWindow::notifyContentChanged()
|
void InventoryWindow::notifyContentChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void InventoryWindow::Update()
|
||||||
{
|
{
|
||||||
updateEncumbranceBar();
|
updateEncumbranceBar();
|
||||||
|
|
||||||
|
ContainerBase::Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ namespace MWGui
|
|||||||
|
|
||||||
void openInventory();
|
void openInventory();
|
||||||
|
|
||||||
|
virtual void Update();
|
||||||
virtual void notifyContentChanged();
|
virtual void notifyContentChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user