diff --git a/README.md b/README.md
index 57c9731..e0147d4 100644
--- a/README.md
+++ b/README.md
@@ -135,8 +135,8 @@ npm start
* Wine prefix folder selection ([notabug issue 37](https://notabug.org/nobody/an-anime-game-launcher/issues/37)) *(1.8.0)*
* Use auto-downloaded winetricks in settings menu *(done in main branch by @Maroxy, !14)*
* Use `winecfg.exe` from the installed runner in settings menu *(done in main branch by @Maroxy, !14)*
-* Fix voice data installation
-* Add fps unlocker option
+* Fix voice data installation *(done in main branch by @Maroxy, !15)*
+* Add fps unlocker option *(done in main branch by @Maroxy, !15)*
* Add downloading pause button
* Move project to Vue
* Use `LauncherLib.getGameVersion` function instead of the `config.json`'s `version` property
diff --git a/public/html/settings.html b/public/html/settings.html
index 89a49a7..b5303d8 100644
--- a/public/html/settings.html
+++ b/public/html/settings.html
@@ -229,6 +229,16 @@
+
+
+
+
Auto-delete DXVK logs
@@ -254,6 +264,8 @@
+
+
@@ -310,7 +324,10 @@
Delete
+
+
+
Discord RPC
diff --git a/src/ts/index.ts b/src/ts/index.ts
index 11440f7..2b85799 100644
--- a/src/ts/index.ts
+++ b/src/ts/index.ts
@@ -280,7 +280,7 @@ $(() => {
else console.warn(`GPU ${LauncherLib.getConfig('gpu')} not found. Launching on the default GPU`);
}
- let command = `${wineExeutable} launcher.bat`;
+ let command = `${wineExeutable} ${LauncherLib.getConfig('fpsunlock') ? 'fpsunlock.bat' : 'launcher.bat'}`;
/**
* Gamemode integration
@@ -484,7 +484,7 @@ $(() => {
let voicePack = diff.voice_packs[1]; // en-us
for (let i = 0; i < diff.voice_packs.length; ++i)
- if (diff.voice_packs[i].language == LauncherLib.getConfig('lang.voice'))
+ if (diff.voice_packs[i].language == LauncherLib.getConfig('lang.voice.active'))
{
voicePack = diff.voice_packs[i];
@@ -521,6 +521,7 @@ $(() => {
}
LauncherLib.updateConfig('version', data.game.latest.version);
+ LauncherLib.updateConfig('lang.voice.installed', LauncherLib.getConfig('lang.voice.active'));
// Show back the settings button
$('#settings').css('display', 'block');
diff --git a/src/ts/lib/LauncherLib.ts b/src/ts/lib/LauncherLib.ts
index f2689f6..03ad469 100644
--- a/src/ts/lib/LauncherLib.ts
+++ b/src/ts/lib/LauncherLib.ts
@@ -46,6 +46,7 @@ const config = new store ({
hud: 'none', // none / dxvk / mangohud
shaders: 'none', // none / shader's folder
gamemode: false, // GameMode
+ fpsunlock: false, // FPS Unlocker
gpu: 'default', // GPU
autodelete_dxvk_logs: false, // Auto-delete DXVK logs
theme: 'system', // light / dark / system
diff --git a/src/ts/lib/constants.ts b/src/ts/lib/constants.ts
index 65e7567..64c6674 100644
--- a/src/ts/lib/constants.ts
+++ b/src/ts/lib/constants.ts
@@ -90,6 +90,11 @@ export default class constants
return path.join(this.prefixDir.get(), 'drive_c', 'Program Files', this.placeholders.uppercase.full);
}
+ public static get fpsunlockerDir(): string
+ {
+ return path.join(this.prefixDir.get(), 'drive_c', 'Program Files', Buffer.from('R0lfRlBTVW5sb2NrZXI=', 'base64').toString());
+ }
+
public static get voiceDir(): string
{
return path.join(this.gameDir, `${this.placeholders.uppercase.first + this.placeholders.uppercase.second}_Data`, 'StreamingAssets', 'Audio', 'GeneratedSoundBanks', 'Windows');
diff --git a/src/ts/settings.ts b/src/ts/settings.ts
index ac59fda..b5dba4a 100644
--- a/src/ts/settings.ts
+++ b/src/ts/settings.ts
@@ -318,6 +318,42 @@ $(() => {
LauncherLib.updateConfig('gamemode', $('#gamemode').hasClass('checkbox-active'));
});
+
+ /**
+ * FPS Unlocker
+ */
+
+ // Hide FPS Unlock until Prefix is installed
+ if (!LauncherLib.isPrefixInstalled(constants.prefixDir.get()))
+ $('#fps-unlocker').toggle();
+ else if(LauncherLib.isPrefixInstalled(constants.prefixDir.get()) && !$('#fps-unlocker').is(':visible'))
+ $('#fps-unlocker').toggle();
+
+ if (LauncherLib.getConfig('fpsunlock'))
+ if (!fs.existsSync(constants.fpsunlockerDir))
+ LauncherLib.updateConfig('fpsunlock', false);
+ else
+ $('#fps-unlocker').addClass('checkbox-active');
+
+ $('#fps-unlocker').on('classChange', async () => {
+ if (LauncherLib.getConfig('fpsunlock') && !$('#fps-unlocker').hasClass('checkbox-active') && fs.existsSync(constants.fpsunlockerDir))
+ {
+ fs.rmdirSync(constants.fpsunlockerDir, { recursive: true });
+ fs.rmSync(path.join(constants.gameDir, 'fps_config.ini'));
+ }
+ else if(!LauncherLib.getConfig('fpsunlock') && $('#fps-unlocker').hasClass('checkbox-active') && !fs.existsSync(constants.fpsunlockerDir))
+ {
+ fs.mkdirSync(constants.fpsunlockerDir);
+ let fpsunlockexe = Buffer.from('aHR0cHM6Ly9naXRodWIuY29tLzM0NzM2Mzg0L2dlbnNoaW4tZnBzLXVubG9jay9yZWxlYXNlcy9kb3dubG9hZC92MS40LjIvdW5sb2NrZnBzLmV4ZQ==', 'base64').toString();
+ let fpsunlockbat = Buffer.from('aHR0cHM6Ly9kZXYua2FpZmEuY2gvTWFyb3h5L2FuLWFuaW1lLWdhbWUtYXVyL3Jhdy9icmFuY2gvZnBzdW5sb2NrL2Zwc3VubG9jay5iYXQ=', 'base64').toString();
+
+ await Tools.downloadFile(fpsunlockbat, path.join(constants.gameDir, 'fpsunlock.bat'), (current: number, total: number, difference: number) => null);
+ await Tools.downloadFile(fpsunlockexe, path.join(constants.fpsunlockerDir, 'unlockfps.exe'), (current: number, total: number, difference: number) => null);
+ }
+
+ LauncherLib.updateConfig('fpsunlock', $('#fps-unlocker').hasClass('checkbox-active'));
+ });
+
/**
* GPU selection
*/