Added feature to ignore specific entities from showing their EID descriptions
This commit is contained in:
1 parent
9f7cd75e2b
commit
a995f62296
3 files changed
+30
-1
No files matched your search
+24
-1
@@ -538,8 +538,12 @@ end
|
|||||||
-- check if an entity is part of the describable entities
|
-- check if an entity is part of the describable entities
|
||||||
function EID:hasDescription(entity)
|
function EID:hasDescription(entity)
|
||||||
local isAllowed = false
|
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
|
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 EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil
|
||||||
isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil)
|
isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil)
|
||||||
end
|
end
|
||||||
@@ -1373,6 +1377,7 @@ function EID:getPlayerID(entityPlayer)
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Get the current Language. Defaults to english if none is set.
|
||||||
function EID:getLanguage()
|
function EID:getLanguage()
|
||||||
local lang = EID.Config["Language"]
|
local lang = EID.Config["Language"]
|
||||||
if lang == "auto" then
|
if lang == "auto" then
|
||||||
@@ -1384,3 +1389,21 @@ end
|
|||||||
function EID:AddToCollectiblesToCheckList(itemID)
|
function EID:AddToCollectiblesToCheckList(itemID)
|
||||||
table.insert(EID.collectiblesToCheck, itemID)
|
table.insert(EID.collectiblesToCheck, itemID)
|
||||||
end
|
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
|
||||||
@@ -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
|
__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 ------
|
------ Test: adding custom icons ------
|
||||||
EID:addColor("ColorTwitterBlue", KColor(0, 0.671875, 0.9296875, 1), nil)
|
EID:addColor("ColorTwitterBlue", KColor(0, 0.671875, 0.9296875, 1), nil)
|
||||||
EID:addColor("ColorBlackBlink", nil, function(color)
|
EID:addColor("ColorBlackBlink", nil, function(color)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ EID.itemUnlockStates = {}
|
|||||||
EID.CraneItemType = {}
|
EID.CraneItemType = {}
|
||||||
EID.absorbedItems = {}
|
EID.absorbedItems = {}
|
||||||
EID.CollectedItems = {}
|
EID.CollectedItems = {}
|
||||||
|
EID.IgnoredEntities = {}
|
||||||
local pathsChecked = {}
|
local pathsChecked = {}
|
||||||
local altPathItemChecked = {}
|
local altPathItemChecked = {}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user