Added Name-Markup. Example: {{NameC3}} -> Spoon Bender

This commit is contained in:
Wofsauge committed 2022-08-31 22:55:13 +02:00
1 parent 01706097d9
commit b60439bddc
3 files changed
+29 -1

No files matched your search

+27
View File
@@ -627,6 +627,33 @@ function EID:replaceShortMarkupStrings(text)
return text
end
-- Replaces name markup objects with the actual name
function EID:replaceNameMarkupStrings(text)
for word in string.gmatch(text, "{{Name.-}}") do
local strTrimmed = string.gsub(word, "{{Name(.-)}}", function(a) return a end)
local indicator = string.sub(strTrimmed, 1, 1)
local id = tonumber(string.sub(strTrimmed, 2, -1))
local name = ""
if tonumber(indicator) then
local entityID = {}
for e in string.gmatch(strTrimmed, "([^.]*)") do
table.insert(entityID, tonumber(e))
end
name = EID:getObjectName(entityID[1], entityID[2], entityID[3])
elseif indicator == "C" then -- Collectible
name = EID:getObjectName(5, 100, id)
elseif indicator == "T" then -- Trinket
name = EID:getObjectName(5, 350, id)
elseif indicator == "P" then -- Pills
name = EID:getObjectName(5, 70, id)
elseif indicator == "K" then -- Card
name = EID:getObjectName(5, 300, id)
end
text = string.gsub(text, word, name, 1)
end
return text
end
-- Generates a string with the defined pixel-length using a custom 1px wide character
-- This will only work for this specific custom font
function EID:generatePlaceholderString(length)
+1 -1
View File
@@ -161,7 +161,7 @@ EID.InlineIcons["Test"] = {"pickups", -1, 9, 9, -1, 0, dummySprite3}
__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
__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}}#And some names {{NameC3}} {{NameT23}} {{Name5.100.231}}" -- 5.100.2 = Inner Eye
EID:addIgnoredEntity(5,100,10) -- Ignore "Halo of flies" collectible entity
+1
View File
@@ -711,6 +711,7 @@ end
function EID:printBulletPoints(description, renderPos)
local textboxWidth = tonumber(EID.Config["TextboxWidth"])
local textScale = Vector(EID.Scale, EID.Scale)
description = EID:replaceNameMarkupStrings(description)
description = EID:replaceShortMarkupStrings(description)
description = EID:replaceMarkupSize(description)
for line in string.gmatch(description, "([^#]+)") do