4
0
mirror of https://github.com/AltarikMC/Launcher synced 2024-11-22 06:19:50 +01:00

Added possibility to disconnect

This commit is contained in:
Quentin Legot 2020-12-08 23:19:42 +01:00 committed by Quentin Legot
parent c05f09d5e9
commit 5089a784d1
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 fullProgressBar = document.querySelector('#fullprogressbar')
let progressBar = document.querySelector('#progressbar') let progressBar = document.querySelector('#progressbar')
let loadingMessage = document.querySelector('#loading-message') let loadingMessage = document.querySelector('#loading-message')
let disconnectBtn = document.querySelector('#disconnect-btn')
ipcRenderer.on("nick", (event, args) => { ipcRenderer.on("nick", (event, args) => {
console.log(args) console.log(args)
@ -35,3 +36,7 @@ ipcRenderer.on("close", (e, args) => {
progressBar.style.width = "0" progressBar.style.width = "0"
launchBtn.disabled = false launchBtn.disabled = false
}) })
disconnectBtn.addEventListener('click', e => {
ipcRenderer.send('disconnect')
})

View File

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

View File

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