Added charge indicator for timed and special charging items

This commit is contained in:
Wofsauge committed 2021-05-29 03:01:27 +02:00
1 parent 43b700bd93
commit 84dee07404
4 files changed
+25 -10

No files matched your search

+18 -5
View File
@@ -29,6 +29,8 @@ EID.IconSprite:Load("gfx/eid_transform_icons.anm2", true)
EID.InlineIconSprite = Sprite()
EID.InlineIconSprite:Load("gfx/eid_inline_icons.anm2", true)
EID.InlineIconSprite2 = Sprite()
EID.InlineIconSprite2:Load("gfx/eid_inline_icons.anm2", true)
EID.CardPillSprite = Sprite()
EID.CardPillSprite:Load("gfx/eid_cardspills.anm2", true)
@@ -218,11 +220,22 @@ function EID:printDescription(desc)
end
EID.IconSprite:Play(EID.ItemTypeAnm2Names[itemType])
EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"])
if itemType == 3 then -- Display Charge
EID.IconSprite:Play(EID.itemConfig:GetCollectible(desc.ID).MaxCharges)
EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"])
offsetX = offsetX + 11
elseif itemType == 4 then -- familiar
if itemType == 3 then
-- Display Charge
offsetX = offsetX + 1
local curItemConfig = EID.itemConfig:GetCollectible(desc.ID)
if REPENTANCE and curItemConfig.ChargeType == ItemConfig.CHARGE_TIMED then
EID.InlineIconSprite2:SetFrame("pickups", 10) -- Timer Icon
elseif REPENTANCE and (curItemConfig.ChargeType == ItemConfig.CHARGE_SPECIAL or desc.ID == CollectibleType.COLLECTIBLE_BLANK_CARD or desc.ID == CollectibleType.COLLECTIBLE_PLACEBO or
desc.ID == CollectibleType.COLLECTIBLE_CLEAR_RUNE or desc.ID == CollectibleType.COLLECTIBLE_D_INFINITY) then
EID.InlineIconSprite2:SetFrame("numbers", 13)
else
EID.InlineIconSprite2:SetFrame("numbers", curItemConfig.MaxCharges)
end
EID:renderIcon(EID.InlineIconSprite2, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"])
offsetX = offsetX + 8
elseif itemType == 4 then
-- familiar
offsetX = offsetX + 8
end
if not EID.Config["ShowItemName"] then