Mise a jours Initial

This commit is contained in:
FullGreenDev 2020-11-30 18:41:50 +01:00
parent f59cef4780
commit fc056b4c32
4 changed files with 35 additions and 32 deletions

View File

@ -1,12 +1,12 @@
// Work in progress
const logger = require('./loggerutil')('%c[DiscordWrapper]', 'color: #7289da; font-weight: bold')
const {Client} = require('discord-rpc')
const { Client } = require('discord-rpc')
let client
let activity
exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting for Client..'){
exports.initRPC = function(genSettings, servSettings, initialDetails = 'En attente du client.') {
client = new Client({ transport: 'ipc' })
activity = {
@ -21,26 +21,26 @@ exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting
}
client.on('ready', () => {
logger.log('Discord RPC Connected')
logger.log('Discord RPC connecté')
client.setActivity(activity)
})
client.login({clientId: genSettings.clientId}).catch(error => {
if(error.message.includes('ENOENT')) {
logger.log('Unable to initialize Discord Rich Presence, no client detected.')
client.login({ clientId: genSettings.clientId }).catch(error => {
if (error.message.includes('ENOENT')) {
logger.log('Impossible d\'initialiser Discord Rich Presence, aucun client détecté.')
} else {
logger.log('Unable to initialize Discord Rich Presence: ' + error.message, error)
logger.log('Impossible d\'initialiser Discord Rich Presence: ' + error.message, error)
}
})
}
exports.updateDetails = function(details){
exports.updateDetails = function(details) {
activity.details = details
client.setActivity(activity)
}
exports.shutdownRPC = function(){
if(!client) return
exports.shutdownRPC = function() {
if (!client) return
client.clearActivity()
client.destroy()
client = null

View File

@ -170,7 +170,7 @@ class Module {
} catch (err) {
// Improper identifier
logger.error('Improper ID for module', this.identifier, err)
logger.error('ID incorrect pour le module', this.identifier, err)
}
}
@ -591,10 +591,10 @@ exports.pullLocal = function(){
exports.setDevMode = function(value){
if(value){
logger.log('Developer mode enabled.')
logger.log('If you don\'t know what that means, revert immediately.')
logger.log('Mode développeur activé.')
logger.log('Si vous ne savez pas ce que cela signifie, revenez immédiatement.')
} else {
logger.log('Developer mode disabled.')
logger.log('Mode développeur désactivé.')
}
DEV_MODE = value
}

View File

@ -327,13 +327,14 @@ function asyncSystemScan(mcVersion, launchAfter = true) {
// If the result is null, no valid Java installation was found.
// Show this information to the user.
setOverlayContent(
'No Compatible<br>Java Installation Found',
'In order to join WesterosCraft, you need a 64-bit installation of Java 8. Would you like us to install a copy? By installing, you accept <a href="http://www.oracle.com/technetwork/java/javase/terms/license/index.html">Oracle\'s license agreement</a>.',
'Install Java',
'Install Manually'
'Aucune installation compatible <br> Java trouvée',
'Pour rejoindre WesterosCraft, vous avez besoin d\'une installation 64 bits de Java 8. Souhaitez - vous que nous en installions une copie ? En installant, vous acceptez l\' < a href = "http://www.oracle.com/technetwork/java/javase/terms/license/index.html" > contrat de licence d\'Oracle < /a>.',
'Installer Java',
'Installer manuellement'
)
setOverlayHandler(() => {
setLaunchDetails('Preparing Java Download..')
setLaunchDetails('Préparation du téléchargement Java..')
sysAEx.send({ task: 'changeContext', class: 'AssetGuard', args: [ConfigManager.getCommonDirectory(), ConfigManager.getJavaExecutable()] })
sysAEx.send({ task: 'execute', function: '_enqueueOpenJDK', argsArr: [ConfigManager.getDataDirectory()] })
toggleOverlay(false)
@ -342,10 +343,11 @@ function asyncSystemScan(mcVersion, launchAfter = true) {
$('#overlayContent').fadeOut(250, () => {
//$('#overlayDismiss').toggle(false)
setOverlayContent(
'Java is Required<br>to Launch',
'A valid x64 installation of Java 8 is required to launch.<br><br>Please refer to our <a href="https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java">Java Management Guide</a> for instructions on how to manually install Java.',
'I Understand',
'Go Back'
"Java est requis pour démarrer",
'Une installation x64 valide de Java 8 est requise pour le lancement. <br> <br> Veuillez consulter notre <a href = "https://github.com/FullGreenDev/SkyGamesLauncher/wiki/Java-Management#manually-installing- a-valid-version-of-java "> Guide de gestion Java </a> pour savoir comment installer manuellement Java. ',
'Je comprends',
'Retourner'
)
setOverlayHandler(() => {
toggleLaunchArea(false)
@ -394,9 +396,10 @@ function asyncSystemScan(mcVersion, launchAfter = true) {
// Oracle JRE enqueue failed. Probably due to a change in their website format.
// User will have to follow the guide to install Java.
setOverlayContent(
'Unexpected Issue:<br>Java Download Failed',
'Unfortunately we\'ve encountered an issue while attempting to install Java. You will need to manually install a copy. Please check out our <a href="https://github.com/dscalzi/HeliosLauncher/wiki">Troubleshooting Guide</a> for more details and instructions.',
'I Understand'
"Problème inattendu: échec du téléchargement Java",
'Malheureusement, nous avons rencontré un problème lors de la tentative d\'installation de Java. Vous devrez installer manuellement une copie. Veuillez consulter notre <a href="https://github.com/FullGreenDev/SkyGamesLauncher"> Guide de dépannage </a> pour plus de détails et d\'instructions. ',
'Je comprends'
)
setOverlayHandler(() => {
toggleOverlay(false)
@ -496,12 +499,12 @@ function dlAsync(login = true) {
if (login) {
if (ConfigManager.getSelectedAccount() == null) {
loggerLanding.error('You must be logged into an account.')
loggerLanding.error('Vous devez être connecté à un compte.')
return
}
}
setLaunchDetails('Please wait..')
setLaunchDetails('S\'il vous plaît, attendez..')
toggleLaunchArea(true)
setLaunchPercentage(0, 100)

View File

@ -292,11 +292,11 @@
</div>
</div>
<div id="settingsAboutButtons">
<a href="https://github.com/dscalZi/HeliosLauncher" id="settingsAboutSourceButton" class="settingsAboutButton">Source (GitHub)</a>
<a href="https://github.com/FullGreenDev/SkyGamesLauncher" id="settingsAboutSourceButton" class="settingsAboutButton">Source (GitHub)</a>
<!-- The following must be included in third-party usage. -->
<!-- <a href="https://github.com/dscalzi/HeliosLauncher" id="settingsAboutSourceButton" class="settingsAboutButton">Original Source</a> -->
<a href="https://github.com/dscalZi/HeliosLauncher/issues" id="settingsAboutSupportButton" class="settingsAboutButton">Support</a>
<a href="#" id="settingsAboutDevToolsButton" class="settingsAboutButton">DevTools Console</a>
<a href="https://github.com/FullGreenDev/SkyGamesLauncher/issues" id="settingsAboutSupportButton" class="settingsAboutButton">Support</a>
<a href="#" id="settingsAboutDevToolsButton" class="settingsAboutButton">Console DevTools</a>
</div>
</div>
<div class="settingsChangelogContainer">