4
0
mirror of https://github.com/AltarikMC/Launcher synced 2024-11-25 06:49:51 +01:00

Added possibility to disconnect

This commit is contained in:
Quentin Legot 2020-12-08 23:19:42 +01:00
parent f5d524948c
commit 2489ada664
3 changed files with 11 additions and 1 deletions

View File

@ -5,6 +5,7 @@ let launchBtn = document.querySelector('#launch-btn');
let fullProgressBar = document.querySelector('#fullprogressbar')
let progressBar = document.querySelector('#progressbar')
let loadingMessage = document.querySelector('#loading-message')
let disconnectBtn = document.querySelector('#disconnect-btn')
ipcRenderer.on("nick", (event, args) => {
console.log(args)
@ -34,4 +35,8 @@ ipcRenderer.on("close", (e, args) => {
loadingMessage.innerHTML = "Téléchargement de Minecraft en cours..."
progressBar.style.width = "0"
launchBtn.disabled = false
})
disconnectBtn.addEventListener('click', e => {
ipcRenderer.send('disconnect')
})

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Launcher Projet Secret</title>
@ -22,6 +22,7 @@
<h3>Compte</h3>
<hr>
<span id="nick-span"></span>
<button id="disconnect-btn">Se déconnecter</button>
<h3>Modifier la configuration</h3>
<hr>
Contenu

View File

@ -94,4 +94,8 @@ ipcMain.on("launch", (event, args) => {
launcher.on('progress', (e) => event.sender.send("progress", e));
launcher.on('close', (e) => event.sender.send("close", e));
})
ipcMain.on("disconnect", (e) => {
win.loadFile('login.html')
})