From d8a112e14c3f66a8207137c5a6c3062dbf3b2a7a Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sat, 11 Dec 2021 12:56:38 +0100 Subject: [PATCH] Add functions to the RPC Settings --- src/ts/settings.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/ts/settings.ts b/src/ts/settings.ts index 105b955..52c92fc 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -229,6 +229,31 @@ $(() => { ipcRenderer.send('rpc-toggle'); }); + $('#rpc-launch-details').on('change', () => { + if ($('#rpc-launch-details').val() == "") + LauncherLib.updateConfig('rpcsettings.launcher', 'Preparing to launch'); + + LauncherLib.updateConfig('rpcsettings.launcher', $('#rpc-launch-details').val() as string); + }); + + $('#rpc-game-details').on('change', () => { + if ($('#rpc-game-details').val() == "") + LauncherLib.updateConfig('rpcsettings.ingame.details', 'In-Game'); + + LauncherLib.updateConfig('rpcsettings.ingame.details', $('#rpc-game-details').val() as string); + }); + + $('#rpc-game-state').on('change', () => { + if ($('#rpc-game-state').val() == "") + LauncherLib.updateConfig('rpcsettings.ingame.state', null); + + LauncherLib.updateConfig('rpcsettings.ingame.state', $('#rpc-game-state').val() as string); + }); + + $('#rpc-game-elapsed').on('classChange', () => { + LauncherLib.updateConfig('rpcsettings.ingame.elapsed', $('#rpc-game-elapsed').hasClass('checkbox-active')); + }); + /** * Auto-delete DXVK logs */