mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
fixed another item dropping bug
This commit is contained in:
parent
0f811edb47
commit
477f1b42ab
5 changed files with 23 additions and 2 deletions
|
@ -118,6 +118,17 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
|
|||
containerStore.add(object);
|
||||
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;
|
||||
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace MWGui
|
|||
|
||||
void openContainer(MWWorld::Ptr container);
|
||||
void setFilter(Filter filter); ///< set category filter
|
||||
void Update();
|
||||
virtual void Update();
|
||||
void drawItems();
|
||||
|
||||
virtual void notifyContentChanged() { }
|
||||
|
|
|
@ -269,6 +269,9 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
|
|||
float mouseX = cursorPosition.left / float(viewSize.width);
|
||||
float mouseY = cursorPosition.top / float(viewSize.height);
|
||||
|
||||
int origCount = object.getRefData().getCount();
|
||||
object.getRefData().setCount(mDragAndDrop->mDraggedCount);
|
||||
|
||||
if (world->canPlaceObject(mouseX, mouseY))
|
||||
world->placeObject(object, mouseX, mouseY);
|
||||
else
|
||||
|
@ -280,7 +283,7 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
|
|||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||
|
||||
// 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->mIsOnDragAndDrop = false;
|
||||
|
|
|
@ -242,7 +242,13 @@ namespace MWGui
|
|||
}
|
||||
|
||||
void InventoryWindow::notifyContentChanged()
|
||||
{
|
||||
}
|
||||
|
||||
void InventoryWindow::Update()
|
||||
{
|
||||
updateEncumbranceBar();
|
||||
|
||||
ContainerBase::Update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace MWGui
|
|||
|
||||
void openInventory();
|
||||
|
||||
virtual void Update();
|
||||
virtual void notifyContentChanged();
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue