Create configmanager.js

Add methods for set test mode and check if test mode
This commit is contained in:
DrDeee 2021-01-07 22:11:44 +01:00 committed by GitHub
parent 779a9a54ec
commit 4b06d48e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,8 @@ const DEFAULT_CONFIG = {
selectedServer: null, // Resolved
selectedAccount: null,
authenticationDatabase: {},
modConfigurations: []
modConfigurations: [],
testDistro: false
}
let config = null
@ -158,6 +159,14 @@ exports.load = function(){
logger.log('Successfully Loaded')
}
exports.setTesting = function(v){
config.testDistro = v ? true: false
exports.save()
}
exports.isTesting = function(){
return config.testDistro
}
/**
* @returns {boolean} Whether or not the manager has been loaded.
*/
@ -685,4 +694,4 @@ exports.getAllowPrerelease = function(def = false){
*/
exports.setAllowPrerelease = function(allowPrerelease){
config.settings.launcher.allowPrerelease = allowPrerelease
}
}