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

Merge pull request #436 from AltarikMC/dev

2.2.0
This commit is contained in:
Quentin Legot 2024-08-31 23:28:16 +02:00 committed by GitHub
commit 9f495967e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4770 additions and 6281 deletions

View File

@ -1,7 +1,7 @@
{
"name": "altarik-launcher",
"author": "Altarik",
"version": "2.1.8",
"version": "2.2.0",
"description": "Altarik Launcher",
"main": "src/server/main.js",
"type": "module",
@ -35,17 +35,17 @@
"@electron-forge/maker-zip": "^7.4.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
"@electron-forge/publisher-github": "^7.4.0",
"electron": "31.1.0",
"eslint": "^9.6.0",
"electron": "32.0.1",
"eslint": "^9.9.1",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-promise": "^6.2.0"
"eslint-plugin-promise": "^6.6.0"
},
"dependencies": {
"decompress": "^4.2.1",
"electron-is-dev": "^3.0.1",
"electron-log": "^5.1.5",
"electron-log": "^5.1.7",
"electron-squirrel-startup": "^1.0.1",
"extract-zip": "^2.0.1",
"hasha": "^6.0.0",

View File

@ -37,7 +37,7 @@ app = vue.createApp({
position: 'topRight',
resetOnHover: true
})
setInterval(() => {
setTimeout(() => {
ipcRenderer.send('pageReady')
}, 500)
},
@ -98,11 +98,20 @@ app = vue.createApp({
this.displayCredits = 'block'
},
updateModsInformations (content) {
this.modsInformations = content
if(content === null) {
this.modsInformations = []
} else {
this.modsInformations = content
}
},
getModsInformations () {
return this.modsInformations
},
reloadChapters() {
this.updateModsInformations(null)
this.modsInformationsLoaded = true
ipcRenderer.send('pageReady')
},
showInfo (title, body) {
iziToast.info({
title,

View File

@ -71,7 +71,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</div>
<div id="content">
<div id="sidebar">
<h2>Chapitres</h2>
<h2>Chapitres <i v-if="modsInformations.length !== 0 || modsInformationsLoaded === false" v-on:click="reloadChapters()" class="reload-chapter material-icons">sync</i></h2>
<div id="sidebar-content" @change="modsInformations">
<div v-if="modsInformationsLoaded === false">Une erreur est survenue lors de la récupération des informations, vérifiez votre connexion internet puis cliquez sur réessayez</div>
<div v-for="(item, index) in modsInformations" v-else-if="modsInformations.length !== 0" v-on:click="changeSelectedChapter(index)" :class="{ selected: isSelected(index) }">

View File

@ -20,7 +20,7 @@ export default class Minecraft {
auth = null
modsList = undefined
showNotification = undefined
modsInformationsEndpoint = 'https://launcher.altarik.fr'
modsInformationsEndpoint = 'https://launcher.altarik.fr/launcher.json'
setShowNotification (showNotification) {
this.showNotification = showNotification
@ -145,39 +145,23 @@ export default class Minecraft {
fs.writeFileSync(file, JSON.stringify(data))
event.sender.send('modsInformations', this.extractModsInformations(data))
}).catch(err => {
event.sender.send('modsInformations', this.extractModsFromFileSystem())
event.sender.send('modsInformations', null)
logger.warn(err)
logger.warn('An error occured while trying to connect to server')
})
} else {
logger.warn('Unable to connect to server')
logger.warn(response.status)
event.sender.send('modsInformations', this.extractModsFromFileSystem())
logger.warn(this.modsInformationsEndpoint)
event.sender.send('modsInformations', null)
}
}).catch(err => {
logger.warn('Unable to connect to server')
logger.warn(err)
event.sender.send('modsInformations', this.extractModsFromFileSystem())
event.sender.send('modsInformations', null)
})
}
extractModsFromFileSystem () {
const filepath = join(this.localappdata, 'altarik-launcher/data/launcher.json')
if (fs.existsSync(filepath)) {
const content = fs.readFileSync(filepath)
if (content !== null) {
this.showNotification('Impossible de récupérer certaines informations en ligne', 'utilisation des dernières données récupérées', 'warning')
return this.extractModsInformations(JSON.parse(content))
} else {
this.showNotification('Impossible de récupérer certaines informations en ligne', 'Veuillez réessayez en cliquant sur le bouton', 'warning')
logger.error('Unable to get chapters informations from server or filesystem')
return null
}
} else {
return null
}
}
extractModsInformations (json) {
this.modsList = json.chapters
return this.modsList

11000
yarn.lock

File diff suppressed because it is too large Load Diff