Added "HideUncollectedItemDescriptions" config option

- Reworked QuestionMark rendering
- Added QuestionMark Markdown

closes #693
This commit is contained in:
Wofsauge committed 2024-08-21 22:42:41 +02:00
1 parent 98aa933963
commit 73402653d3
5 files changed
+38 -35

No files matched your search

+5
View File
@@ -437,6 +437,10 @@ EID.UserConfig = {
-- Default: 0 (Deactivate all Savegame features) -- Default: 0 (Deactivate all Savegame features)
["SaveGameNumber"] = 0, ["SaveGameNumber"] = 0,
-- Hides descriptions of items, if they are not collected in the collection page
-- Default: false
["HideUncollectedItemDescriptions"] = false,
-- Highlight items, if they need to be collected for the collection page -- Highlight items, if they need to be collected for the collection page
-- Default: true -- Default: true
["ItemCollectionIndicator"] = true, ["ItemCollectionIndicator"] = true,
@@ -627,6 +631,7 @@ EID.DefaultConfig = {
["SpindownDiceDisplayName"] = false, ["SpindownDiceDisplayName"] = false,
["SpindownDiceSkipLocked"] = false, ["SpindownDiceSkipLocked"] = false,
["SaveGameNumber"] = 0, ["SaveGameNumber"] = 0,
["HideUncollectedItemDescriptions"] = false,
["ItemCollectionIndicator"] = true, ["ItemCollectionIndicator"] = true,
["ItemCollectionColor"] = "ColorFade", ["ItemCollectionColor"] = "ColorFade",
["EnableMouseControls"] = false, ["EnableMouseControls"] = false,
+1
View File
@@ -654,6 +654,7 @@ EID.InlineIcons = {
["DailyRunSmall"] = {"Misc", 15, 12, 12, 0, 1}, ["DailyRunSmall"] = {"Misc", 15, 12, 12, 0, 1},
["MagnifyingLens"] = {"Misc", 16, 13, 13, 0, -1}, ["MagnifyingLens"] = {"Misc", 16, 13, 13, 0, -1},
["Padlock"] = {"Misc", 17, 8, 10, 1, 0}, ["Padlock"] = {"Misc", 17, 8, 10, 1, 0},
["QuestionMark"] = {"CurseOfBlind", 0, 14, 14, 6, 7, EID.IconSprite},
} }
-- General Stats (Adjust automatically according to the current DLC) -- General Stats (Adjust automatically according to the current DLC)
+7 -3
View File
@@ -773,7 +773,9 @@ if MCMLoaded then
MCM.AddSpace("EID", "Repentogon") MCM.AddSpace("EID", "Repentogon")
end end
EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items",{ infoText = "Highlights items that are not yet on the collection page."}) MCM.AddText("EID", "Repentogon", "Uncollected Items")
EID:AddBooleanSetting("Repentogon", "HideUncollectedItemDescriptions", "Hide uncollected items", { infoText = "Hide descriptions of items that are not yet on the collection page."})
EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items", { infoText = "Highlights items that are not yet on the collection page."})
-- Needs collection Color -- Needs collection Color
MCM.AddSetting( MCM.AddSetting(
"EID", "EID",
@@ -788,7 +790,7 @@ if MCMLoaded then
Display = function() Display = function()
if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end
EID.MCMCompat_isDisplayingEIDTab = "Visuals"; EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Collection Page Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")" return "Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EID.MCM_OptionChanged = true EID.MCM_OptionChanged = true
@@ -799,6 +801,7 @@ if MCMLoaded then
Info = {"Highlight color for the names of items that need to be picked up for the collection page."} Info = {"Highlight color for the names of items that need to be picked up for the collection page."}
} }
) )
MCM.AddSpace("EID", "Repentogon")
EID:AddBooleanSetting("Repentogon", "RGON_ShowOnCollectionPage", "Show descriptions on collection page", { infoText = "Displays item effects when navigating the collection page in the main menu."}) EID:AddBooleanSetting("Repentogon", "RGON_ShowOnCollectionPage", "Show descriptions on collection page", { infoText = "Displays item effects when navigating the collection page in the main menu."})
-- Achievement tracking section -- Achievement tracking section
@@ -847,7 +850,8 @@ if MCMLoaded then
return "Collection page items missing: "..count end) return "Collection page items missing: "..count end)
MCM.AddSpace("EID", "Save Game") MCM.AddSpace("EID", "Save Game")
EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items") EID:AddBooleanSetting("Save Game", "HideUncollectedItemDescriptions", "Hide uncollected items", { infoText = "Hide descriptions of items that are not yet on the collection page."})
EID:AddBooleanSetting("Save Game", "ItemCollectionIndicator", "Highlight uncollected items")
-- Needs collection Color -- Needs collection Color
MCM.AddSetting( MCM.AddSetting(
"EID", "EID",
+1 -1
View File
@@ -73,7 +73,7 @@ function EID:OnMenuRender()
end end
local demoDescObj = EID:getDescriptionObj(5, 100, CollectibleId, nil, false) local demoDescObj = EID:getDescriptionObj(5, 100, CollectibleId, nil, false)
if CollectibleId < maxVanillaItemID and not Isaac.GetPersistentGameData():IsItemInCollection(CollectibleId) then if CollectibleId < maxVanillaItemID and not Isaac.GetPersistentGameData():IsItemInCollection(CollectibleId) then
EID:renderQuestionMark(nil) EID:printDescription({Icon = EID.InlineIcons["QuestionMark"], Description = description or "", Entity = entity}, nil)
return return
end end
+24 -31
View File
@@ -469,6 +469,10 @@ function EID:addDescriptionToPrint(desc, insertLoc)
if desc.Entity then EID.entitiesToPrint[GetPtrHash(desc.Entity)] = true end if desc.Entity then EID.entitiesToPrint[GetPtrHash(desc.Entity)] = true end
end end
function EID:addQuestionMarkDescription(entity, description)
EID:addDescriptionToPrint({ Icon = EID.InlineIcons["QuestionMark"], Description = description or "", Entity = entity})
end
local prevPrintFrame = 0 local prevPrintFrame = 0
function EID:printDescriptions(useCached) function EID:printDescriptions(useCached)
@@ -515,10 +519,6 @@ function EID:printNewDescriptions()
if EID:renderUnidentifiedPill(newDesc.Entity) ~= false then if EID:renderUnidentifiedPill(newDesc.Entity) ~= false then
table.insert(EID.previousDescs, newDesc) table.insert(EID.previousDescs, newDesc)
end end
elseif newDesc.Description == "QuestionMark" then
if EID:renderQuestionMark(newDesc.Entity) ~= false then
table.insert(EID.previousDescs, newDesc)
end
elseif EID:printDescription(newDesc) ~= false then elseif EID:printDescription(newDesc) ~= false then
table.insert(EID.previousDescs, newDesc) table.insert(EID.previousDescs, newDesc)
end end
@@ -600,7 +600,7 @@ function EID:printDescription(desc, cachedID)
end end
--Display Itemname --Display Itemname
local curName = "" local curName = ""
if EID.Config["ShowItemName"] then if EID.Config["ShowItemName"] and desc.Name then
curName = desc.Name curName = desc.Name
if EID.Config["TranslateItemName"] ~= 2 then if EID.Config["TranslateItemName"] ~= 2 then
local curLanguage = EID.Config["Language"] local curLanguage = EID.Config["Language"]
@@ -617,7 +617,7 @@ function EID:printDescription(desc, cachedID)
end end
end end
-- Display Entity ID -- Display Entity ID
if EID.Config["ShowObjectID"] and desc.ObjType > 0 then if EID.Config["ShowObjectID"] and desc.ObjType and desc.ObjType > 0 then
curName = curName.." {{ColorGray}}"..desc.ObjType.."."..desc.ObjVariant.."."..desc.ObjSubType curName = curName.." {{ColorGray}}"..desc.ObjType.."."..desc.ObjVariant.."."..desc.ObjSubType
end end
-- Display Quality -- Display Quality
@@ -649,7 +649,7 @@ function EID:printDescription(desc, cachedID)
renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale
--Display Transformation --Display Transformation
if not (desc.Transformation == "0" or desc.Transformation == "" or desc.Transformation == nil) then if desc.Transformation and not (desc.Transformation == "0" or desc.Transformation == "") then
for transform in string.gmatch(desc.Transformation, "([^,]+)") do for transform in string.gmatch(desc.Transformation, "([^,]+)") do
--have a blank sprite info table if we aren't displaying it --have a blank sprite info table if we aren't displaying it
local transformSprite = EID.Config["TransformationIcons"] and EID:getTransformationIcon(transform) or {} local transformSprite = EID.Config["TransformationIcons"] and EID:getTransformationIcon(transform) or {}
@@ -694,7 +694,7 @@ function EID:printDescription(desc, cachedID)
end end
end end
-- Display Last Pool for Collectible for full reroll effects (name) -- Display Last Pool for Collectible for full reroll effects (name)
if EID.isRepentance and not EID.InsideItemReminder and EID.Config["ShowItemPoolText"] and (desc.ObjType == 5 and desc.ObjVariant == 100) then if EID.isRepentance and not EID.InsideItemReminder and EID.Config["ShowItemPoolText"] and (desc.ObjType and desc.ObjType == 5 and desc.ObjVariant and desc.ObjVariant == 100) then
local itemConfig = EID.itemConfig:GetCollectible(desc.ObjSubType) local itemConfig = EID.itemConfig:GetCollectible(desc.ObjSubType)
if itemConfig:IsCollectible() and not itemConfig:HasTags(ItemConfig.TAG_QUEST) then if itemConfig:IsCollectible() and not itemConfig:HasTags(ItemConfig.TAG_QUEST) then
local lastPool = game:GetItemPool():GetLastPool() local lastPool = game:GetItemPool():GetLastPool()
@@ -799,22 +799,6 @@ EID:AddCallback(ModCallbacks.MC_EXECUTE_CMD, EID.onCmd)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------Handle Rendering-------------------------------- ---------------------------Handle Rendering--------------------------------
function EID:renderQuestionMark(entity)
EID:PositionLocalMode(entity)
if EID.CurrentScaleType == "Size" then
if alwaysUseLocalMode then return false
else alwaysUseLocalMode = true end
end
EID.IconSprite:Play("CurseOfBlind")
local pos = EID:getTextPosition()
if EID.CachingDescription then
table.insert(EID.CachedStrings, {})
table.insert(EID.CachedIcons, {})
table.insert(EID.CachedRenderPoses, Vector(pos.X, pos.Y))
end
EID:renderIcon(EID.IconSprite, pos.X + 5 * EID.Scale, pos.Y + 5 * EID.Scale, nil, "CurseOfBlind", 0)
end
function EID:renderUnidentifiedPill(entity) function EID:renderUnidentifiedPill(entity)
EID:PositionLocalMode(entity) EID:PositionLocalMode(entity)
if EID.CurrentScaleType == "Size" then if EID.CurrentScaleType == "Size" then
@@ -1457,8 +1441,11 @@ function EID:OnRender()
-- Handle Glitched Items -- Handle Glitched Items
elseif closest.Type == 5 and closest.Variant == 100 and closest.SubType > 4294960000 then elseif closest.Type == 5 and closest.Variant == 100 and closest.SubType > 4294960000 then
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
if (REPENTOGON and closest:ToPickup():IsBlind()) or (EID:hasCurseBlind() and not closest:ToPickup().Touched and EID.Config["DisableOnCurse"] and not EID.isDeathCertRoom) or (EID.Config["DisableOnAltPath"] and not closest:ToPickup().Touched and EID:IsAltChoice(closest)) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then if (REPENTOGON and closest:ToPickup():IsBlind())
EID:addDescriptionToPrint({ Description = "QuestionMark", Entity = closest}) or (EID:hasCurseBlind() and not closest:ToPickup().Touched and EID.Config["DisableOnCurse"] and not EID.isDeathCertRoom)
or (EID.Config["DisableOnAltPath"] and not closest:ToPickup().Touched and EID:IsAltChoice(closest))
or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then
EID:addQuestionMarkDescription(closest)
end end
end end
@@ -1494,7 +1481,7 @@ function EID:OnRender()
if EID.CraneItemType[tostring(closest.InitSeed)] or EID.CraneItemType[closest.InitSeed.."Drop"..closest.DropSeed] then if EID.CraneItemType[tostring(closest.InitSeed)] or EID.CraneItemType[closest.InitSeed.."Drop"..closest.DropSeed] then
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
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:addDescriptionToPrint({ Description = "QuestionMark", Entity = closest}) EID:addQuestionMarkDescription(closest)
end end
end end
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)]
@@ -1515,8 +1502,14 @@ function EID:OnRender()
elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then
--Handle Collectibles --Handle Collectibles
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
if (REPENTOGON and closest:ToPickup():IsBlind()) or (EID:hasCurseBlind() and not closest:ToPickup().Touched and EID.Config["DisableOnCurse"] and not EID.isDeathCertRoom) or (EID.Config["DisableOnAltPath"] and not closest:ToPickup().Touched and EID:IsAltChoice(closest)) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then local isHideUncollected = EID.Config["HideUncollectedItemDescriptions"] and EID:requiredForCollectionPage(closest.SubType)
EID:addDescriptionToPrint({ Description = "QuestionMark", Entity = closest}) if (REPENTOGON and closest:ToPickup():IsBlind())
or isHideUncollected
or (EID:hasCurseBlind() and not closest:ToPickup().Touched and EID.Config["DisableOnCurse"] and not EID.isDeathCertRoom)
or (EID.Config["DisableOnAltPath"] and not closest:ToPickup().Touched and EID:IsAltChoice(closest))
or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then
local description = isHideUncollected and EID:getDescriptionEntry("CollectionPageInfo") or nil
EID:addQuestionMarkDescription(closest, description)
end end
end end
local descriptionObj = EID:getDescriptionObjByEntity(closest) local descriptionObj = EID:getDescriptionObjByEntity(closest)
@@ -1532,7 +1525,7 @@ function EID:OnRender()
(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 then
EID:addDescriptionToPrint({ Description = "QuestionMark", Entity = closest}) EID:addQuestionMarkDescription(closest)
end end
end end
local isCantrippedCard = game.Challenge == 43 and closest.SubType > 32768 local isCantrippedCard = game.Challenge == 43 and closest.SubType > 32768
@@ -1552,7 +1545,7 @@ function EID:OnRender()
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
EID:addDescriptionToPrint({ Description = "QuestionMark", Entity = closest}) EID:addQuestionMarkDescription(closest)
end end
end end