From 711667e8c16b1119f864037c67eb984cd66db1a6 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Fri, 30 Jul 2021 00:09:45 +0200 Subject: [PATCH] Fixed Horsepill descriptions and icon not working --- eid_api.lua | 2 +- main.lua | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 83634fa8..d1a6aa26 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -355,7 +355,7 @@ function EID:getDescriptionData(Type, Variant, SubType) local fullString = Type.."."..Variant local adjustedID = EID:getAdjustedSubtype(Type, Variant, SubType) local moddedDesc = EID:getDescriptionEntry("custom", fullString.."."..adjustedID) - local tableName = EID:getTableName(Type, Variant, adjustedID) + local tableName = EID:getTableName(Type, Variant, SubType) local legacyModdedDescription = EID:getLegacyModDescription(Type, Variant, adjustedID) local defaultDesc = EID:getDescriptionEntry(tableName, adjustedID) diff --git a/main.lua b/main.lua index 16bf6a8d..970a91ee 100644 --- a/main.lua +++ b/main.lua @@ -228,6 +228,7 @@ function EID:printDescription(desc) local offsetX = 0 if EID.Config["ShowItemIcon"] then local iconType = nil + local subType = desc.ObjSubType if desc.ObjType == 5 then if desc.ObjVariant == 100 then iconType = "Collectible" @@ -237,12 +238,15 @@ function EID:printDescription(desc) iconType = "Card" elseif desc.ObjVariant == 70 then iconType = "Pill" + if subType >= 2049 then + subType = subType - 2048 + end end end if iconType ~= nil then offsetX = offsetX + 14 EID:renderString( - "{{" .. iconType .. desc.ObjSubType .. "}}", + "{{" .. iconType .. subType .. "}}", renderPos + (Vector(-3, -4) * EID.Config["Scale"]), textScale, EID:getNameColor() @@ -699,6 +703,9 @@ local function onRender(t) local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor) EID:printDescription(descEntry) else + if pillColor >= 2049 then + pillColor = pillColor - 2048 + end EID:renderString( "{{Pill"..pillColor.."}} "..EID:getDescriptionEntry("unidentifiedPill"), EID:getTextPosition(),