From fdfc6d391e13a1de19e21055de328f1e4f7aaf67 Mon Sep 17 00:00:00 2001 From: lzrdblzzrd Date: Tue, 22 Sep 2026 15:00:20 +0300 Subject: [PATCH] fix: always show synergy partner name, strip duplicated lead --- features/eid_synergies.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/features/eid_synergies.lua b/features/eid_synergies.lua index 8f6faa9d..5651fbdf 100644 --- a/features/eid_synergies.lua +++ b/features/eid_synergies.lua @@ -39,6 +39,16 @@ local function synergyCondition(desc) return false end +-- Removes leading "«Name»" chunks naming this very partner, so the line +-- does not read "Ladder: «Ladder» / ...". Leads naming other partners stay. +local function stripOwnNameLead(text, name) + local lead = "«" .. name .. "»" + while text:sub(1, #lead) == lead do + text = text:sub(#lead + 1):match("^%s*[/:—,–-]?%s*(.-)%s*$") + end + return text +end + local function synergyCallback(desc) local list = synergyTableFor(desc) if not list then return desc end @@ -58,9 +68,11 @@ local function synergyCallback(desc) -- (printBulletPoints advances one lineHeight per #-segment unconditionally) desc.Description = desc.Description .. "#{{Blank}} #{{Blank}} Синергии:" for i = 1, math.min(#lines, MAX_SYNERGY_LINES) do - -- NOTE: {{CollectibleID}} already renders the item's icon AND its name, - -- so no explicit name is added here - desc.Description = desc.Description .. "#{{Collectible" .. lines[i].partner .. "}}: " .. lines[i].text + -- NOTE: {{CollectibleID}} renders only the icon; the name is NOT + -- auto-appended by the engine, so prepend the official item name here + local partnerName = EID:getObjectName(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, lines[i].partner) + local body = stripOwnNameLead(lines[i].text, partnerName) + desc.Description = desc.Description .. "#{{Collectible" .. lines[i].partner .. "}} " .. partnerName .. ": " .. body end if #lines > MAX_SYNERGY_LINES then desc.Description = desc.Description .. "#…и ещё синергий: " .. (#lines - MAX_SYNERGY_LINES)