mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Reorganize sounds, revert spam sound press, add witch sounds and fix slimes
This commit is contained in:
parent
2f2d343901
commit
98425a7644
|
|
@ -268,8 +268,6 @@ void SoundEngine::updateMiniAudio()
|
|||
finalVolume = 1.0f;
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
printf("Sound volume set to %f\n", finalVolume);
|
||||
|
||||
ma_sound_set_pitch(&s->sound, s->info.pitch);
|
||||
|
||||
if (s->info.bIs3D)
|
||||
|
|
@ -475,67 +473,64 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
|||
char finalPath[256];
|
||||
sprintf_s(finalPath, "%s.wav", basePath);
|
||||
|
||||
if (!FileExists(finalPath))
|
||||
{
|
||||
int count = 0;
|
||||
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
|
||||
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
|
||||
bool found = false;
|
||||
|
||||
for (size_t i = 1; i < 32; i++)
|
||||
{
|
||||
char numberedFolder[256];
|
||||
sprintf_s(numberedFolder, "%s%d", basePath, i);
|
||||
|
||||
DWORD attr = GetFileAttributesA(numberedFolder);
|
||||
|
||||
if (attr != INVALID_FILE_ATTRIBUTES &&
|
||||
(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char chosenFolder[256];
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
sprintf_s(chosenFolder, "%s", basePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
int chosen = (rand() % count) + 1;
|
||||
sprintf_s(chosenFolder, "%s%d", basePath, chosen);
|
||||
}
|
||||
|
||||
char searchPattern[256];
|
||||
sprintf_s(searchPattern, "%s\\*.wav", chosenFolder);
|
||||
|
||||
WIN32_FIND_DATAA findData;
|
||||
HANDLE hFind = FindFirstFileA(searchPattern, &findData);
|
||||
|
||||
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
|
||||
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < extCount; i++)
|
||||
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
|
||||
{
|
||||
char basePlusExt[256];
|
||||
sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]);
|
||||
|
||||
DWORD attr = GetFileAttributesA(basePlusExt);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
sprintf_s(searchPattern, "%s\\*%s", chosenFolder, extensions[i]);
|
||||
hFind = FindFirstFileA(searchPattern, &findData);
|
||||
if (hFind != INVALID_HANDLE_VALUE)
|
||||
sprintf_s(finalPath, "%s", basePlusExt);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
|
||||
{
|
||||
for (size_t i = 1; i < 32; i++)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
char numberedPath[256];
|
||||
sprintf_s(numberedPath, "%s%d%s", basePath, i, extensions[extIdx]);
|
||||
|
||||
DWORD attr = GetFileAttributesA(numberedPath);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
count = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
app.DebugPrintf("No sound files found in %s\n", chosenFolder);
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf_s(finalPath, "%s\\%s", chosenFolder, findData.cFileName);
|
||||
FindClose(hFind);
|
||||
if (count > 0)
|
||||
{
|
||||
int chosen = (rand() % count) + 1;
|
||||
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
|
||||
{
|
||||
char numberedPath[256];
|
||||
sprintf_s(numberedPath, "%s%d%s", basePath, chosen, extensions[extIdx]);
|
||||
|
||||
DWORD attr = GetFileAttributesA(numberedPath);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
sprintf_s(finalPath, "%s", numberedPath);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
sprintf_s(finalPath, "%s%d.wav", basePath, chosen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MiniAudioSound* s = new MiniAudioSound();
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
||||
{
|
||||
L"mob.chicken", // eSoundType_MOB_CHICKEN_AMBIENT
|
||||
L"mob.chickenhurt", // eSoundType_MOB_CHICKEN_HURT
|
||||
L"mob.chickenplop", // eSoundType_MOB_CHICKENPLOP
|
||||
L"mob.cow", // eSoundType_MOB_COW_AMBIENT
|
||||
L"mob.cowhurt", // eSoundType_MOB_COW_HURT
|
||||
L"mob.pig", // eSoundType_MOB_PIG_AMBIENT
|
||||
L"mob.pigdeath", // eSoundType_MOB_PIG_DEATH
|
||||
L"mob.sheep", // eSoundType_MOB_SHEEP_AMBIENT
|
||||
L"mob.chicken.say", // eSoundType_MOB_CHICKEN_AMBIENT
|
||||
L"mob.chicken.hurt", // eSoundType_MOB_CHICKEN_HURT
|
||||
L"mob.chicken.plop", // eSoundType_MOB_CHICKENPLOP
|
||||
L"mob.cow.say", // eSoundType_MOB_COW_AMBIENT
|
||||
L"mob.cow.hurt", // eSoundType_MOB_COW_HURT
|
||||
L"mob.pig.say", // eSoundType_MOB_PIG_AMBIENT
|
||||
L"mob.pig.death", // eSoundType_MOB_PIG_DEATH
|
||||
L"mob.sheep.say", // eSoundType_MOB_SHEEP_AMBIENT
|
||||
L"mob.wolf.growl", // eSoundType_MOB_WOLF_GROWL
|
||||
L"mob.wolf.whine", // eSoundType_MOB_WOLF_WHINE
|
||||
L"mob.wolf.panting", // eSoundType_MOB_WOLF_PANTING
|
||||
|
|
@ -43,15 +43,15 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
|||
L"mob.silverfish.step", // eSoundType_MOB_SILVERFISH_STEP,
|
||||
L"mob.skeleton", // eSoundType_MOB_SKELETON_AMBIENT,
|
||||
L"mob.skeletonhurt", // eSoundType_MOB_SKELETON_HURT,
|
||||
L"mob.spider", // eSoundType_MOB_SPIDER_AMBIENT,
|
||||
L"mob.spiderdeath", // eSoundType_MOB_SPIDER_DEATH,
|
||||
L"mob.spider.say", // eSoundType_MOB_SPIDER_AMBIENT,
|
||||
L"mob.spider.death", // eSoundType_MOB_SPIDER_DEATH,
|
||||
L"mob.slime", // eSoundType_MOB_SLIME,
|
||||
L"mob.slimeattack", // eSoundType_MOB_SLIME_ATTACK,
|
||||
L"mob.creeper", // eSoundType_MOB_CREEPER_HURT,
|
||||
L"mob.creeperdeath", // eSoundType_MOB_CREEPER_DEATH,
|
||||
L"mob.zombie", // eSoundType_MOB_ZOMBIE_AMBIENT,
|
||||
L"mob.zombiehurt", // eSoundType_MOB_ZOMBIE_HURT,
|
||||
L"mob.zombiedeath", // eSoundType_MOB_ZOMBIE_DEATH,
|
||||
L"mob.slime.attack", // eSoundType_MOB_SLIME_ATTACK,
|
||||
L"mob.creeper.say", // eSoundType_MOB_CREEPER_HURT,
|
||||
L"mob.creeper.death", // eSoundType_MOB_CREEPER_DEATH,
|
||||
L"mob.zombie.say", // eSoundType_MOB_ZOMBIE_AMBIENT,
|
||||
L"mob.zombie.hurt", // eSoundType_MOB_ZOMBIE_HURT,
|
||||
L"mob.zombie.death", // eSoundType_MOB_ZOMBIE_DEATH,
|
||||
L"mob.zombie.wood", // eSoundType_MOB_ZOMBIE_WOOD,
|
||||
L"mob.zombie.woodbreak", // eSoundType_MOB_ZOMBIE_WOOD_BREAK,
|
||||
L"mob.zombie.metal", // eSoundType_MOB_ZOMBIE_METAL,
|
||||
|
|
@ -86,7 +86,7 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
|||
L"random.door_close", // eSoundType_RANDOM_DOOR_CLOSE,
|
||||
L"ambient.weather.rain", // eSoundType_AMBIENT_WEATHER_RAIN,
|
||||
L"ambient.weather.thunder", // eSoundType_AMBIENT_WEATHER_THUNDER,
|
||||
L"ambient.cave.cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!!
|
||||
L"ambient.cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!!
|
||||
#ifdef _XBOX
|
||||
L"ambient.cave.cave2", // eSoundType_CAVE_CAVE2 - removed the two sounds that were at 192k in the first ambient cave event
|
||||
#endif
|
||||
|
|
@ -210,9 +210,9 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
|||
L"mob.horse.soft", //eSoundType_MOB_HORSE_SOFT,
|
||||
L"mob.horse.jump", //eSoundType_MOB_HORSE_JUMP,
|
||||
|
||||
L"mob.witch.idle", //eSoundType_MOB_WITCH_IDLE, <--- missing
|
||||
L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT, <--- missing
|
||||
L"mob.witch.death", //eSoundType_MOB_WITCH_DEATH, <--- missing
|
||||
L"mob.witch.ambient", //eSoundType_MOB_WITCH_IDLE,
|
||||
L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT,
|
||||
L"mob.witch.death", //eSoundType_MOB_WITCH_DEATH,
|
||||
|
||||
L"mob.slime.big", //eSoundType_MOB_SLIME_BIG,
|
||||
L"mob.slime.small", //eSoundType_MOB_SLIME_SMALL,
|
||||
|
|
|
|||
|
|
@ -1377,14 +1377,22 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
quickKeyHeld = TRUE;
|
||||
if (IsSectionSlotList(m_eCurrSection))
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection);
|
||||
|
||||
bool bcanPlaySound = !isSlotEmpty(m_eCurrSection, currentIndex);
|
||||
if (bcanPlaySound)
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (IsSectionSlotList(m_eCurrSection))
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection);
|
||||
|
||||
bool bcanPlaySound = !isSlotEmpty(m_eCurrSection, currentIndex);
|
||||
if (bcanPlaySound)
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
//
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth4.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass4.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel4.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand4.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow4.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone1.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone1.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone2.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone2.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone3.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone3.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone4.ogg
Normal file
BIN
Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone4.ogg
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue