Fixed custom entity descriptions
This commit is contained in:
1 parent
996ae3cc9c
commit
20cdc63c29
2 files changed
+14
-11
No files matched your search
+9
-9
@@ -97,20 +97,20 @@ function EID:getLastDescribedEntity()
|
|||||||
return lastDescriptionEntity
|
return lastDescriptionEntity
|
||||||
end
|
end
|
||||||
|
|
||||||
-- returns descriptions from the legacy mod descriptions
|
-- returns descriptions from the legacy mod descriptions if they exist
|
||||||
function EID:getLegacyModDescription(objTable, id)
|
function EID:getLegacyModDescription(objTable, id)
|
||||||
if objTable == "collectibles" then
|
if objTable == "collectibles" then
|
||||||
return (__eidItemDescriptions) and (__eidItemDescriptions[id])
|
return __eidItemDescriptions[id]
|
||||||
elseif objTable == "trinkets" then
|
elseif objTable == "trinkets" then
|
||||||
return (__eidTrinketDescriptions) and (__eidTrinketDescriptions[id])
|
return __eidTrinketDescriptions[id]
|
||||||
elseif objTable == "cards" then
|
elseif objTable == "cards" then
|
||||||
return (__eidCardDescriptions) and (__eidCardDescriptions[id])
|
return __eidCardDescriptions[id]
|
||||||
elseif objTable == "pills" then
|
elseif objTable == "pills" then
|
||||||
return (__eidPillDescriptions) and (__eidPillDescriptions[id])
|
return __eidPillDescriptions[id]
|
||||||
elseif objTable == "transformation" then
|
elseif objTable == "transformation" then
|
||||||
return (__eidItemTransformations) and (__eidItemTransformations[id])
|
return __eidItemTransformations[id]
|
||||||
elseif objTable == "custom" then
|
elseif objTable == "custom" then
|
||||||
return (__eidEntityDescriptions) and (__eidEntityDescriptions[id][2])
|
return __eidEntityDescriptions[id] and __eidEntityDescriptions[id][2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -195,8 +195,8 @@ end
|
|||||||
function EID:hasDescription(entity)
|
function EID:hasDescription(entity)
|
||||||
local isAllowed = false
|
local isAllowed = false
|
||||||
if EIDConfig["EnableEntityDescriptions"] then
|
if EIDConfig["EnableEntityDescriptions"] then
|
||||||
isAllowed =
|
isAllowed = __eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil
|
||||||
isAllowed or (__eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil) --[[or type(entity:GetData()["EID_Description"]) ~= type(nil)]]
|
--isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil)
|
||||||
end
|
end
|
||||||
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EIDConfig["DisplayItemInfo"])
|
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EIDConfig["DisplayItemInfo"])
|
||||||
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"])
|
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"])
|
||||||
|
|||||||
@@ -323,8 +323,11 @@ local function onRender(t)
|
|||||||
end
|
end
|
||||||
]]--
|
]]--
|
||||||
--Handle Entities (omni)
|
--Handle Entities (omni)
|
||||||
if EIDConfig["EnableEntityDescriptions"] then
|
local objIDString = closest.Type .. "." .. closest.Variant .. "." .. closest.SubType
|
||||||
printDescription(EID:getDescriptionObj("custom", 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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user