mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 11:42:14 -08:00
9813802b1c
Introduce AthenaShield class to manage configuration, CLI for user setup, and update package.json with new script. This enhances the application's configurability and user interaction.
33 lines
815 B
JavaScript
33 lines
815 B
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
// Chemin vers le fichier de configuration
|
|
const configPath = path.join(__dirname, 'variables.athshield')
|
|
|
|
// Classe pour gérer Athena's Shield
|
|
class AthenaShield {
|
|
constructor() {
|
|
this.config = this.loadConfig()
|
|
}
|
|
|
|
// Charger les variables depuis le fichier
|
|
loadConfig() {
|
|
const rawData = fs.readFileSync(configPath)
|
|
return JSON.parse(rawData.toString())
|
|
}
|
|
|
|
// Récupérer le statut d'Athena's Shield
|
|
get status() {
|
|
return this.config.athenaShieldActivated
|
|
}
|
|
|
|
// Récupérer la visibilité du menu
|
|
get view() {
|
|
return this.config.menuVisibility
|
|
}
|
|
}
|
|
|
|
// Exporter une instance de la classe
|
|
const athenaShieldInstance = new AthenaShield()
|
|
module.exports = athenaShieldInstance
|