From eb07fdf8b4ae52d48370db54cf2c7279a9ae207d Mon Sep 17 00:00:00 2001 From: Buurazu Date: Fri, 12 Nov 2021 11:37:59 -0500 Subject: [PATCH] fix hide key issues and Tainted Lost achievement warning issue --- main.lua | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/main.lua b/main.lua index 0dde8d69..d433f8c3 100644 --- a/main.lua +++ b/main.lua @@ -568,15 +568,19 @@ EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate) local hasShownAchievementWarning = false local function renderAchievementInfo() if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 then - local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) - if not hasBookOfRevelationsUnlocked then - local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) - if not hasCubeOfMeatUnlocked then - local demoDescObj = EID:getDescriptionObj(-999, -1, 1) - demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" - demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" - EID:displayPermanentText(demoDescObj) - hasShownAchievementWarning = true + 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) + if (characterID < 21) then + local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) + if not hasBookOfRevelationsUnlocked then + local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) + if not hasCubeOfMeatUnlocked then + local demoDescObj = EID:getDescriptionObj(-999, -1, 1) + demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" + demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" + EID:displayPermanentText(demoDescObj) + hasShownAchievementWarning = true + end end end elseif hasShownAchievementWarning then @@ -593,7 +597,10 @@ local function onRender(t) EID.isDisplaying = false EID:setPlayer() - if Input.IsButtonTriggered(EID.Config["HideKey"], EID.player.ControllerIndex or 0) or Input.IsButtonTriggered(EID.Config["HideKey"], 0) then + --Controller hide keys are 0 through 26, keyboard hide keys are 32+ + local hidekeyType = 0 + if EID.Config["HideKey"] < 32 then hidekeyType = EID.player.ControllerIndex end + if Input.IsButtonTriggered(EID.Config["HideKey"], hidekeyType) then EID.isHidden = not EID.isHidden end if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" then --if if the mod config menu exists, is opened and Hide Hud is enabled, and ModConfigMenu is currently in the "Visuals" tab of EID @@ -601,8 +608,7 @@ local function onRender(t) end EID:renderMCMDummyDescription() - -- Disabling Achievement detection for now, since it breaks on some occasions since new patch - --renderAchievementInfo() + renderAchievementInfo() if EID.GameVersion == "ab+" then if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then