Active item touched status is now saved in between game restarts
This commit is contained in:
1 parent
a13ee770c3
commit
55f5b11f26
2 files changed
+17
-2
No files matched your search
+1
-1
@@ -1483,7 +1483,7 @@ function EID:evaluateQueuedItems()
|
|||||||
if not EID.TouchedActiveItems[i] then
|
if not EID.TouchedActiveItems[i] then
|
||||||
EID.TouchedActiveItems[i] = {LastTouch = 0}
|
EID.TouchedActiveItems[i] = {LastTouch = 0}
|
||||||
end
|
end
|
||||||
if EID.TouchedActiveItems[i].LastTouch + 60 >= game:GetFrameCount() and player.QueuedItem.Item then
|
if EID.TouchedActiveItems[i].LastTouch + 45 >= game:GetFrameCount() and player.QueuedItem.Item then
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
EID.TouchedActiveItems[i].LastTouch = 0
|
EID.TouchedActiveItems[i].LastTouch = 0
|
||||||
|
|||||||
@@ -1472,7 +1472,9 @@ EID:AddCallback(ModCallbacks.MC_POST_RENDER, onRender)
|
|||||||
|
|
||||||
local function OnGameStartGeneral(_,isSave)
|
local function OnGameStartGeneral(_,isSave)
|
||||||
EID:buildTransformationTables()
|
EID:buildTransformationTables()
|
||||||
EID.TouchedActiveItems = {}
|
if not isSave then
|
||||||
|
EID.TouchedActiveItems = {}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral)
|
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral)
|
||||||
|
|
||||||
@@ -1486,6 +1488,7 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
["FlipItemPositions"] = true,
|
["FlipItemPositions"] = true,
|
||||||
["AbsorbedItems"] = true,
|
["AbsorbedItems"] = true,
|
||||||
["CollectedItems"] = true,
|
["CollectedItems"] = true,
|
||||||
|
["TouchedActiveItems"] = true,
|
||||||
}
|
}
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--------Handle Savadata---------
|
--------Handle Savadata---------
|
||||||
@@ -1503,6 +1506,17 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
EID.SaveGame[EID.Config["SaveGameNumber"]].ItemNeedsPickup[id] = nil
|
EID.SaveGame[EID.Config["SaveGameNumber"]].ItemNeedsPickup[id] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
EID.TouchedActiveItems = {}
|
||||||
|
if isSave then
|
||||||
|
-- JSON saves integer table keys as strings. we need to transform them back...
|
||||||
|
for playerID, data in pairs(savedEIDConfig["TouchedActiveItems"]) do
|
||||||
|
local convertedData = {}
|
||||||
|
for key, value in pairs(data) do
|
||||||
|
convertedData[tonumber(key) or key] = value
|
||||||
|
end
|
||||||
|
EID.TouchedActiveItems[tonumber(playerID)] = convertedData
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
EID.BagItems = {}
|
EID.BagItems = {}
|
||||||
@@ -1589,6 +1603,7 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
EID.Config["FlipItemPositions"] = flipItemTable or {}
|
EID.Config["FlipItemPositions"] = flipItemTable or {}
|
||||||
end
|
end
|
||||||
EID.Config["CollectedItems"] = EID.CollectedItems
|
EID.Config["CollectedItems"] = EID.CollectedItems
|
||||||
|
EID.Config["TouchedActiveItems"] = EID.TouchedActiveItems or {}
|
||||||
|
|
||||||
EID.SaveData(EID, json.encode(EID.Config))
|
EID.SaveData(EID, json.encode(EID.Config))
|
||||||
EID:hidePermanentText()
|
EID:hidePermanentText()
|
||||||
|
|||||||
Reference in new issue
Block a user