Configurable username (username.txt) and persistent game settings (settings.dat)#195
Merged
smartcmd merged 2 commits intosmartcmd:mainfrom Mar 2, 2026
Merged
Conversation
…ngs (settings.dat)
Owner
|
good job |
Owner
|
Need to resolve the conflicts |
Contributor
Collaborator
|
Resolve the branch conflicts and this one will be merged |
Collaborator
|
@simulpingus, @dtentiion please resolve the #217 and #218 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds two persistent player-facing features to the Windows 64-bit build: a configurable in-game username read from a plain-text file, and full persistence of game settings (gamma, audio levels, difficulty, HUD flags, etc.) across restarts via a binary save file. Also implements save thumbnail capture and fixes the working directory so all asset paths resolve correctly when launching from any location.
Desktop.2026.03.01.-.23.42.43.01.2.mp4
Desktop.2026.03.02.-.00.44.37.02.1.mp4
Changes
Previous Behavior
"Windows"and/or"stub"regardless of who was playing.CaptureSaveThumbnail()andGetSaveThumbnail()were empty stubs, so world saves never stored a thumbnail image.Root Cause
IQNetPlayer::GetGamertag()returned a hardcoded string with no hook for user configuration.InitGameSettings()andCheckGameSettingsChanged()had no_WINDOWS64branch to read or write settings to disk, the existing paths only covered console platforms (Xbox, PlayStation, etc.).SetCurrentDirectoryAwas made at startup, so relative paths used throughout the engine only worked correctly when launching via Visual Studio.New Behavior
username.txtfrom the same folder as the executable. The first line becomes the player's in-game name and nametag. If the file is absent the name defaults to"Windows".settings.dat(next to the exe) whenever a setting changes, and loaded back on the next launch. Deleting the file resets everything to defaults.RenderManager.CaptureThumbnail().Fix Implementation
Windows64_App.cpp: Addedwstring g_playerNameglobal and aLoadPlayerName()helper that usesGetModuleFileNameAto locateusername.txtrelative to the exe. Called from theCConsoleMinecraftAppconstructor and fromTemporaryCreateGameStart(). ImplementedCaptureSaveThumbnail(),GetSaveThumbnail(), andReleaseSaveThumbnail()using anImageFileBuffermember onCConsoleMinecraftApp.Windows64_App.h: Added#include "4JLibs\inc\4J_Render.h"and theImageFileBuffer m_ThumbnailBufferprivate member.Extrax64Stubs.cpp:IQNetPlayer::GetGamertag()now returnsg_playerName.c_str()(falling back toL"Windows"if empty) instead of a ProfileManager lookup.Consoles_App.cpp: Added_WINDOWS64-gatedWin64_GetSettingsPath(),Win64_SaveSettings(), andWin64_LoadSettings()static helpers.InitGameSettings()now callsWin64_LoadSettings+ApplyGameSettingsChangedafterSetDefaultOptions.CheckGameSettingsChanged()callsWin64_SaveSettingswhenever settings are flushed on both the loop and single-pad code paths.Windows64_Minecraft.cpp: Added aSetCurrentDirectoryAcall at the top of_tWinMainto set the CWD to the exe's directory.Related Issues