HeliosLauncher/athshield/parserAthShield.js
Sandro642 9813802b1c Add Athena's Shield configuration and CLI
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.
2024-10-23 17:33:39 +02:00

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