Enable remote launcher catalog source
This commit is contained in:
@@ -6,6 +6,7 @@ const {
|
||||
ensureJavaDirIsRoot
|
||||
} = require('helios-core/java')
|
||||
|
||||
const CatalogManager = require('./assets/js/catalogmanager')
|
||||
const DropinModUtil = require('./assets/js/dropinmodutil')
|
||||
const { MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR } = require('./assets/js/ipcconstants')
|
||||
const settingsBackButton = document.getElementById('settingsBackButton')
|
||||
@@ -326,22 +327,45 @@ function settingsSaveDisabled(v){
|
||||
settingsNavDone.disabled = v
|
||||
}
|
||||
|
||||
function fullSettingsSave() {
|
||||
async function refreshCatalogSourceViews(){
|
||||
await CatalogManager.getInstalledProfiles()
|
||||
CatalogManager.applyConfiguredProfile()
|
||||
|
||||
if(typeof refreshInstallView === 'function'){
|
||||
await refreshInstallView()
|
||||
}
|
||||
if(typeof refreshLibraryView === 'function'){
|
||||
await refreshLibraryView()
|
||||
}
|
||||
if(typeof refreshSelectedProfileButton === 'function'){
|
||||
refreshSelectedProfileButton()
|
||||
}
|
||||
if(typeof refreshServerStatus === 'function'){
|
||||
await refreshServerStatus(true)
|
||||
}
|
||||
}
|
||||
|
||||
async function fullSettingsSave() {
|
||||
const previousCatalogSource = ConfigManager.getLibraryCatalogSource()
|
||||
saveSettingsValues()
|
||||
saveModConfiguration()
|
||||
ConfigManager.save()
|
||||
saveDropinModConfiguration()
|
||||
saveShaderpackSettings()
|
||||
|
||||
if(previousCatalogSource !== ConfigManager.getLibraryCatalogSource()){
|
||||
await refreshCatalogSourceViews()
|
||||
}
|
||||
}
|
||||
|
||||
/* Closes the settings view and saves all data. */
|
||||
settingsNavDone.onclick = () => {
|
||||
fullSettingsSave()
|
||||
settingsNavDone.onclick = async () => {
|
||||
await fullSettingsSave()
|
||||
switchView(getCurrentView(), VIEWS.landing)
|
||||
}
|
||||
|
||||
settingsBackButton.onclick = () => {
|
||||
fullSettingsSave()
|
||||
settingsBackButton.onclick = async () => {
|
||||
await fullSettingsSave()
|
||||
switchView(getCurrentView(), VIEWS.landing)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user