mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-18 19:54:21 +02:00
CLOSES #455, CLOSES #487, CLOSES #501, CLOSES #540, CLOSES #585, CLOSES #591, CLOSES #593, CLOSES #595, CLOSES #597, CLOSES #599, CLOSES #600, CLOSES #606, CLOSES #607, CLOSES #610, CLOSES #613, CLOSES #616, CLOSES #620, CLOSES #626, CLOSES #632, CLOSES #633, CLOSES #647
This commit is contained in:
@@ -265,6 +265,21 @@ function LauncherMods.setEnabled(id, enabled)
|
||||
return true
|
||||
end
|
||||
|
||||
-- setAllEnabled(ids, enabled): the launcher's Enable all / Disable all buttons
|
||||
-- (#647). Writes exactly the options.mods shape setEnabled does, but loads and
|
||||
-- saves once for the whole list: saveOptions rewrites the whole options file per
|
||||
-- call, so looping setEnabled over a big mods folder is one disk write per mod
|
||||
-- and leaves a half-applied state behind if one of them fails.
|
||||
function LauncherMods.setAllEnabled(ids, enabled)
|
||||
local options = SaveData.loadOptions()
|
||||
options.mods = options.mods or {}
|
||||
for _, id in ipairs(ids or {}) do
|
||||
options.mods[id] = enabled and true or false
|
||||
end
|
||||
SaveData.saveOptions(options)
|
||||
return true
|
||||
end
|
||||
|
||||
-- ------- install (love.filesystem)
|
||||
|
||||
-- Read a .zip source into bytes. A string is an external absolute path (like
|
||||
|
||||
Reference in New Issue
Block a user