Fixed a small save bug

This commit is contained in:
theo@manjaro 2023-06-17 11:55:16 +02:00
parent 274cc0c495
commit 6f91218f68
2 changed files with 21 additions and 16 deletions

View File

@ -122,22 +122,24 @@ function mod:newrun()
end
save = savegen:new()
save:load(json, data)
local c = 0
for _,v in ipairs(save.seen) do
if v then c = c+1 end
end
mod.print(modname.." loaded, "..c.." vanilla items seen")
if save.settings.showonmodded then
local c = 0
for _,v in pairs(save.seenmodded) do
if v then
c = c + 1
end
end
mod.print(", "..tostring(c).." modded")
end
mod.print(".\n")
else
save = savegen:new()
end
local c = 0
for _,v in ipairs(save.seen) do
if v then c = c+1 end
end
mod.print(modname.." loaded, "..c.." vanilla items seen")
if save.settings.showonmodded then
local c = 0
for _,v in pairs(save.seenmodded) do
if v then
c = c + 1
end
end
mod.print(", "..tostring(c).." modded")
end
mod.print(".\n")
end
function mod:save()

View File

@ -17,13 +17,16 @@ It is also compatible with Mod Config Menu, if you want to toggle things (such a
Since mods can't directly access the savefile, this mod takes it upon itself to track wich items are picked up. This means that the first time you install this mod, everything will be marked as unseen.
Turns out EID already has a some support for this, using a save extractor. If you want to go down that route, here's the link to the extractor : https://github.com/wofsauge/External-Item-Descriptions/tree/master/scripts
However, EID's save extractor doesn't really work on Linux, so I made a port of it in python, in order to be more easily ran. This port is available here : https://forge.chapril.org/ayte/DeadGodHelper/src/branch/main/SaveExtractor
This port can also extract save file's info to be used for Dead God Helper.
This mod is still relevant in itself if you do not want to use external tools, or you want to track modded items ^^
Anyway, I hope that this mod will be useful to someone :)
Source code is available at https://forge.chapril.org/ayte/DeadGodHelper</description>
<version>1.10</version>
<version>1.11</version>
<visibility>Public</visibility>
<tag id="Items"/>
<tag id="Graphics"/>