Merge GPU preference feature branch to main branch version 2.0.2 for testing (#3)

* modernized UI for GPU Preference option

* feat: auto-detect dedicated GPU on hybrid laptops (iGPU+dGPU)

* feat: detailed GPU info in auto-detection feature on startup

* feat: add GPU options for launcher

- Add GPU preference setting (Auto/Integrated/Dedicated)
- Implement Linux GPU selection with DRI_PRIME and NVIDIA env vars
- Add GPU detection using Electron's app.getGPUInfo()
- Update settings UI with GPU preference dropdown
- Integrate GPU preference into game launch process

* feat: auto-detect dedicated GPU on hybrid laptops (iGPU+dGPU)

* added fallbacks to and option to use integrated GPU.

* add package-lock and fix deps version

* changed 'Nvidia' string to 'NVIDIA'

* fix: selecting `dedicated` option while using nvidia GPU did not set its specific env variables

* remove unused `CONFIG_FILE` variable on launcher core modules

* fix: duplicated save-load gpu detection functions

* move game option settings to the top, while custom java to the bottom

* fix: settings-header margin-bottom from 3rem to 1rem and supress line-clamp warning
This commit is contained in:
Fazri Gading
2026-01-20 23:45:38 +08:00
committed by GitHub
parent 5e3506a9ac
commit 905a9d754c
11 changed files with 413 additions and 23 deletions

View File

@@ -277,6 +277,15 @@ function loadChatColor() {
return config.chatColor || '#3498db';
}
function saveGpuPreference(gpuPreference) {
saveConfig({ gpuPreference: gpuPreference || 'auto' });
}
function loadGpuPreference() {
const config = loadConfig();
return config.gpuPreference || 'auto';
}
module.exports = {
loadConfig,
saveConfig,
@@ -308,5 +317,8 @@ module.exports = {
setUuidForUser,
generateNewUuid,
deleteUuidForUser,
resetCurrentUserUuid
resetCurrentUserUuid,
// GPU Preference exports
saveGpuPreference,
loadGpuPreference
};