diff --git a/eid_api.lua b/eid_api.lua index d7a81a5f..b9a43fb4 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -538,8 +538,12 @@ end -- check if an entity is part of the describable entities function EID:hasDescription(entity) local isAllowed = false + local entityString = entity.Type .. "." .. entity.Variant .. "." .. entity.SubType + + if EID.IgnoredEntities[entity.Type .. "." .. entity.Variant] or EID.IgnoredEntities[entityString] then return false end + if EID.Config["EnableEntityDescriptions"] and EID:getTableName(entity.Type, entity.Variant, entity.SubType) == "custom" then - isAllowed = __eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil + isAllowed = __eidEntityDescriptions[entityString] ~= nil isAllowed = isAllowed or EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil) end @@ -1373,6 +1377,7 @@ function EID:getPlayerID(entityPlayer) return 0 end +-- Get the current Language. Defaults to english if none is set. function EID:getLanguage() local lang = EID.Config["Language"] if lang == "auto" then @@ -1384,3 +1389,21 @@ end function EID:AddToCollectiblesToCheckList(itemID) table.insert(EID.collectiblesToCheck, itemID) end + +-- Add a specific entity to be ignored by EID. Set entitySubType to -1 in order to ignore all entities with this type+variant combi +function EID:addIgnoredEntity(entityType, entityVariant, entitySubType) + if entitySubType == -1 then + EID.IgnoredEntities[entityType.."."..entityVariant] = true + else + EID.IgnoredEntities[entityType.."."..entityVariant.."."..entitySubType] = true + end +end + +-- Remove a specific entity from the ignored List of EID. +function EID:removeIgnoredEntity(entityType, entityVariant, entitySubType) + if entitySubType == -1 then + EID.IgnoredEntities[entityType.."."..entityVariant] = nil + else + EID.IgnoredEntities[entityType.."."..entityVariant.."."..entitySubType] = nil + end +end diff --git a/eid_debugging.lua b/eid_debugging.lua index 2ffeb752..daec8343 100644 --- a/eid_debugging.lua +++ b/eid_debugging.lua @@ -139,6 +139,11 @@ __eidItemDescriptions[3] = "{{Bomb}} Emote {{Key}} Test {{Test}}{{TestIcon}} {{C __eidItemDescriptions[6] = "This item as Inline Icon {{Collectible6}}#And here are others {{Collectible69}} {{Collectible16}} {{Collectible323}} {{Collectible345}} {{Collectible223}}#And some trinket sprites {{Trinket12}} {{Trinket22}} {{Trinket1}} {{Trinket55}} {{Trinket100}} {{Trinket123}}" -- 5.100.2 = Inner Eye +EID:addIgnoredEntity(5,100,10) +EID:addIgnoredEntity(5,100,11) + +EID:removeIgnoredEntity(5,100,10) + ------ Test: adding custom icons ------ EID:addColor("ColorTwitterBlue", KColor(0, 0.671875, 0.9296875, 1), nil) EID:addColor("ColorBlackBlink", nil, function(color) diff --git a/main.lua b/main.lua index 4c783d12..b55d3b88 100644 --- a/main.lua +++ b/main.lua @@ -30,6 +30,7 @@ EID.itemUnlockStates = {} EID.CraneItemType = {} EID.absorbedItems = {} EID.CollectedItems = {} +EID.IgnoredEntities = {} local pathsChecked = {} local altPathItemChecked = {}