Merge remote-tracking branch 'origin/UISoundsFix'

This commit is contained in:
GuglioIsStupid 2026-03-06 03:16:38 -05:00
commit 171d54a152
8 changed files with 15 additions and 16 deletions

View file

@ -270,10 +270,7 @@ void SoundEngine::updateMiniAudio()
ma_sound_set_volume(&s->sound, finalVolume); ma_sound_set_volume(&s->sound, finalVolume);
printf("Sound volume set to %f\n", finalVolume); printf("Sound volume set to %f\n", finalVolume);
if (!s->info.bUseSoundsPitchVal)
{
ma_sound_set_pitch(&s->sound, s->info.pitch); ma_sound_set_pitch(&s->sound, s->info.pitch);
}
if (s->info.bIs3D) if (s->info.bIs3D)
{ {

View file

@ -1377,10 +1377,6 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
quickKeyHeld = TRUE; quickKeyHeld = TRUE;
if (IsSectionSlotList(m_eCurrSection)) if (IsSectionSlotList(m_eCurrSection))
{ {
int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection);
bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex);
if (bSlotHasItem)
ui.PlayUISFX(eSFX_Press); ui.PlayUISFX(eSFX_Press);
} }
} }
@ -1388,10 +1384,6 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
else { else {
if (IsSectionSlotList(m_eCurrSection)) if (IsSectionSlotList(m_eCurrSection))
{ {
int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection);
bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex);
if (bSlotHasItem)
ui.PlayUISFX(eSFX_Press); ui.PlayUISFX(eSFX_Press);
} }
// //

View file

@ -2342,7 +2342,13 @@ void UIController::PlayUISFX(ESoundEffect eSound)
if (time - m_lastUiSfx < 10) { return; } if (time - m_lastUiSfx < 10) { return; }
m_lastUiSfx = time; m_lastUiSfx = time;
Minecraft::GetInstance()->soundEngine->playUI(eSound,1.0f,1.0f); float pitch = 1.0f;
if (eSound == eSFX_Focus)
{
pitch += (m_randomDistribution(m_randomGenerator) - 0.5f) / 10;
}
Minecraft::GetInstance()->soundEngine->playUI(eSound,1.0f,pitch);
} }
void UIController::DisplayGamertag(unsigned int iPad, bool show) void UIController::DisplayGamertag(unsigned int iPad, bool show)

View file

@ -3,6 +3,7 @@ using namespace std;
#include "IUIController.h" #include "IUIController.h"
#include "UIEnums.h" #include "UIEnums.h"
#include "UIGroup.h" #include "UIGroup.h"
#include <random>
class UIAbstractBitmapFont; class UIAbstractBitmapFont;
class UIBitmapFont; class UIBitmapFont;
@ -63,6 +64,9 @@ private:
UITTFFont *m_mcTTFFont; UITTFFont *m_mcTTFFont;
UIBitmapFont *m_moj7, *m_moj11; UIBitmapFont *m_moj7, *m_moj11;
std::mt19937 m_randomGenerator;
std::uniform_real_distribution<float> m_randomDistribution;
public: public:
void setCleanupOnReload(); void setCleanupOnReload();
void updateCurrentFont(); void updateCurrentFont();

View file

@ -236,7 +236,7 @@ Recipes::Recipes()
L"## ", // L"## ", //
L"###", // L"###", //
L'#', Tile::cobblestone, L'#', Tile::stoneBrick,
L'S'); L'S');
addShapedRecipy(new ItemInstance(Tile::stairs_netherBricks, 4), // addShapedRecipy(new ItemInstance(Tile::stairs_netherBricks, 4), //