Allow cards to be unhidden via the "ShowWhenUnidentified" flag
closes #797
This commit is contained in:
1 parent
e4795a42d2
commit
db406cacbf
1 file changed
+20
-8
@@ -1517,12 +1517,13 @@ function EID:OnRender()
|
|||||||
if (EID:hasCurseBlind() and EID.Config["DisableOnCurse"]) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then
|
if (EID:hasCurseBlind() and EID.Config["DisableOnCurse"]) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then
|
||||||
EID:addQuestionMarkDescription(closest)
|
EID:addQuestionMarkDescription(closest)
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
local collectibleID = EID.CraneItemType[closest.InitSeed.."Drop"..closest.DropSeed] or EID.CraneItemType[tostring(closest.InitSeed)]
|
local collectibleID = EID.CraneItemType[closest.InitSeed.."Drop"..closest.DropSeed] or EID.CraneItemType[tostring(closest.InitSeed)]
|
||||||
local descriptionObj = EID:getDescriptionObj(5, 100, collectibleID, closest)
|
local descriptionObj = EID:getDescriptionObj(5, 100, collectibleID, closest)
|
||||||
|
|
||||||
EID:addDescriptionToPrint(descriptionObj)
|
EID:addDescriptionToPrint(descriptionObj)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
--Handle Broken Shovel
|
--Handle Broken Shovel
|
||||||
elseif closest.Type == 5 and closest.Variant == 110 then
|
elseif closest.Type == 5 and closest.Variant == 110 then
|
||||||
local descriptionObj = EID:getDescriptionObj(5, 100, 550, closest)
|
local descriptionObj = EID:getDescriptionObj(5, 100, 550, closest)
|
||||||
@@ -1539,11 +1540,13 @@ function EID:OnRender()
|
|||||||
local isHideUncollected = EID.Config["HideUncollectedItemDescriptions"] and EID:requiredForCollectionPage(closest.SubType)
|
local isHideUncollected = EID.Config["HideUncollectedItemDescriptions"] and EID:requiredForCollectionPage(closest.SubType)
|
||||||
local description = isHideUncollected and EID:getDescriptionEntry("CollectionPageInfo") or nil
|
local description = isHideUncollected and EID:getDescriptionEntry("CollectionPageInfo") or nil
|
||||||
EID:addQuestionMarkDescription(closest, description)
|
EID:addQuestionMarkDescription(closest, description)
|
||||||
end
|
else
|
||||||
local descriptionObj = EID:getDescriptionObjByEntity(closest)
|
local descriptionObj = EID:getDescriptionObjByEntity(closest)
|
||||||
EID:addDescriptionToPrint(descriptionObj)
|
EID:addDescriptionToPrint(descriptionObj)
|
||||||
|
end
|
||||||
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
|
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
|
||||||
|
local descriptionObj = EID:getDescriptionObjByEntity(closest)
|
||||||
|
local wasHidden = false
|
||||||
--Handle Cards & Runes
|
--Handle Cards & Runes
|
||||||
if EID:getEntityData(closest, "EID_DontHide") ~= true then
|
if EID:getEntityData(closest, "EID_DontHide") ~= true then
|
||||||
local isSoulstone = closest.SubType >= 81 and closest.SubType <= 97
|
local isSoulstone = closest.SubType >= 81 and closest.SubType <= 97
|
||||||
@@ -1552,31 +1555,37 @@ function EID:OnRender()
|
|||||||
local obstructed = ((not isSoulstone and not EID.Config["DisplayObstructedCardInfo"]) or
|
local obstructed = ((not isSoulstone and not EID.Config["DisplayObstructedCardInfo"]) or
|
||||||
(not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and
|
(not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and
|
||||||
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
|
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
|
||||||
if isOptionsSpawn or hideinShop or obstructed then
|
if (isOptionsSpawn or hideinShop or obstructed) and not descriptionObj.ShowWhenUnidentified then
|
||||||
|
-- Render Questionmark
|
||||||
EID:addQuestionMarkDescription(closest)
|
EID:addQuestionMarkDescription(closest)
|
||||||
|
wasHidden = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local isCantrippedCard = game.Challenge == 43 and closest.SubType > 32768
|
local isCantrippedCard = game.Challenge == 43 and closest.SubType > 32768
|
||||||
if isCantrippedCard then
|
if isCantrippedCard then
|
||||||
local descriptionObj = EID:getDescriptionObj(5, 100, closest.SubType - 32768, closest)
|
-- Convert into item description for CanTripped Challenge
|
||||||
|
descriptionObj = EID:getDescriptionObj(5, 100, closest.SubType - 32768, closest)
|
||||||
EID:addDescriptionToPrint(descriptionObj)
|
EID:addDescriptionToPrint(descriptionObj)
|
||||||
else
|
elseif not wasHidden then
|
||||||
local descriptionObj = EID:getDescriptionObjByEntity(closest)
|
-- Show card / Rune description
|
||||||
EID:addDescriptionToPrint(descriptionObj)
|
EID:addDescriptionToPrint(descriptionObj)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif closest.Variant == PickupVariant.PICKUP_PILL then
|
elseif closest.Variant == PickupVariant.PICKUP_PILL then
|
||||||
--Handle Pills
|
--Handle Pills
|
||||||
|
local wasHidden = false
|
||||||
if EID:getEntityData(closest, "EID_DontHide") ~= true then
|
if EID:getEntityData(closest, "EID_DontHide") ~= true then
|
||||||
local hideinShop = closest:ToPickup():IsShopItem() and not EID.Config["DisplayPillInfoShop"]
|
local hideinShop = closest:ToPickup():IsShopItem() and not EID.Config["DisplayPillInfoShop"]
|
||||||
local isOptionsSpawn = EID.isRepentance and not EID.Config["DisplayPillInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0
|
local isOptionsSpawn = EID.isRepentance and not EID.Config["DisplayPillInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0
|
||||||
local obstructed = not EID.Config["DisplayObstructedPillInfo"] and
|
local obstructed = not EID.Config["DisplayObstructedPillInfo"] and
|
||||||
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
|
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
|
||||||
if isOptionsSpawn or hideinShop or obstructed then
|
if isOptionsSpawn or hideinShop or obstructed then
|
||||||
|
-- Render Questionmark
|
||||||
EID:addQuestionMarkDescription(closest)
|
EID:addQuestionMarkDescription(closest)
|
||||||
|
wasHidden = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if not wasHidden then
|
||||||
local pillColor = closest.SubType
|
local pillColor = closest.SubType
|
||||||
local pool = game:GetItemPool()
|
local pool = game:GetItemPool()
|
||||||
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"]
|
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"]
|
||||||
@@ -1585,11 +1594,14 @@ function EID:OnRender()
|
|||||||
local wasUsed = EID:WasPillUsed(pillColor)
|
local wasUsed = EID:WasPillUsed(pillColor)
|
||||||
|
|
||||||
if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then
|
if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then
|
||||||
|
-- show identified pill
|
||||||
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest)
|
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest)
|
||||||
EID:addDescriptionToPrint(descEntry)
|
EID:addDescriptionToPrint(descEntry)
|
||||||
else
|
else
|
||||||
|
-- show unidentified pill description
|
||||||
EID:addDescriptionToPrint({ Description = "UnidentifiedPill", Entity = closest})
|
EID:addDescriptionToPrint({ Description = "UnidentifiedPill", Entity = closest})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
elseif EID.Config["EnableEntityDescriptions"] then
|
elseif EID.Config["EnableEntityDescriptions"] then
|
||||||
--Handle Entities (omni)
|
--Handle Entities (omni)
|
||||||
local descriptionEntry = EID:getDescriptionObjByEntity(closest)
|
local descriptionEntry = EID:getDescriptionObjByEntity(closest)
|
||||||
|
|||||||
Reference in new issue
Block a user