add a low item count check warning

This commit is contained in:
Buurazu authored and GitHub committed 2021-11-19 17:34:55 -05:00
1 parent 6a2c0f47e4
commit 578b06732c
1 file changed
+12 -2
+12 -2
View File
@@ -567,11 +567,19 @@ end
EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate) EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate)
local hasShownAchievementWarning = false local hasShownAchievementWarning = false
local function renderAchievementInfo() local function renderAchievementInfo()
if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 then if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 then
if EID:GetMaxCollectibleID() < EID.XMLMaxItemID then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("OutdatedModWarningText") or ""
EID:displayPermanentText(demoDescObj)
hasShownAchievementWarning = true
else
local characterID = Game():GetPlayer(0):GetPlayerType() local characterID = Game():GetPlayer(0):GetPlayerType()
--ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check)
if (characterID < 21) then if characterID < 21 and game.Challenge == 0 then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
if not hasBookOfRevelationsUnlocked then if not hasBookOfRevelationsUnlocked then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
@@ -584,6 +592,7 @@ local function renderAchievementInfo()
end end
end end
end end
end
elseif hasShownAchievementWarning then elseif hasShownAchievementWarning then
EID:hidePermanentText() EID:hidePermanentText()
end end
@@ -676,6 +685,7 @@ local function onRender(t)
end end
end end
local closest = EID.lastDescriptionEntity local closest = EID.lastDescriptionEntity
if EID.lastDist / 40 > tonumber(EID.Config["MaxDistance"]) then if EID.lastDist / 40 > tonumber(EID.Config["MaxDistance"]) then