From 13072bcee0743b3f182f1803950c3e3d468c8b66 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 15 May 2021 19:23:31 +0200 Subject: [PATCH] Added Option to display item descriptions for Alt path items --- eid_config.lua | 2 +- main.lua | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index f9c1e82a..81005607 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -62,7 +62,7 @@ EID.DefaultConfig = { ["DisableOnCurse"] = true, -- Disable Item informations for the second Treasure room item on alt paths -- Default = true - ["DisableOnAltPath"] = true, -- CURRENTLY NOT WORKING! + ["DisableOnAltPath"] = true, ----------ITEM NAMES----------- -- Toggle Display of Collectible / Card and Pill names diff --git a/main.lua b/main.lua index dfc887c5..5a58d59b 100644 --- a/main.lua +++ b/main.lua @@ -126,6 +126,29 @@ if EID.Config["DisplaySacrificeInfo"] then EID:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, EID.onSacrificeDamage, EntityType.ENTITY_PLAYER) end +--------------------------------------------------------------------------- +------------------------Handle ALT FLOOR CHOICE---------------------------- +if REPENTANCE then + local altPathItemCounter = 0 + + function EID:onCollectibleInit(pickup) + if pickup.FrameCount > 0 then + return + end + pickup:GetData()["EID_IsAltChoise"] = false + if Game():GetRoom():GetType() == RoomType.ROOM_TREASURE and Game():GetLevel():GetStageType() > 3 and pickup.OptionsPickupIndex == 1 then + pickup:GetData()["EID_IsAltChoise"] = altPathItemCounter == 1 + altPathItemCounter = altPathItemCounter + 1 + end + end + EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.onCollectibleInit, PickupVariant.PICKUP_COLLECTIBLE) + + function EID:resetAltPathCounter() + altPathItemCounter = 0 + end + EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.resetAltPathCounter) +end + --------------------------------------------------------------------------- ---------------------------Printing Functions------------------------------ @@ -490,13 +513,13 @@ local function onRender(t) EID:printDescription(descriptionObj) elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then --Handle Collectibles - if EID:hasCurseBlind() and EID.Config["DisableOnCurse"] then + if (EID:hasCurseBlind() and EID.Config["DisableOnCurse"]) or (closest:GetData()["EID_IsAltChoise"] and EID.Config["DisableOnAltPath"]) then EID:renderQuestionMark() return end local descriptionObj = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType) - if EID.GameVersion == "rep" then + if REPENTANCE then -- Handle Birthright if closest.SubType == 619 then local playerID = player.SubType + 1