Added feature to add descriptions using "GetData()"
This commit is contained in:
1 parent
6082f1e818
commit
eb3b4182a2
3 files changed
+31
-6
No files matched your search
+1
-1
@@ -352,7 +352,7 @@ function EID:hasDescription(entity)
|
||||
local isAllowed = false
|
||||
if EID.Config["EnableEntityDescriptions"] then
|
||||
isAllowed = __eidEntityDescriptions[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
|
||||
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EID.Config["DisplayItemInfo"])
|
||||
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EID.Config["DisplayTrinketInfo"])
|
||||
|
||||
+17
-1
@@ -78,7 +78,7 @@ EID.InlineIcons["Test"] = {"pickups", -1, 9, 9, -1, 0, dummySprite3}
|
||||
--EID.InlineIcons["Card58"] = {"pickups", -1, 9, 9, -1, 0, dummySprite3}
|
||||
|
||||
|
||||
__eidItemDescriptions[2] = "{{Bomb}} Emote {{Key}} Test {{Test}}{{TestIcon}} {{ColorBlackBlink}}description {{SomeInvalidInnerStuff}} cool" -- 5.100.2 = Inner Eye
|
||||
__eidItemDescriptions[3] = "{{Bomb}} Emote {{Key}} Test {{Test}}{{TestIcon}} {{ColorBlackBlink}}description {{SomeInvalidInnerStuff}} cool" -- 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
|
||||
|
||||
|
||||
@@ -99,6 +99,22 @@ EID:addColor("ColorBlackBlink", nil, function(color)
|
||||
|
||||
|
||||
local function onDebugRender(t)
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,2,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
v:GetData()["EID_Description"] = "Test specific description#Init seed: ".. v.InitSeed
|
||||
end
|
||||
end
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,3,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
local descTable = {
|
||||
["Name"] = "Some Item with seed ".. v.InitSeed ,
|
||||
["Description"] = "Test specific description#Init seed: ".. v.InitSeed,
|
||||
["Transformation"] = "1,2"
|
||||
}
|
||||
v:GetData()["EID_Description"] = descTable
|
||||
end
|
||||
end
|
||||
|
||||
for i, v in ipairs(charsToDebug) do
|
||||
local pos = EID.getTextPosition() + Vector(0, - 15 + ((i - 1) * 14))
|
||||
EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0))
|
||||
|
||||
@@ -348,12 +348,21 @@ local function onRender(t)
|
||||
--Handle Indicators
|
||||
EID:renderIndicator(closest)
|
||||
|
||||
--Handle Entities (specific)
|
||||
--[[ if EID.Config["EnableEntityDescriptions"] and type(closest:GetData()["EID_Description"]) ~= type(nil) then
|
||||
printTrinketDescription({closest.Type, closest:GetData()["EID_Description"]}, "custom")
|
||||
--Handle GetData Entities (specific)
|
||||
if EID.Config["EnableEntityDescriptions"] and type(closest:GetData()["EID_Description"]) ~= type(nil) then
|
||||
local desc = closest:GetData()["EID_Description"]
|
||||
local origDesc = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)
|
||||
if type(desc) == "table" then
|
||||
origDesc.Description = desc.Description
|
||||
origDesc.Name = desc.Name
|
||||
origDesc.Transformation = desc.Transformation
|
||||
else
|
||||
origDesc.Description = desc
|
||||
end
|
||||
EID:printDescription(origDesc)
|
||||
return
|
||||
end
|
||||
]]
|
||||
|
||||
if closest.Variant == PickupVariant.PICKUP_TRINKET then
|
||||
--Handle Trinkets
|
||||
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType))
|
||||
|
||||
Reference in new issue
Block a user