fix hide key issues and Tainted Lost achievement warning issue

This commit is contained in:
Buurazu authored and GitHub committed 2021-11-12 11:37:59 -05:00
1 parent 2e47219f01
commit eb07fdf8b4
1 file changed
+18 -12
+18 -12
View File
@@ -568,15 +568,19 @@ 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 and game.Challenge == 0 then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) local characterID = Game():GetPlayer(0):GetPlayerType()
if not hasBookOfRevelationsUnlocked then --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check)
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) if (characterID < 21) then
if not hasCubeOfMeatUnlocked then local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
local demoDescObj = EID:getDescriptionObj(-999, -1, 1) if not hasBookOfRevelationsUnlocked then
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or "" if not hasCubeOfMeatUnlocked then
EID:displayPermanentText(demoDescObj) local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
hasShownAchievementWarning = true demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or ""
EID:displayPermanentText(demoDescObj)
hasShownAchievementWarning = true
end
end end
end end
elseif hasShownAchievementWarning then elseif hasShownAchievementWarning then
@@ -593,7 +597,10 @@ local function onRender(t)
EID.isDisplaying = false EID.isDisplaying = false
EID:setPlayer() 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 EID.isHidden = not EID.isHidden
end 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 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 end
EID:renderMCMDummyDescription() 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.GameVersion == "ab+" then
if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then