mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 02:19:55 +00:00
82e7c04c0a
Adding onActor to Action to choose between playSound and playSound3D.
36 lines
838 B
C++
36 lines
838 B
C++
|
|
#include "action.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
#include "../mwbase/soundmanager.hpp"
|
|
|
|
MWWorld::Action::Action() {}
|
|
|
|
MWWorld::Action::~Action() {}
|
|
|
|
void MWWorld::Action::execute (const Ptr& actor)
|
|
{
|
|
if (!mSoundId.empty())
|
|
{
|
|
if (onActor)
|
|
{
|
|
std::cout << "Douglas - Som Normal" << std::endl;
|
|
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
|
|
MWBase::SoundManager::Play_NoTrack);
|
|
}
|
|
else
|
|
{
|
|
std::cout << "Douglas - Som 3D" << std::endl;
|
|
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
|
|
MWBase::SoundManager::Play_NoTrack);
|
|
}
|
|
}
|
|
|
|
executeImp (actor);
|
|
}
|
|
|
|
void MWWorld::Action::setSound (const std::string& id, const bool onActorValue)
|
|
{
|
|
mSoundId = id;
|
|
onActor = onActorValue;
|
|
}
|