diff --git a/eid_api.lua b/eid_api.lua index 161ccd7c..92797b52 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -97,20 +97,20 @@ function EID:getLastDescribedEntity() return lastDescriptionEntity end --- returns descriptions from the legacy mod descriptions +-- returns descriptions from the legacy mod descriptions if they exist function EID:getLegacyModDescription(objTable, id) if objTable == "collectibles" then - return (__eidItemDescriptions) and (__eidItemDescriptions[id]) + return __eidItemDescriptions[id] elseif objTable == "trinkets" then - return (__eidTrinketDescriptions) and (__eidTrinketDescriptions[id]) + return __eidTrinketDescriptions[id] elseif objTable == "cards" then - return (__eidCardDescriptions) and (__eidCardDescriptions[id]) + return __eidCardDescriptions[id] elseif objTable == "pills" then - return (__eidPillDescriptions) and (__eidPillDescriptions[id]) + return __eidPillDescriptions[id] elseif objTable == "transformation" then - return (__eidItemTransformations) and (__eidItemTransformations[id]) + return __eidItemTransformations[id] elseif objTable == "custom" then - return (__eidEntityDescriptions) and (__eidEntityDescriptions[id][2]) + return __eidEntityDescriptions[id] and __eidEntityDescriptions[id][2] end end @@ -195,8 +195,8 @@ end function EID:hasDescription(entity) local isAllowed = false if EIDConfig["EnableEntityDescriptions"] then - isAllowed = - isAllowed or (__eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil) --[[or type(entity:GetData()["EID_Description"]) ~= type(nil)]] + isAllowed = __eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil + --isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil) end isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EIDConfig["DisplayItemInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"]) diff --git a/main.lua b/main.lua index b469bcbc..7a4c3b2a 100644 --- a/main.lua +++ b/main.lua @@ -323,8 +323,11 @@ local function onRender(t) end ]]-- --Handle Entities (omni) - if EIDConfig["EnableEntityDescriptions"] then - printDescription(EID:getDescriptionObj("custom", closest.Type .. "." .. closest.Variant .. "." .. closest.SubType)) + local objIDString = closest.Type .. "." .. closest.Variant .. "." .. closest.SubType + local tableEntry = EID.descriptions[EIDConfig["Language"]]["custom"][objIDString] + or EID.descriptions["en_us"]["custom"][objIDString] or EID:getLegacyModDescription("custom", objIDString) or nil + if EIDConfig["EnableEntityDescriptions"] and tableEntry~=nil then + printDescription(EID:getDescriptionObj("custom", objIDString)) return end