mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-09 01:59:15 -04:00
Merge branch 'dev' into pr-2409
# Conflicts: # src/ui/game3/save_menu.lua
This commit is contained in:
@@ -368,6 +368,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 = {},
|
||||
@@ -858,6 +859,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