Attempting to make references to the distribution index more streamlined. WIP

This commit is contained in:
Daniel Scalzi
2018-05-08 20:10:46 -04:00
parent f161e196be
commit 15a83a7736
7 changed files with 207 additions and 159 deletions

View File

@@ -4,13 +4,14 @@
*/
// Requirements
const path = require('path')
const {AssetGuard} = require('./assets/js/assetguard.js')
const ConfigManager = require('./assets/js/configmanager.js')
let rscShouldLoad = false
let fatalStartupError = false
function showMainUI(){
updateSelectedServer(AssetGuard.getServerById(ConfigManager.getLauncherDirectory(), ConfigManager.getSelectedServer()).name)
updateSelectedServer(AssetGuard.getServerById(ConfigManager.getSelectedServer()).name)
refreshServerStatus()
setTimeout(() => {
document.getElementById('frameBar').style.backgroundColor = 'rgba(1, 2, 1, 0.5)'
@@ -51,6 +52,24 @@ function showFatalStartupError(){
}, 750)
}
function onDistroRefresh(data){
updateSelectedServer(AssetGuard.getServerById(ConfigManager.getSelectedServer()).name)
refreshServerStatus()
initNews()
}
function refreshDistributionIndex(remote, onSuccess, onError){
if(remote){
AssetGuard.refreshDistributionDataRemote(ConfigManager.getLauncherDirectory())
.then(onSuccess)
.catch(onError)
} else {
AssetGuard.refreshDistributionDataLocal(ConfigManager.getLauncherDirectory())
.then(onSuccess)
.catch(onError)
}
}
// Synchronous Listener
document.addEventListener('readystatechange', function(){