From f615927e0eab432388f0b272827cfe5312de41e2 Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Wed, 19 Aug 2026 23:10:58 -0400 Subject: [PATCH] feat: settings saving --- Minecraft.Client/Common/Audio/SoundEngine.cpp | 10 ++++++++-- Minecraft.Client/Common/Consoles_App.cpp | 10 +++++++--- Minecraft.Client/Extrax64Stubs.cpp | 2 +- Minecraft.Client/Gui.cpp | 8 ++++---- Minecraft.Client/Windows64/4JLibs | 2 +- .../Windows64/Windows64Extras/Windows64Stubs.cpp | 2 +- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 102fd37e..09d98f95 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -1166,13 +1166,17 @@ void SoundEngine::playMusicTick() void SoundEngine::playMusicUpdate() { //return; - static bool firstCall = true; static float fMusicVol = 0.0f; +#ifndef _WINDOWS64 //str1k3r - if used on windows64 volume doesnt update + static bool firstCall = true; if( firstCall ) { fMusicVol = getMasterMusicVolume(); firstCall = false; } +#else + fMusicVol = getMasterMusicVolume(); +#endif switch(m_StreamState) { @@ -1520,7 +1524,9 @@ void SoundEngine::playMusicUpdate() } // volume change required? - if(fMusicVol!=getMasterMusicVolume()) +#ifndef _WINDOWS64 + if(fMusicVol!=getMasterMusicVolume()) //str1k3r - if used on windows64 music doesnt update its volume +#endif { fMusicVol=getMasterMusicVolume(); HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 7e972b0b..18b57a58 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -764,11 +764,11 @@ void CMinecraftApp::InitGameSettings() //SetDefaultGameSettings(i); - done on a callback from the profile manager // 4J-PB - adding in for Windows & PS3 to set the defaults for the joypad -#if defined _WINDOWS64// || defined __PSVITA__ +#if defined _WINDOWS64 C_4JProfile::PROFILESETTINGS *pProfileSettings=ProfileManager.GetDashboardProfileSettings(i); - // clear this for now - it will come from reading the system values - memset(pProfileSettings,0,sizeof(C_4JProfile::PROFILESETTINGS)); SetDefaultOptions(pProfileSettings,i); + ProfileManager.LoadSettings(GameSettingsA[i], sizeof(GAME_SETTINGS)); + ApplyGameSettingsChanged(i); #elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i); // 4J-PB - don't cause an options write to happen here @@ -2355,6 +2355,8 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa { #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ ) StorageManager.WriteToProfile(i,true, bOverride5MinuteTimer); +#elif _WINDOWS64 + ProfileManager.SaveSettings(GameSettingsA[i], sizeof(GAME_SETTINGS)); #else ProfileManager.WriteToProfile(i,true, bOverride5MinuteTimer); #endif @@ -2368,6 +2370,8 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa { #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); +#elif _WINDOWS64 + ProfileManager.SaveSettings(GameSettingsA[iPad], sizeof(GAME_SETTINGS)); #else ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); #endif diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index ca73b566..ad19e2c5 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -35,7 +35,7 @@ #endif #ifdef _WINDOWS64 -C_4JProfile ProfileManager; +//C_4JProfile ProfileManager; //str1k3r - appears to not be needed and this causes a build error #endif CSentientManager SentientManager; CXuiStringTable StringTable; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index cc29f418..ac8301f4 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -651,7 +651,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // 4J - do render of crouched player. This code is largely taken from the inventory render of the player, with some special hard-coded positions // worked out by hand from the xui implementation of the crouch icon - if(app.GetGameSettings(iPad,eGameSetting_AnimatedCharacter)) + if(app.GetGameSettings(iPad,eGameSetting_AnimatedCharacter) && !minecraft->options->renderDebug) //str1k3r - disable paperdoll if "F3" is on screen { //int playerIdx = minecraft->player->GetXboxPad(); @@ -852,11 +852,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) font->drawShadow(L"Seed: " + _toString<__int64>(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf+2, 32 + 10, 0xffffff); font->drawShadow(minecraft->gatherStats2(), iSafezoneXHalf+2, 32 + 20, 0xffffff); - font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff); - font->drawShadow(minecraft->gatherStats4(), iSafezoneXHalf+2, 32 + 40, 0xffffff); + //font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff); //str1k3r - returns nothing + font->drawShadow(minecraft->gatherStats4(), iSafezoneXHalf+2, 32 + 30, 0xffffff); // TERRAIN FEATURES - int iYPos=82; + int iYPos=72; if(minecraft->level->dimension->id==0) { diff --git a/Minecraft.Client/Windows64/4JLibs b/Minecraft.Client/Windows64/4JLibs index 0c24c663..3df111d9 160000 --- a/Minecraft.Client/Windows64/4JLibs +++ b/Minecraft.Client/Windows64/4JLibs @@ -1 +1 @@ -Subproject commit 0c24c663ef1d3998e371ab4f36b31d483be635ff +Subproject commit 3df111d9a38f1332eee6407e31f60248fcc89d89 diff --git a/Minecraft.Client/Windows64/Windows64Extras/Windows64Stubs.cpp b/Minecraft.Client/Windows64/Windows64Extras/Windows64Stubs.cpp index c5ee98c1..f06ca779 100644 --- a/Minecraft.Client/Windows64/Windows64Extras/Windows64Stubs.cpp +++ b/Minecraft.Client/Windows64/Windows64Extras/Windows64Stubs.cpp @@ -7,7 +7,7 @@ DWORD XGetLanguage() GetUserDefaultLocaleName(wchLocaleName,LOCALE_NAME_MAX_LENGTH); eMCLang eLang=(eMCLang)app.get_eMCLang(wchLocaleName); -#ifdef _DEBUG +#ifdef _XGETLANGDEBUG //str1k3r - make this its own def so we dont spam output on debug app.DebugPrintf("XGetLanguage() ==> '%ls'\n", wchLocaleName); #endif