@@ -247,6 +247,24 @@ document.addEventListener('DOMContentLoaded', () => {
247247 }
248248 }
249249
250+ const chillerbotUxData = games [ 'chillerbot-ux' ] ;
251+ const chillerbotUxPath = path . join ( installPath , tclientData . clientName ) ;
252+ if ( fs . existsSync ( chillerbotUxPath ) ) {
253+ const currentChillerbotUxVersion = await getClientVersion ( chillerbotUxPath ) ;
254+ const release = await getLatestGitHubRelease ( chillerbotUxData . githubRepo ) ;
255+ const latestChillerbotUxVersion = release . tag_name ;
256+
257+ if ( currentChillerbotUxVersion && currentChillerbotUxVersion !== latestChillerbotUxVersion && ! notifiedUpdates . has ( 'chillerbot-ux' ) ) {
258+ console . log ( `chillerbot-ux update available: ${ currentChillerbotUxVersion } -> ${ latestChillerbotUxVersion } ` ) ;
259+ ipcRenderer . send ( 'show-update-notification' , {
260+ clientName : chillerbotUxData . clientName ,
261+ currentVersion : currentChillerbotUxVersion ,
262+ latestVersion : latestChillerbotUxVersion
263+ } ) ;
264+ notifiedUpdates . add ( 'chillerbot-ux' ) ;
265+ }
266+ }
267+
250268 const cactusData = games [ 'cactus' ] ;
251269 const cactusPath = path . join ( installPath , cactusData . clientName ) ;
252270 if ( fs . existsSync ( cactusPath ) ) {
@@ -550,11 +568,11 @@ document.addEventListener('DOMContentLoaded', () => {
550568 return fs . existsSync ( versionFile ) ? fs . readFileSync ( versionFile , 'utf8' ) . trim ( ) : null ;
551569 }
552570
553- async function downloadAndInstallTClient ( button ) {
554- const gameData = games [ 'tclient' ] ;
571+ async function downloadAndInstallFromGithub ( button , clientName , folderName ) {
572+ const gameData = games [ clientName ] ;
555573 const installPath = await ipcRenderer . invoke ( 'get-install-path' ) ;
556574 const clientPath = path . join ( installPath , gameData . clientName ) ;
557- const tempZipPath = path . join ( os . tmpdir ( ) , process . platform === 'linux' ? 'TClient -ubuntu.tar.xz' : 'TClient -windows.zip' ) ;
575+ const tempZipPath = path . join ( os . tmpdir ( ) , process . platform === 'linux' ? ` ${ folderName } -ubuntu.tar.xz` : ` ${ folderName } -windows.zip` ) ;
558576
559577 button . innerHTML = '<i class="fas fa-spinner fa-spin"></i> INSTALLING...' ;
560578 button . disabled = true ;
@@ -569,8 +587,8 @@ document.addEventListener('DOMContentLoaded', () => {
569587 const release = await getLatestGitHubRelease ( gameData . githubRepo ) ;
570588 const version = release . tag_name ;
571589 const downloadUrl = process . platform === 'linux'
572- ? `https://github.com/${ gameData . githubRepo } /releases/download/${ version } /TClient -ubuntu.tar.xz`
573- : `https://github.com/${ gameData . githubRepo } /releases/download/${ version } /TClient -windows.zip` ;
590+ ? `https://github.com/${ gameData . githubRepo } /releases/download/${ version } /${ folderName } -ubuntu.tar.xz`
591+ : `https://github.com/${ gameData . githubRepo } /releases/download/${ version } /${ folderName } -windows.zip` ;
574592
575593 statusText . textContent = 'Downloading...' ;
576594 progressBar . style . width = '0%' ;
@@ -610,7 +628,7 @@ document.addEventListener('DOMContentLoaded', () => {
610628 const extractedFiles = fs . readdirSync ( installPath ) . filter ( file =>
611629 fs . statSync ( path . join ( installPath , file ) ) . isDirectory ( )
612630 ) ;
613- extractedFolder = extractedFiles . find ( file => file !== gameData . clientName ) || 'TClient' ;
631+ extractedFolder = extractedFiles . find ( file => file !== gameData . clientName ) || folderName ;
614632 console . log ( 'Extracted folders:' , extractedFiles ) ;
615633 } else {
616634 extractedFolder = new AdmZip ( tempZipPath ) . getEntries ( ) [ 0 ] . entryName . split ( '/' ) [ 0 ] ;
@@ -628,8 +646,8 @@ document.addEventListener('DOMContentLoaded', () => {
628646 fs . writeFileSync ( path . join ( clientPath , 'clientver.txt' ) , version ) ;
629647 progressBar . style . width = '100%' ;
630648
631- notifiedUpdates . delete ( 'tclient' ) ;
632- setTimeout ( ( ) => updateGameContent ( 'tclient' ) , 500 ) ;
649+ notifiedUpdates . delete ( clientName ) ;
650+ setTimeout ( ( ) => updateGameContent ( clientName ) , 500 ) ;
633651 } catch ( err ) {
634652 console . error ( 'Install error:' , err ) ;
635653 statusText . textContent = 'Installation Failed' ;
@@ -640,6 +658,14 @@ document.addEventListener('DOMContentLoaded', () => {
640658 }
641659 }
642660
661+ async function downloadAndInstallTClient ( button ) {
662+ downloadAndInstallFromGithub ( button , 'tclient' , 'TClient' )
663+ }
664+
665+ async function downloadAndInstallChillerbotUx ( button ) {
666+ downloadAndInstallFromGithub ( button , 'chillerbot-ux' , 'chillerbot-ux' )
667+ }
668+
643669 async function downloadAndInstallCactus ( button ) {
644670 const gameData = games [ 'cactus' ] ;
645671 const installPath = await ipcRenderer . invoke ( 'get-install-path' ) ;
@@ -1227,8 +1253,10 @@ document.addEventListener('DOMContentLoaded', () => {
12271253 await downloadAndInstallDDNet ( actionButton ) ;
12281254 } else if ( gameId === 'tw' ) {
12291255 await downloadAndInstallTeeworlds ( actionButton ) ;
1230- } else if ( gameData . githubRepo ) {
1256+ } else if ( gameId === 'tclient' ) {
12311257 await downloadAndInstallTClient ( actionButton ) ;
1258+ } else if ( gameId === 'chillerbot-ux' ) {
1259+ await downloadAndInstallChillerbotUx ( actionButton ) ;
12321260 }
12331261 } else if ( buttonClass === 'launch-btn' && hasFolder ) {
12341262 console . log ( `Sending launch request for ${ gameId } ` ) ;
@@ -1309,13 +1337,14 @@ document.addEventListener('DOMContentLoaded', () => {
13091337 clientName : 'Cactus' ,
13101338 executable : process . platform === 'linux' ? 'DDNet' : 'DDNet.exe'
13111339 } ,
1312- 'cbux ' : {
1313- logo : 'assets/fulllogos/cbux .png' ,
1314- image : 'assets/bgs/cbux .png' ,
1315- smallName : 'cbux ' ,
1340+ 'chillerbot-ux ' : {
1341+ logo : 'assets/fulllogos/chillerbot-ux .png' ,
1342+ image : 'assets/bgs/chillerbot-ux .png' ,
1343+ smallName : 'ux ' ,
13161344 icon : 'https://avatars.githubusercontent.com/u/45486474' ,
1317- clientName : 'ChillerBoxUX' ,
1318- executable : process . platform === 'linux' ? 'DDNet' : 'DDNet.exe'
1345+ clientName : 'chillerbot-ux' ,
1346+ githubRepo : 'chillerbot/chillerbot-ux' ,
1347+ executable : process . platform === 'linux' ? 'chillerbot-ux' : 'chillerbot-ux.exe'
13191348 }
13201349 } ;
13211350
0 commit comments