Improve saving/loading without MCM
This commit is contained in:
1 parent
bc068e2e40
commit
ce975bdbc3
1 file changed
+3
-9
@@ -18,6 +18,7 @@ EID.coopMainPlayers = {} -- The primary Player Entity for each controller being
|
||||
EID.coopAllPlayers = {} -- Every Player Entity (includes Esau, T.Forgotten)
|
||||
EID.controllerIndexes = {} -- A table to map each controller index to their player number for coloring indicators
|
||||
EID.isMultiplayer = false -- Used to color P1's highlight/outline indicators (single player just uses white)
|
||||
EID.BoC = {}
|
||||
|
||||
-- general variables
|
||||
EID.PositionModifiers = {}
|
||||
@@ -1602,8 +1603,6 @@ function EID:OnUseCard(cardID, player, useFlags)
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_USE_CARD, EID.OnUseCard)
|
||||
|
||||
-- only save and load configs when using MCM. Otherwise Config file changes arent valid
|
||||
if EID.MCMLoaded or REPENTANCE then
|
||||
local json = require("json")
|
||||
local configIgnoreList = {
|
||||
["BagContent"] = true,
|
||||
@@ -1680,7 +1679,8 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
end
|
||||
end
|
||||
|
||||
-- Only copy Saved config entries that exist in the save
|
||||
-- Check if eid_config.lua is in its default state (like if an EID update occurred)
|
||||
-- If it is, or MCM is loaded, load the config from savedata instead of eid_config.lua
|
||||
if savedEIDConfig.Version == EID.Config.Version then
|
||||
local isDefaultConfig = true
|
||||
for key, value in pairs(EID.Config) do
|
||||
@@ -1699,11 +1699,7 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
end
|
||||
end
|
||||
end
|
||||
-- DisableAchievementCheck has been renamed, convert the setting to the new one (this can be removed in a few updates)
|
||||
if savedEIDConfig["DisableAchievementCheck"] then
|
||||
EID.Config["DisableStartOfRunWarnings"] = savedEIDConfig["DisableAchievementCheck"]
|
||||
end
|
||||
|
||||
EID.isHidden = EID.Config["InitiallyHidden"]
|
||||
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
|
||||
EID.Scale = EID.Config["Size"]
|
||||
@@ -1712,7 +1708,6 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt")
|
||||
end
|
||||
end
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStart)
|
||||
|
||||
--Saving Moddata--
|
||||
@@ -1744,7 +1739,6 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS] = nil
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
|
||||
end
|
||||
|
||||
if EID.enableDebug then
|
||||
require("eid_debugging")
|
||||
|
||||
Reference in new issue
Block a user