diff --git a/Minecraft.Client/Common/App_Defines.h b/Minecraft.Client/Common/App_Defines.h index 6704baf2..004436b2 100644 --- a/Minecraft.Client/Common/App_Defines.h +++ b/Minecraft.Client/Common/App_Defines.h @@ -108,6 +108,7 @@ enum EGameHostOptionWorldSize #define GAMESETTING_VSYNC 0x01000000 #define GAMESETTING_EXCLUSIVEFULLSCREEN 0x02000000 #define GAMESETTING_CLASSICCRAFTING 0x04000000 +#define GAMESETTING_CAVESOUNDS 0x08000000 // defines for languages diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index 44d889bc..1564f088 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -184,6 +184,7 @@ enum eGameSetting //TU25 eGameSetting_ClassicCrafting, + eGameSetting_CaveSounds, }; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index a3c84c48..cb400e4f 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1042,6 +1042,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con //TU25 SetGameSettings(iPad, eGameSetting_ClassicCrafting, 0); + SetGameSettings(iPad, eGameSetting_CaveSounds, 1); // 4J-PB - leave these in, or remove from everywhere they are referenced! // Although probably best to leave in unless we split the profile settings into platform specific classes - having different meaning per platform for the same bitmask could get confusing @@ -1502,6 +1503,7 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad) //TU25 ActionGameSettings(iPad, eGameSetting_ClassicCrafting); + ActionGameSettings(iPad, eGameSetting_CaveSounds); } void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) @@ -2512,6 +2514,21 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged = true; } break; + case eGameSetting_CaveSounds: + if ((GameSettingsA[iPad]->uiBitmaskValues & GAMESETTING_CAVESOUNDS) != (ucVal & 0x01) << 27) + { + if (ucVal == 1) + { + GameSettingsA[iPad]->uiBitmaskValues |= GAMESETTING_CAVESOUNDS; + } + else + { + GameSettingsA[iPad]->uiBitmaskValues &= ~GAMESETTING_CAVESOUNDS; + } + ActionGameSettings(iPad, eVal); + GameSettingsA[iPad]->bSettingsChanged = true; + } + break; } } @@ -2650,6 +2667,9 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_ClassicCrafting: return (GameSettingsA[iPad]->uiBitmaskValues & GAMESETTING_CLASSICCRAFTING) >> 26; + case eGameSetting_CaveSounds: + return (GameSettingsA[iPad]->uiBitmaskValues & GAMESETTING_CAVESOUNDS) >> 27; + case eGameSetting_VSync: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_VSYNC)>>24; diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf index cc3330ab..8e46ea2a 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf index ffe2701a..98375fda 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf differ diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp index 083fbd35..7bfee03f 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp @@ -14,6 +14,8 @@ UIScene_SettingsAudioMenu::UIScene_SettingsAudioMenu(int iPad, void *initData, U swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); m_sliderSound.init(TempString,eControl_Sound,0,100,app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); + m_checkboxCaveSounds.init(L"Cave Sounds",eControl_CaveSounds,(app.GetGameSettings(m_iPad,eGameSetting_CaveSounds)!=0)); + doHorizontalResizeCheck(); if(app.GetLocalPlayerCount()>1) @@ -114,3 +116,13 @@ void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue) break; } } + +void UIScene_SettingsAudioMenu::handleCheckboxToggled(F64 controlId, bool selected) +{ + switch(static_cast(controlId)) + { + case eControl_CaveSounds: + app.SetGameSettings(m_iPad, eGameSetting_CaveSounds, selected ? 1 : 0); + break; + } +} diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.h b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.h index 6c48b22b..b0123b5a 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.h @@ -8,13 +8,16 @@ private: enum EControls { eControl_Music, - eControl_Sound + eControl_Sound, + eControl_CaveSounds }; UIControl_Slider m_sliderMusic, m_sliderSound; // Sliders + UIControl_CheckBox m_checkboxCaveSounds; // Checkboxes UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_MAP_ELEMENT( m_sliderMusic, "Music") UI_MAP_ELEMENT( m_sliderSound, "Sound") + UI_MAP_ELEMENT( m_checkboxCaveSounds, "CaveSounds") UI_END_MAP_ELEMENTS_AND_NAMES() public: @@ -34,5 +37,4 @@ public: // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); - virtual void handleSliderMove(F64 sliderId, F64 currentValue); -}; \ No newline at end of file + virtual void handleSliderMove(F64 sliderId, F64 currentValue); virtual void handleCheckboxToggled(F64 controlId, bool selected);}; \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index 13de3467..89c9928a 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -6578,6 +6578,10 @@ Would you like to install the mash-up pack or texture pack now? Render Clouds + + Cave Sounds + + What would you like to do with this save game? @@ -7482,7 +7486,7 @@ Would you like to install the mash-up pack or texture pack now? - Options + Game Options diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index 8478535b..47b75d79 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -3321,13 +3321,17 @@ void Level::tickClientSideTiles(int xo, int zo, LevelChunk *lc) shared_ptr player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); if (player != nullptr && player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { - // 4J-PB - Fixed issue with cave audio event having 2 sounds at 192k + // check for cave sound functionality + if (app.GetGameSettings(player->entityId, eGameSetting_CaveSounds)) + { + // 4J-PB - Fixed issue with cave audio event having 2 sounds at 192k #ifdef _XBOX - this->playSound(x + 0.5, y + 0.5, z + 0.5,eSoundType_AMBIENT_CAVE_CAVE2, 0.7f, 0.8f + random->nextFloat() * 0.2f); + this->playSound(x + 0.5, y + 0.5, z + 0.5,eSoundType_AMBIENT_CAVE_CAVE2, 0.7f, 0.8f + random->nextFloat() * 0.2f); #else - this->playSound(x + 0.5, y + 0.5, z + 0.5,eSoundType_AMBIENT_CAVE_CAVE, 0.7f, 0.8f + random->nextFloat() * 0.2f); + this->playSound(x + 0.5, y + 0.5, z + 0.5,eSoundType_AMBIENT_CAVE_CAVE, 0.7f, 0.8f + random->nextFloat() * 0.2f); #endif - delayUntilNextMoodSound = random->nextInt(SharedConstants::TICKS_PER_SECOND * 60 * 10) + SharedConstants::TICKS_PER_SECOND * 60 * 5; + delayUntilNextMoodSound = random->nextInt(SharedConstants::TICKS_PER_SECOND * 60 * 10) + SharedConstants::TICKS_PER_SECOND * 60 * 5; + } } } }