Rework Unidentified Pill eval, to allow Description modifiers when unidentified

This commit is contained in:
Wofsauge committed 2023-10-08 16:54:53 +02:00
1 parent 34b7c2a8dc
commit c3c8710617
2 files changed
+33 -18

No files matched your search

+15 -6
View File
@@ -813,12 +813,21 @@ function EID:renderUnidentifiedPill(entity)
table.insert(EID.CachedIcons, {})
table.insert(EID.CachedRenderPoses, Vector(pos.X, pos.Y))
end
EID:renderString(
"{{Pill"..pillColor.."}} "..EID:getDescriptionEntry("unidentifiedPill"),
pos,
Vector(EID.Scale, EID.Scale),
EID:getErrorColor()
)
local descriptionObj = EID:getDescriptionObj(entity.Type, entity.Variant, entity.SubType, entity, false)
descriptionObj.Name = EID:getDescriptionEntry("unidentifiedPill")
descriptionObj.Description = ""
descriptionObj.ShowWhenUnidentified = false
descriptionObj = EID:applyDescriptionModifier(descriptionObj, -999)
if EID.Config["ShowItemIcon"] then
descriptionObj.Name = "{{Pill"..pillColor.."}} "..descriptionObj.Name
end
EID:renderString(descriptionObj.Name, pos + Vector(0,-1), Vector(EID.Scale, EID.Scale), EID:getErrorColor())
if EID.Config["ShowItemDescription"] and descriptionObj.ShowWhenUnidentified then
pos.Y = pos.Y + EID.lineHeight * EID.Scale
EID:printBulletPoints(descriptionObj.Description, pos)
end
end
-- RGB colors for each player's highlights (Red, Blue, Green, Yellow)