diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-01 13:29:49 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-01 13:29:49 +1100 |
commit | 574c62bc32a99891295ecdcf671c7e3145c7aab2 (patch) | |
tree | 1e2bc58b3bf34b649529c5330c60483bbd033fcf /source/frontend | |
parent | 690d47995f6733eef9b28bd2ebef2c237b61b159 (diff) |
allow item pasting to stack
Diffstat (limited to 'source/frontend')
-rw-r--r-- | source/frontend/StarInventory.cpp | 7 |
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 { |