diff --git a/main.lua b/main.lua index 399e859..beace12 100644 --- a/main.lua +++ b/main.lua @@ -4,14 +4,6 @@ local math = require("math") mod.print = Isaac.ConsoleOutput mod.game = Game() local save = include("save"):new() -if mod:HasData() then - save:load(mod:LoadData()) - local c = 0 - for i,v in ipairs(save.seen) do - if v then c = c+1 end - end - mod.print(modname.." Loaded, "..c.." items seen\n") -end mod.font = Font() mod.font:Load("font/terminus.fnt") @@ -93,12 +85,25 @@ function mod:PickupDrawCallback(pickupEntity, _) end end +function mod:newrun() + if mod:HasData() then + local data = mod:LoadData() + mod.print(data.."\n") + save:load(data) + local c = 0 + for _,v in ipairs(save.seen) do + if v then c = c+1 end + end + mod.print(modname.." Loaded, "..c.." items seen\n") + end +end + function mod:preGameExit() - mod:RemoveData() mod:SaveData(save:dump()) end -mod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, mod.preGameExit) +mod:AddCallback(ModCallbacks.MC_POST_GAME_END, mod.preGameExit) +mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, mod.newrun) mod:AddCallback(ModCallbacks.MC_POST_UPDATE, mod.update) mod:AddCallback(ModCallbacks.MC_POST_PICKUP_RENDER, mod.PickupDrawCallback) @@ -125,6 +130,7 @@ if ModConfigMenu then end, OnChange = function(b) save.settings.eid = b + mod:SaveData(save:dump()) end, } ) @@ -141,6 +147,7 @@ if ModConfigMenu then end, OnChange = function(b) save.settings.visual = b + mod:SaveData(save:dump()) end, } ) @@ -158,6 +165,7 @@ if ModConfigMenu then end, OnChange = function(b) save.settings.showonblind = b + mod:SaveData(save:dump()) end, } ) diff --git a/metadata.xml b/metadata.xml index df9b1f6..449e2cf 100644 --- a/metadata.xml +++ b/metadata.xml @@ -3,8 +3,21 @@ DeadGod Helper deadgod helper 2985754961 - - 1.4 + A small mod for The Binding Of Isaac: Repentance! + +Easily spot items that were not previously picked up on this savefile. Very useful when you're trying to get a second or third Dead God. + +I made it mainly for myself, because it was annoying to go back to the menu every time I encountered an item I was unsure about. + +There's an integration with External Item Description. +It is also compatible with Mod Config Menu, if you want to toggle things (such as displaying info when on Curse Of The Blind) + +There's however a limitation: since (to my knowledge) there's no way to get information about seen items from the savefile, this mod takes it upon itself to track which item you picked up. (This means that when you install the mod for the first time, every item will be tagged as unseen) + +Anyway, I hope that this mod will be useful to someone :) + +(Source code is available at https://forge.chapril.org/ayte/DeadGodHelper) + 1.5 Public