From 31bd70f3345e533ae4e0c7da9b5f685427f638bd Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 2 Apr 2017 23:19:43 +0400 Subject: [PATCH 1/2] Added missed recharge and repair sounds --- apps/openmw/mwgui/recharge.cpp | 7 +++++++ apps/openmw/mwgui/repair.cpp | 3 +++ apps/openmw/mwmechanics/repair.cpp | 3 +++ 3 files changed, 13 insertions(+) diff --git a/apps/openmw/mwgui/recharge.cpp b/apps/openmw/mwgui/recharge.cpp index 990e4468b..afca12ad9 100644 --- a/apps/openmw/mwgui/recharge.cpp +++ b/apps/openmw/mwgui/recharge.cpp @@ -12,6 +12,7 @@ #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwbase/soundmanager.hpp" #include "../mwworld/containerstore.hpp" #include "../mwworld/class.hpp" @@ -137,10 +138,16 @@ void Recharge::onItemClicked(MyGUI::Widget *sender, const MWWorld::Ptr& item) item.getCellRef().setEnchantmentCharge( std::min(item.getCellRef().getEnchantmentCharge() + restored, static_cast(enchantment->mData.mCharge))); + MWBase::Environment::get().getSoundManager()->playSound("Enchant Success",1,1); + player.getClass().getContainerStore(player).restack(item); player.getClass().skillUsageSucceeded (player, ESM::Skill::Enchant, 0); } + else + { + MWBase::Environment::get().getSoundManager()->playSound("Enchant Fail",1,1); + } gem.getContainerStore()->remove(gem, 1, player); diff --git a/apps/openmw/mwgui/repair.cpp b/apps/openmw/mwgui/repair.cpp index 15a4a64d7..3acea985b 100644 --- a/apps/openmw/mwgui/repair.cpp +++ b/apps/openmw/mwgui/repair.cpp @@ -11,6 +11,7 @@ #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwbase/soundmanager.hpp" #include "../mwmechanics/actorutil.hpp" @@ -62,6 +63,8 @@ void Repair::exit() void Repair::startRepairItem(const MWWorld::Ptr &item) { + MWBase::Environment::get().getSoundManager()->playSound("Item Repair Up",1,1); + mRepair.setTool(item); mToolIcon->setItem(item); diff --git a/apps/openmw/mwmechanics/repair.cpp b/apps/openmw/mwmechanics/repair.cpp index 9b48f5fcb..a1c79ea23 100644 --- a/apps/openmw/mwmechanics/repair.cpp +++ b/apps/openmw/mwmechanics/repair.cpp @@ -99,6 +99,9 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair) if (Misc::StringUtils::ciEqual(iter->getCellRef().getRefId(), mTool.getCellRef().getRefId())) { mTool = *iter; + + MWBase::Environment::get().getSoundManager()->playSound("Item Repair Up",1,1); + break; } } From c962b6dd6d2f8a136096109378ea49045c50a866 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sun, 9 Apr 2017 18:31:46 +0200 Subject: [PATCH 2/2] Fix correctActorModelPath to work properly when both backward and forward slashes are used in the path (Fixes #3822) --- components/misc/resourcehelpers.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 6fe13abf3..5cf4378b8 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -127,9 +127,7 @@ std::string Misc::ResourceHelpers::correctBookartPath(const std::string &resPath std::string Misc::ResourceHelpers::correctActorModelPath(const std::string &resPath, const VFS::Manager* vfs) { std::string mdlname = resPath; - std::string::size_type p = mdlname.rfind('\\'); - if(p == std::string::npos) - p = mdlname.rfind('/'); + std::string::size_type p = mdlname.find_last_of("/\\"); if(p != std::string::npos) mdlname.insert(mdlname.begin()+p+1, 'x'); else