mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 09:39:56 +00:00
Use sayDone() only for scripting backward compatibility
This commit is contained in:
parent
c9deb1b325
commit
d58f93f388
@ -100,9 +100,12 @@ namespace MWBase
|
||||
///< Say some text, without an actor ref
|
||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||
|
||||
virtual bool sayDone(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const = 0;
|
||||
virtual bool sayActive(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const = 0;
|
||||
///< Is actor not speaking?
|
||||
|
||||
virtual bool sayDone(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const = 0;
|
||||
///< For scripting backward compatibility
|
||||
|
||||
virtual void stopSay(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) = 0;
|
||||
///< Stop an actor speaking
|
||||
|
||||
|
@ -540,7 +540,7 @@ namespace MWDialogue
|
||||
void DialogueManager::say(const MWWorld::Ptr &actor, const std::string &topic)
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
if(!sndMgr->sayDone(actor))
|
||||
if(sndMgr->sayActive(actor))
|
||||
{
|
||||
// Actor is already saying something.
|
||||
return;
|
||||
|
@ -372,7 +372,7 @@ namespace MWMechanics
|
||||
|
||||
void Actors::playIdleDialogue(const MWWorld::Ptr& actor)
|
||||
{
|
||||
if (!actor.getClass().isActor() || actor == getPlayer() || !MWBase::Environment::get().getSoundManager()->sayDone(actor))
|
||||
if (!actor.getClass().isActor() || actor == getPlayer() || MWBase::Environment::get().getSoundManager()->sayActive(actor))
|
||||
return;
|
||||
|
||||
const CreatureStats &stats = actor.getClass().getCreatureStats(actor);
|
||||
|
@ -184,7 +184,7 @@ void HeadAnimationTime::update(float dt)
|
||||
if (!mEnabled)
|
||||
return;
|
||||
|
||||
if (MWBase::Environment::get().getSoundManager()->sayDone(mReference))
|
||||
if (!MWBase::Environment::get().getSoundManager()->sayActive(mReference))
|
||||
{
|
||||
mBlinkTimer += dt;
|
||||
|
||||
|
@ -566,6 +566,27 @@ namespace MWSound
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SoundManager::sayActive(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
SaySoundMap::const_iterator snditer = mSaySoundsQueue.find(ptr);
|
||||
if(snditer != mSaySoundsQueue.end())
|
||||
{
|
||||
if(mOutput->isStreamPlaying(snditer->second))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
snditer = mActiveSaySounds.find(ptr);
|
||||
if(snditer != mActiveSaySounds.end())
|
||||
{
|
||||
if(mOutput->isStreamPlaying(snditer->second))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SoundManager::stopSay(const MWWorld::ConstPtr &ptr)
|
||||
{
|
||||
SaySoundMap::iterator snditer = mSaySoundsQueue.find(ptr);
|
||||
|
@ -179,9 +179,12 @@ namespace MWSound
|
||||
///< Say some text, without an actor ref
|
||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||
|
||||
virtual bool sayDone(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const;
|
||||
virtual bool sayActive(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const;
|
||||
///< Is actor not speaking?
|
||||
|
||||
virtual bool sayDone(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const;
|
||||
///< For scripting backward compatibility
|
||||
|
||||
virtual void stopSay(const MWWorld::ConstPtr &reference=MWWorld::ConstPtr());
|
||||
///< Stop an actor speaking
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user