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

improve visual + improve launch button responsiveness + dump to 0.3.0

This commit is contained in:
Quentin Legot 2021-04-11 20:42:07 +02:00
parent 9ab2afacdd
commit 66e6b92a0d
9 changed files with 42 additions and 20 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "altarik-launcher",
"version": "0.2.2",
"version": "0.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "altarik-launcher",
"version": "0.2.2",
"version": "0.3.0",
"description": "Altarik Launcher",
"main": "src/server/main.js",
"repository": "AltarikMC/Launcher",

View File

@ -7,7 +7,10 @@ html{
}
body{
background: black;
background-color: black;
background-image: url("../images/background.jpg");
background-size: cover;
background-repeat: no-repeat;
margin:0;
height:100%;
font-family: "Roboto";
@ -28,7 +31,9 @@ body{
background-size: 100%;
width: 322px;
height: 398px;
padding: 20px 50px;
padding: 10px 50px;
font-family: "French-Press";
font-size: 26px;
}
#media {
@ -174,19 +179,31 @@ h3 {
color: black;
}
.selected h3 {
color: red;
}
#sidebar h2,
#sidebar-content h3 {
margin: 0;
}
#sidebar h2 {
margin-bottom: 10px;
#sidebar-content {
color: rgba(56, 56, 56, 0.6);
}
#sidebar-content .selected {
color: black;
}
#sidebar-content {
overflow: auto;
}
#sidebar-content p {
margin: 0px;
}
#sidebar-content hr {
margin: 0px 0px 5px 0px;
border-width:0;
border-top: 1px solid black;
}

View File

@ -7,7 +7,10 @@ html{
}
body{
background: rgb(48, 48, 48);
background-color: rgb(48, 48, 48);
background-image: url("../images/background.jpg");
background-size: cover;
background-repeat: no-repeat;
margin:0;
height:100%;
font-family: "Roboto";

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

View File

@ -89,12 +89,12 @@ ipcRenderer.on('launch', (e, args) => {
ipcRenderer.on("modsInformations", (e, args) => {
if(args === null) {
sidebar.innerHTML = "<p>Une erreur est survenue lors de la récupération des informations, vérifiez votre connexion internet puis cliquez sur réessayez</p>"
sidebar.innerHTML = "<hr><p>Une erreur est survenue lors de la récupération des informations, vérifiez votre connexion internet puis cliquez sur réessayez</p>"
+ "<button onclick=\"demandModsInformations()\">Réessayer</button>"
} else {
let element = ""
for(const i in args) {
element += `<div data-chapter="${i}" onclick="changeSelectedChapter(this)"><h3>${args[i].title}</h3><p>${args[i].description}</p></div>`
element += `<hr><div data-chapter="${i}" onclick="changeSelectedChapter(this)"><h3>${args[i].title}</h3><p>${args[i].description}</p></div>`
}
sidebar.innerHTML = element
}
@ -110,7 +110,8 @@ function changeSelectedChapter(element) {
v.classList.remove("selected")
})
element.classList.add("selected")
launchBtn.classList.remove('hidden')
launchText.innerHTML = "JOUER"
launchBtn.disabled = false
}
disconnectBtn.addEventListener('click', e => {

View File

@ -50,12 +50,11 @@
</div>
<div id="main">
<img id="main-img" src="assets/images/maxresdefault.jpg">
<div id="account">
<div id="nick"></div><!-- <img src=""> Head du joueur -->
</div>
<button id="launch-btn" class="hidden">
<div id="launch-text">JOUER</div>
<button id="launch-btn" disabled>
<div id="launch-text">Selectionnez un chapitre</div>
<div id="loading-message" class="hidden">Téléchargement de Minecraft en cours...</div>
<div id="fullprogressbar" class="hidden"><div id="progressbar"></div></div>
</button>

View File

@ -90,7 +90,7 @@ ipcMain.on("login", (event, args) => {
}, 1000)
}).catch((err) => {
logger.warn(err)
logger.error(err)
showNotification("Erreur de connexion")
})
})
@ -140,6 +140,7 @@ ipcMain.on("launch", (event, args) => {
})
}).catch((err) => {
showNotification("Impossible de lancer le jeu")
event.sender.send("close", 1)
logger.error('Unable to launch the game')
logger.error(err)
})
@ -166,9 +167,9 @@ function getModsInformations(event) {
event.sender.send('modsInformations', extractModsFromFileSystem())
}
}).catch(err => {
logger.error("Unable to connect to server")
logger.error(err)
event.sender.send('informations', extractModsFromFileSystem())
logger.warn("Unable to connect to server")
logger.warn(err)
event.sender.send('modsInformations', extractModsFromFileSystem())
})
}
@ -179,6 +180,7 @@ function extractModsFromFileSystem() {
return extractModsInformations(JSON.parse(o.data))
} else {
showNotification("Impossible de récupérer certaines informations en ligne", "Veuillez réessayez en cliquant sur le bouton")
logger.error("Unable to get chapters informations from server or filesystem")
return null
}
}