From 83ca73b299d6d6df810eeb0ebff803f67d7be3ac Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:47:40 +1000 Subject: [PATCH] Add volume and pitch to projectile sound actions did it to some chat bubble thing too lol, why not. --- source/frontend/StarChatBubbleManager.cpp | 2 ++ source/game/StarProjectile.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/source/frontend/StarChatBubbleManager.cpp b/source/frontend/StarChatBubbleManager.cpp index 3137353..b08e292 100644 --- a/source/frontend/StarChatBubbleManager.cpp +++ b/source/frontend/StarChatBubbleManager.cpp @@ -311,6 +311,8 @@ void ChatBubbleManager::addChatActions(List chatActions, bool silent auto assets = Root::singleton().assets(); AudioInstancePtr audioInstance = make_shared(*assets->audio(*sound)); audioInstance->setPosition(position); + audioInstance->setVolume(config.getFloat("volume", 1.0f)); + audioInstance->setPitchMultiplier(config.getFloat("pitch", 1.0f)); m_guiContext->playAudio(audioInstance); } } diff --git a/source/game/StarProjectile.cpp b/source/game/StarProjectile.cpp index d00b76b..b3f5184 100644 --- a/source/game/StarProjectile.cpp +++ b/source/game/StarProjectile.cpp @@ -816,6 +816,8 @@ void Projectile::processAction(Json const& action) { AudioInstancePtr sound = make_shared(*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") {