diff --git a/app/assets/css/launcher.css b/app/assets/css/launcher.css index 251980d..4ba9026 100644 --- a/app/assets/css/launcher.css +++ b/app/assets/css/launcher.css @@ -1402,6 +1402,7 @@ input:checked + .toggleSwitchSlider:before { border-radius: 50%; background-color: #c32625; margin-right: 15px; + transition: 0.25s ease; } .settingsModContent { @@ -1430,8 +1431,8 @@ input:checked + .toggleSwitchSlider:before { pointer-events: none; } -.settingsMod[enabled] .settingsModStatus, -.settingsSubMod[enabled] .settingsModStatus{ +.settingsMod[enabled] > .settingsModContent > .settingsModMainWrapper > .settingsModStatus, +.settingsSubMod[enabled] > .settingsModContent > .settingsModMainWrapper > .settingsModStatus { background-color: rgb(165, 195, 37); } diff --git a/app/assets/js/scripts/settings.js b/app/assets/js/scripts/settings.js index a610dd7..270afd3 100644 --- a/app/assets/js/scripts/settings.js +++ b/app/assets/js/scripts/settings.js @@ -55,12 +55,12 @@ function initSettingsValidators(){ function initSettingsValues(){ const sEls = document.getElementById('settingsContainer').querySelectorAll('[cValue]') Array.from(sEls).map((v, index, arr) => { - const gFn = ConfigManager['get' + v.getAttribute('cValue')] + const cVal = v.getAttribute('cValue') + const gFn = ConfigManager['get' + cVal] if(typeof gFn === 'function'){ if(v.tagName === 'INPUT'){ if(v.type === 'number' || v.type === 'text'){ // Special Conditions - const cVal = v.getAttribute('cValue') if(cVal === 'JavaExecutable'){ populateJavaExecDetails(v.value) v.value = gFn() @@ -75,7 +75,6 @@ function initSettingsValues(){ } else if(v.tagName === 'DIV'){ if(v.classList.contains('rangeSlider')){ // Special Conditions - const cVal = v.getAttribute('cValue') if(cVal === 'MinRAM' || cVal === 'MaxRAM'){ let val = gFn() if(val.endsWith('M')){ @@ -101,12 +100,12 @@ function initSettingsValues(){ function saveSettingsValues(){ const sEls = document.getElementById('settingsContainer').querySelectorAll('[cValue]') Array.from(sEls).map((v, index, arr) => { - const sFn = ConfigManager['set' + v.getAttribute('cValue')] + const cVal = v.getAttribute('cValue') + const sFn = ConfigManager['set' + cVal] if(typeof sFn === 'function'){ if(v.tagName === 'INPUT'){ if(v.type === 'number' || v.type === 'text'){ // Special Conditions - const cVal = v.getAttribute('cValue') if(cVal === 'JVMOptions'){ sFn(v.value.split(' ')) } else { @@ -115,7 +114,6 @@ function saveSettingsValues(){ } else if(v.type === 'checkbox'){ sFn(v.checked) // Special Conditions - const cVal = v.getAttribute('cValue') if(cVal === 'AllowPrerelease'){ changeAllowPrerelease(v.checked) } @@ -123,7 +121,6 @@ function saveSettingsValues(){ } else if(v.tagName === 'DIV'){ if(v.classList.contains('rangeSlider')){ // Special Conditions - const cVal = v.getAttribute('cValue') if(cVal === 'MinRAM' || cVal === 'MaxRAM'){ let val = Number(v.getAttribute('value')) if(val%1 > 0){ @@ -234,6 +231,7 @@ function settingsSaveDisabled(v){ /* Closes the settings view and saves all data. */ settingsNavDone.onclick = () => { saveSettingsValues() + saveModConfiguration() ConfigManager.save() switchView(getCurrentView(), VIEWS.landing) } @@ -426,6 +424,8 @@ document.getElementById('settingsGameHeight').addEventListener('keydown', (e) => * Mods Tab */ +const settingsModsContainer = document.getElementById('settingsModsContainer') + function resolveModsForUI(){ const serv = ConfigManager.getSelectedServer() @@ -484,12 +484,12 @@ function parseModulesForUI(mdls, submodules = false, servConf){ ${mdl.hasSubModules() ? `