mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-09 01:59:15 -04:00
CLOSES #2290, CLOSES #2338, CLOSES #2186, CLOSES #2305, CLOSES #2332, CLOSES #2320, CLOSES #2344, CLOSES #2291, CLOSES #2335, CLOSES #2340, CLOSES #2385, CLOSES #2352, CLOSES #2378, CLOSES #2403, CLOSES #2404, CLOSES #2405, CLOSES #2367, CLOSES #2037, CLOSES #2177, CLOSES #2368, CLOSES #2382, CLOSES #1951
CLOSES #2290, CLOSES #2338, CLOSES #2186, CLOSES #2305, CLOSES #2332, CLOSES #2320, CLOSES #2344, CLOSES #2291, CLOSES #2335, CLOSES #2340, CLOSES #2385, CLOSES #2352, CLOSES #2378, CLOSES #2403, CLOSES #2404, CLOSES #2405, CLOSES #2367, CLOSES #2037, CLOSES #2177, CLOSES #2368, CLOSES #2382, CLOSES #1951
This commit is contained in:
@@ -359,6 +359,7 @@ function SaveData.defaultOptions()
|
||||
-- migrated into PROFILE 1, so deleting every profile does not re-seed one.
|
||||
modProfiles = {},
|
||||
modProfilesSeeded = false,
|
||||
modOrder = {},
|
||||
-- GitHub release checks for mods with a manifest "github" field
|
||||
-- (src/mods/ModUpdate.lua). Keyed by owner/repo; TTL is six hours.
|
||||
modUpdateCache = {},
|
||||
@@ -849,6 +850,25 @@ local function forcedGenerations(entry)
|
||||
return entry == true and 2 or nil
|
||||
end
|
||||
|
||||
function SaveData.modOrder(options)
|
||||
local raw = type(options) == "table" and options.modOrder or nil
|
||||
local out, seen = {}, {}
|
||||
if type(raw) ~= "table" then return out end
|
||||
for _, id in ipairs(raw) do
|
||||
if type(id) == "string" and id ~= "" and not seen[id] then
|
||||
seen[id] = true
|
||||
out[#out + 1] = id
|
||||
end
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
function SaveData.setModOrder(options, ids)
|
||||
if type(options) ~= "table" then return options end
|
||||
options.modOrder = SaveData.modOrder({ modOrder = ids })
|
||||
return options
|
||||
end
|
||||
|
||||
function SaveData.modForced(options, id, version, generation)
|
||||
local entry = type(options) == "table" and type(options.modsGen2) == "table"
|
||||
and options.modsGen2[id]
|
||||
|
||||
Reference in New Issue
Block a user