From 8e6c9434009d390d055fe154b705c310d8c03696 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 12 May 2012 20:39:21 +0200 Subject: [PATCH] "take all"-button sound (first item) --- apps/openmw/mwgui/container.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index c4407152df..39bd577af5 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -236,11 +236,21 @@ void ContainerWindow::onTakeAllButtonClicked(MyGUI::Widget* _sender) MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWWorld::ContainerStore& playerStore = MWWorld::Class::get(player).getContainerStore(player); + int i=0; for (MWWorld::ContainerStoreIterator iter (containerStore.begin()); iter!=containerStore.end(); ++iter) { if(iter->getRefData().getCount() > 0) { playerStore.add(*iter); + + if (i==0) + { + // play the sound of the first object + std::string sound = MWWorld::Class::get(*iter).getUpSoundId(*iter); + MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0); + } + + ++i; } }