From 574c62bc32a99891295ecdcf671c7e3145c7aab2 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 1 Feb 2025 13:29:49 +1100 Subject: allow item pasting to stack --- source/frontend/StarInventory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/frontend/StarInventory.cpp') 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 { -- cgit v1.2.3