Pickup sounds for apparatus, books, clothes, ingredients, lockpicks, misc and probes

This commit is contained in:
Michael Papageorgiou 2012-03-13 18:50:32 +02:00
parent 6dddf8a3d5
commit 34e18df0fe
14 changed files with 147 additions and 0 deletions

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -53,6 +56,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -71,4 +76,14 @@ namespace MWClass
registerClass (typeid (ESM::Apparatus).name(), instance);
}
std::string Apparatus::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Apparatus Up");
}
std::string Apparatus::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Apparatus Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -55,6 +58,8 @@ namespace MWClass
{
// TODO implement reading
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -73,4 +78,14 @@ namespace MWClass
registerClass (typeid (ESM::Book).name(), instance);
}
std::string Book::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Book Up");
}
std::string Book::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Book Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -53,6 +56,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -71,4 +76,14 @@ namespace MWClass
registerClass (typeid (ESM::Clothing).name(), instance);
}
std::string Clothing::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Clothes Up");
}
std::string Clothing::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Clothes Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -51,6 +54,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -69,4 +74,14 @@ namespace MWClass
registerClass (typeid (ESM::Ingredient).name(), instance);
}
std::string Ingredient::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Ingredient Up");
}
std::string Ingredient::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Ingredient Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -54,6 +57,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -72,4 +77,14 @@ namespace MWClass
registerClass (typeid (ESM::Tool).name(), instance);
}
std::string Lockpick::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Lockpick Up");
}
std::string Lockpick::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Lockpick Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Miscellaneous::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -53,6 +56,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -71,4 +76,14 @@ namespace MWClass
registerClass (typeid (ESM::Miscellaneous).name(), instance);
}
std::string Miscellaneous::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Misc Up");
}
std::string Miscellaneous::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Misc Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}

View file

@ -7,9 +7,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass
{
void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -53,6 +56,8 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, false, true);
return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr));
}
@ -71,4 +76,14 @@ namespace MWClass
registerClass (typeid (ESM::Probe).name(), instance);
}
std::string Probe::getUpSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Probe Up");
}
std::string Probe::getDownSoundId (const MWWorld::Ptr& ptr) const
{
return std::string("Item Probe Down");
}
}

View file

@ -26,6 +26,12 @@ namespace MWClass
///< Return name of the script attached to ptr
static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id
};
}