Add volume and pitch to projectile sound actions
did it to some chat bubble thing too lol, why not.
This commit is contained in:
parent
63c9e3ec8b
commit
83ca73b299
@ -311,6 +311,8 @@ void ChatBubbleManager::addChatActions(List<ChatAction> chatActions, bool silent
|
||||
auto assets = Root::singleton().assets();
|
||||
AudioInstancePtr audioInstance = make_shared<AudioInstance>(*assets->audio(*sound));
|
||||
audioInstance->setPosition(position);
|
||||
audioInstance->setVolume(config.getFloat("volume", 1.0f));
|
||||
audioInstance->setPitchMultiplier(config.getFloat("pitch", 1.0f));
|
||||
m_guiContext->playAudio(audioInstance);
|
||||
}
|
||||
}
|
||||
|
@ -816,6 +816,8 @@ void Projectile::processAction(Json const& action) {
|
||||
|
||||
AudioInstancePtr sound = make_shared<AudioInstance>(*Root::singleton().assets()->audio(Random::randValueFrom(parameters.getArray("options")).toString()));
|
||||
sound->setPosition(position());
|
||||
sound->setVolume(parameters.getFloat("volume", 1.0f));
|
||||
sound->setPitchMultiplier(parameters.getFloat("pitch", 1.0f));
|
||||
m_pendingRenderables.append(std::move(sound));
|
||||
|
||||
} else if (command == "light") {
|
||||
|
Loading…
Reference in New Issue
Block a user