Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarInventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r--source/frontend/StarInventory.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp
index 3730c9b..1c42a0d 100644
--- a/source/frontend/StarInventory.cpp
+++ b/source/frontend/StarInventory.cpp
@@ -450,12 +450,13 @@ void InventoryPane::update(float dt) {
}
if (auto item = inventory->swapSlotItem()) {
+ float pitch = 1.f - ((float)item->count() / (float)item->maxStack()) * .2f;
if (!m_currentSwapSlotItem || !item->matches(*m_currentSwapSlotItem, true))
- context->playAudio(RandomSource().randFrom(m_pickUpSounds));
+ context->playAudio(RandomSource().randFrom(m_pickUpSounds), 0, 1.f, pitch);
else if (item->count() > m_currentSwapSlotItem->count())
- context->playAudio(RandomSource().randFrom(m_someUpSounds));
+ context->playAudio(RandomSource().randFrom(m_someUpSounds), 0, 1.f, pitch);
else if (item->count() < m_currentSwapSlotItem->count())
- context->playAudio(RandomSource().randFrom(m_someDownSounds));
+ context->playAudio(RandomSource().randFrom(m_someDownSounds), 0, 1.f, pitch);
m_currentSwapSlotItem = item->descriptor();
} else {