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

Remove notification when update downloaded + improve bug_report + make some correction to js and html in general

This commit is contained in:
Quentin Legot 2021-09-25 18:52:31 +02:00
parent a9e0a7cc37
commit c0d3abd297
10 changed files with 30 additions and 35 deletions

View File

@ -1,5 +1,5 @@
--- ---
name: Bug report name: Bugs report
about: Create a report to help us improve about: Create a report to help us improve
title: "[BUG]" title: "[BUG]"
labels: bug labels: bug
@ -20,16 +20,17 @@ Steps to reproduce the behavior:
**Expected behavior** **Expected behavior**
A clear and concise description of what you expected to happen. A clear and concise description of what you expected to happen.
**Screenshots** **Screenshots and logs**
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
Please give logs files too or a part of them, there are located in %AppData%\altarik-launcher\logs\
**Desktop (please complete the following information):** **Desktop (please complete the following information):**
- OS: [e.g. Windows 10 20H2 / 8.1/ 7 SP1] - OS: [e.g. Windows 10 20H2 build 19043.1237 / 8.1 / 7 SP1]
- Device components: - Device components:
- Intel i3 8400 - Intel i3 8400
- GTX 1060 3gb - GTX 1060 3gb
- etc. - 8 gb DDR4
- Launcher Version: [e.g. 1.2] - Launcher Version: [e.g. 0.6.1 can be found in logs]
**Additional context** **Additional context**
Add any other context about the problem here. Add any other context about the problem here.

View File

@ -13,7 +13,7 @@ body{
background-repeat: no-repeat; background-repeat: no-repeat;
margin:0; margin:0;
height:100%; height:100%;
font-family: "Roboto"; font-family: "Roboto", sans-serif;
color: black; color: black;
} }
@ -32,7 +32,7 @@ body{
width: 322px; width: 322px;
height: 398px; height: 398px;
padding: 10px 50px; padding: 10px 50px;
font-family: "French-Press"; font-family: "French-Press", sans-serif;
font-size: 26px; font-size: 26px;
} }
@ -73,7 +73,7 @@ h3 {
} }
#launch-text { #launch-text {
font-family: "French-Press"; font-family: "French-Press", sans-serif;
font-size: 52px; font-size: 52px;
font-weight: bold; font-weight: bold;
} }
@ -90,7 +90,7 @@ h3 {
height:122px; height:122px;
padding:10px; padding:10px;
text-align: center; text-align: center;
border-width: 0px; border-width: 0;
} }
.hidden{ .hidden{
@ -116,7 +116,7 @@ h3 {
position:relative; position:relative;
margin: 0 auto; margin: 0 auto;
height:28px; height:28px;
font-family: "French-Press"; font-family: "French-Press", sans-serif;
font-size: 24px; font-size: 24px;
color:white; color:white;
} }
@ -130,11 +130,11 @@ h3 {
position: absolute; position: absolute;
right: 25px; right: 25px;
top: 50px; top: 50px;
padding: 0px 30px; padding: 0 30px;
} }
#nick { #nick {
font-family: "French-Press"; font-family: "French-Press", sans-serif;
font-size: 28px; font-size: 28px;
position: relative; position: relative;
top:45%; top:45%;
@ -203,11 +203,11 @@ h3 {
} }
#sidebar-content p { #sidebar-content p {
margin: 0px; margin: 0;
} }
#sidebar-content hr { #sidebar-content hr {
margin: 0px 0px 5px 0px; margin: 0 0 5px 0;
border-width:0; border-width:0;
border-top: 1px solid black; border-top: 1px solid black;
} }

View File

@ -13,7 +13,7 @@ body{
background-repeat: no-repeat; background-repeat: no-repeat;
margin:0; margin:0;
height:100%; height:100%;
font-family: "Roboto"; font-family: "Roboto", sans-serif;
} }
#content{ #content{

View File

@ -68,15 +68,13 @@ let app = new vue({
} }
} }
}) })
const sidebar = document.querySelector("#sidebar-content")
let gameLaunching = false let gameLaunching = false
let selectedChapter = -1; let selectedChapter = -1;
ipcRenderer.on("nick", (_, args) => app.nick = args.name) ipcRenderer.on("nick", (_, args) => app.nick = args.name)
ipcRenderer.on("invalidated", e => { ipcRenderer.on("invalidated", () => {
app.invalidateButtonDisabled = false app.invalidateButtonDisabled = false
app.invalidateButtonText = "Supprimer et retélécharger les bibliothèques" app.invalidateButtonText = "Supprimer et retélécharger les bibliothèques"
}) })
@ -117,7 +115,7 @@ ipcRenderer.on("modsInformations", (e, args) => {
function changeSelectedChapter(element) { function changeSelectedChapter(element) {
selectedChapter = Number(element.dataset.chapter) selectedChapter = Number(element.dataset.chapter)
document.querySelectorAll("#sidebar-content > div").forEach((v, key) => { document.querySelectorAll("#sidebar-content > div").forEach((v) => {
v.classList.remove("selected") v.classList.remove("selected")
}) })
element.classList.add("selected") element.classList.add("selected")

View File

@ -7,7 +7,7 @@
<link href="assets/css/fonts.css" rel="stylesheet" /> <link href="assets/css/fonts.css" rel="stylesheet" />
<link href="assets/css/index.css" rel="stylesheet" /> <link href="assets/css/index.css" rel="stylesheet" />
<link href="assets/css/menubar.css" rel="stylesheet" /> <link href="assets/css/menubar.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/png" href="assets/images/icon.png"/> <!--<link rel="shortcut icon" type="image/png" href="assets/images/icon.png"/> -->
</head> </head>
<body> <body>
<div id="vue"> <div id="vue">

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>Altarik Launcher</title> <title>Altarik Launcher</title>
@ -7,7 +7,7 @@
<link href="assets/css/fonts.css" rel="stylesheet" /> <link href="assets/css/fonts.css" rel="stylesheet" />
<link href="assets/css/login.css" rel="stylesheet" /> <link href="assets/css/login.css" rel="stylesheet" />
<link href="assets/css/menubar.css" rel="stylesheet" /> <link href="assets/css/menubar.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/png" href="assets/images/icon.png"/> <!-- <link rel="shortcut icon" type="image/png" href="assets/images/icon.png"/> -->
</head> </head>
<body> <body>
<div id="vue"> <div id="vue">

View File

@ -12,7 +12,7 @@ function handleSquirrelEvent(app) {
const exeName = path.basename(process.execPath); const exeName = path.basename(process.execPath);
const spawn = function(command, args) { const spawn = function(command, args) {
let spawnedProcess, error; let spawnedProcess;
try { try {
spawnedProcess = ChildProcess.spawn(command, args, {detached: true}); spawnedProcess = ChildProcess.spawn(command, args, {detached: true});

View File

@ -69,7 +69,7 @@ ipcMain.on("login", (event, args) => {
minecraft.login(event, win, args.user, args.pass) minecraft.login(event, win, args.user, args.pass)
}) })
ipcMain.on("microsoft-login", (event, args) => { ipcMain.on("microsoft-login", (event) => {
minecraft.microsoftLogin(event, win) minecraft.microsoftLogin(event, win)
}) })
@ -89,7 +89,7 @@ ipcMain.on("notification", (event, args) => {
showNotification(args.title, args.body) showNotification(args.title, args.body)
}) })
ipcMain.on("disconnect", (e) => { ipcMain.on("disconnect", () => {
win.loadFile('src/client/login.html') win.loadFile('src/client/login.html')
}) })

View File

@ -11,7 +11,7 @@ const msmc = require('msmc')
class Minecraft { class Minecraft {
appdata = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Preferences' : process.env.HOME + "/.local/share") appdata = process.env.APPDATA || (process.platform === 'darwin' ? process.env.HOME + '/Library/Preferences' : process.env.HOME + "/.local/share")
minecraftpath = join(this.appdata, ".altarik") minecraftpath = join(this.appdata, ".altarik")
launcher = new Client() launcher = new Client()
auth = null auth = null
@ -33,7 +33,7 @@ class Minecraft {
win.loadFile('src/client/index.html').then(() => { win.loadFile('src/client/index.html').then(() => {
event.sender.send("nick", { name: v.name }) event.sender.send("nick", { name: v.name })
}) })
}).catch((err) => { }).catch(() => {
event.sender.send("loginError") event.sender.send("loginError")
logger.error("[MJ login] User haven't purchase the game") logger.error("[MJ login] User haven't purchase the game")
this.showNotification("Erreur de connexion") this.showNotification("Erreur de connexion")
@ -192,13 +192,11 @@ class Minecraft {
if(sha1 === chapter.modspack.sha1sum[j]) { if(sha1 === chapter.modspack.sha1sum[j]) {
await this.unzipMods(path).catch(err => { await this.unzipMods(path).catch(err => {
reject(err) reject(err)
return
}) })
} else { } else {
logger.warn(`sha1sum ${sha1} don't correspond to ${chapter.modspack.sha1sum[j]} of mods ${path}`) logger.warn(`sha1sum ${sha1} don't correspond to ${chapter.modspack.sha1sum[j]} of mods ${path}`)
await this.downloadAndExtractMods(chapter.modspack.mods[j], path).catch(err => { await this.downloadAndExtractMods(chapter.modspack.mods[j], path).catch(err => {
reject(err) reject(err)
return
}) })
} }
event.sender.send("progress", {type: "mods", task: Number(j)+1, total: chapter.modspack.mods.length }) event.sender.send("progress", {type: "mods", task: Number(j)+1, total: chapter.modspack.mods.length })
@ -217,7 +215,6 @@ class Minecraft {
} }
} }
reject("didn't found the correct chapter" + chapter) reject("didn't found the correct chapter" + chapter)
return
}) })
} }

View File

@ -1,6 +1,5 @@
const isDev = require('electron-is-dev') const isDev = require('electron-is-dev')
const { Notification } = require('electron') const { Notification } = require('electron')
const os = require('os')
const pkg = require('../../package.json') const pkg = require('../../package.json')
const server = 'https://update.electronjs.org' const server = 'https://update.electronjs.org'
@ -28,8 +27,7 @@ function configUpdater(app, autoUpdater, dialog, logger) {
app.isReady ? initUpdater(autoUpdater) : app.on("ready", () => initUpdater(autoUpdater)) app.isReady ? initUpdater(autoUpdater) : app.on("ready", () => initUpdater(autoUpdater))
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName, releaseDate, updateURL) => { autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
showNotification(releaseNotes, updateURL)
const dialogOpts = { const dialogOpts = {
type: 'info', type: 'info',
buttons: ['Rédémarrer', 'Plus tard'], buttons: ['Rédémarrer', 'Plus tard'],
@ -40,19 +38,20 @@ function configUpdater(app, autoUpdater, dialog, logger) {
dialog.showMessageBox(dialogOpts).then((returnValue) => { dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) { if (returnValue.response === 0) {
logger.info("Quit applicaiton to install update") logger.info("Leaving application to install update...")
autoUpdater.quitAndInstall() autoUpdater.quitAndInstall()
} }
}) })
}) })
autoUpdater.on('error', message => { autoUpdater.on('error', message => {
showNotification("Impossible de mettre à jour le launcher", "vérifier votre connexion")
logger.error('There was a problem updating the application') logger.error('There was a problem updating the application')
logger.error(message) logger.error(message)
}) })
autoUpdater.on('update-available', () => { autoUpdater.on('update-available', () => {
showNotification("Altarik launcher", "downloading update") showNotification("Altarik launcher", "Téléchargement de la mise à jour")
logger.info("update available, downloading...") logger.info("update available, downloading...")
}) })
} }