|
@@ -102,24 +102,20 @@
|
|
|
<<image "system/1_openings/splashes/splash#.jpg" 1 14>>
|
|
|
|
|
|
:: ModManager[menu]
|
|
|
- <<set _existingMods = {cheatmenu:{'label':'CheatMenu','description':'Adds a cheat menu. You can reach it ingame via the menu-button ingame.','path':'mod_cm.html'}}>>
|
|
|
+ <<set _modPaths = JSON.parse(localStorage.getItem('modPaths') || '[]')>>
|
|
|
+ <<set _modPathsDisplay = _modPaths.join('\n')>>
|
|
|
|
|
|
- <<set _currentModSettings = JSON.parse(localStorage.getItem("glife_mods") || "{}")>>
|
|
|
- <<run console.log("CurrentModSettings",_currentModSettings)>>
|
|
|
-
|
|
|
- <<for _modId,_modData range _existingMods>>
|
|
|
- <<set _existingMods[_modId].enabled = (_currentModSettings[_modId]?.enabled === true)>>
|
|
|
- <p><<checkbox `"_existingMods['"+_modId+"'].enabled"` false true autocheck>>_modData.label : _modData.description</p>
|
|
|
- <</for>>
|
|
|
+ <<textarea "_modPathsDisplay" _modPathsDisplay>>
|
|
|
|
|
|
+ <<button 'Apply'>>
|
|
|
+ <<set _modPaths = _modPathsDisplay.split(/\r?\n|\r|\n/g)>>
|
|
|
+ <<set _modPaths = _modPaths.map((raw)=>raw.trim()).filter((path)=>path!='')>>
|
|
|
+ <<if _modPaths.length>>
|
|
|
+ <<run localStorage.setItem('modPaths',JSON.stringify(_modPaths))>>
|
|
|
+ <<else>>
|
|
|
+ <<run localStorage.setItem('modPaths',"[]")>>
|
|
|
+ <</if>>
|
|
|
+ <<run location.reload()>>
|
|
|
+ <</button>>
|
|
|
|
|
|
- <<button 'Confirm'>>
|
|
|
- <<set _enabledMods = {}>>
|
|
|
- <<for _modId,_modData range _existingMods>>
|
|
|
- <<if _modData.enabled>>
|
|
|
- <<set _enabledMods[_modId] = {enabled: true, path: _modData.path}>>
|
|
|
- <</if>>
|
|
|
- <</for>>
|
|
|
- <<run localStorage.setItem("glife_mods",JSON.stringify(_enabledMods))>>
|
|
|
- <<run location.reload(true)>>
|
|
|
- <</button>>
|
|
|
+ <<link "Back">><<goto "index">><</link>>
|