From d9ade75c00dbe8ccf37ae40078697acb8466ff0b Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 15 Jan 2022 20:09:08 +0100 Subject: [PATCH] Fixed Color Reset Markup not working correctly when a linebreak is inbetween a color definition and the Color Reset markup --- descriptions/rep/en_us.lua | 8 ++++---- descriptions/rep/ko_kr.lua | 18 +++++++++--------- eid_api.lua | 1 - eid_modifiers.lua | 2 +- main.lua | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index ccc5aa13..e5a558c9 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -971,12 +971,12 @@ EID.descriptions[languageCode].GlitchedItemText = { [0] = "Damage", "Fire Rate", "Shot Speed", "Range", "Speed", "Tear Effects", "Tear Color", "Flight", "Attack Type", "Familiars", "Luck", "Size", "Color", "Chest Contents", [16] = "All Stats", -- Attribute triggers - chain = "{{ColorCyan}}Then:{{ColorText}} ", + chain = "{{ColorCyan}}Then:{{CR}} ", active = "{{ColorCyan}}On use:#", pickup_collected = "{{ColorCyan}}When you collect a pickup:#", --chance to? enemy_kill = "{{ColorCyan}}On kill, chance to:#", damage_taken = "{{ColorCyan}}When you take damage:#", --chance to? - entity_spawned = "When a {{ColorCyan}}{T1}{{ColorText}} is spawned:#", + entity_spawned = "When a {{ColorCyan}}{T1}{{CR}} is spawned:#", tear_fire = "{{ColorCyan}}When you fire a tear, chance to:#", enemy_hit = "{{ColorCyan}}On hitting an enemy, chance to:#", room_clear = "{{ColorCyan}}On room clear:#", --chance to? @@ -984,9 +984,9 @@ EID.descriptions[languageCode].GlitchedItemText = { -- Attribute effects area_damage = "Deal {1} damage in an area around you", add_temporary_effect = "Gain {1} for the room", - convert_entities = "Convert all {{ColorGray}}{1}{{ColorText}} in the room to {{ColorGray}}{2}{{ColorText}}", + convert_entities = "Convert all {{ColorGray}}{1}{{CR}} in the room to {{ColorGray}}{2}{{CR}}", use_active_item = "Use {1}", - spawn_entity = "Spawn a {{ColorGray}}{1}{{ColorText}}", + spawn_entity = "Spawn a {{ColorGray}}{1}{{CR}}", fart = "Fart with size {1}", -- Generic entity names not obtained from entities2.xml diff --git a/descriptions/rep/ko_kr.lua b/descriptions/rep/ko_kr.lua index 02eb6a5d..582db09b 100644 --- a/descriptions/rep/ko_kr.lua +++ b/descriptions/rep/ko_kr.lua @@ -72,7 +72,7 @@ local repCollectibles={ [173] = {"173", "주교관", "빨간하트가 드랍될 때 33% 확률로 소울하트로 바뀝니다."}, -- Mitre [175] = {"175", "아빠의 열쇠", "사용 시 방 안의 닫혀있는 문을 모두 엽니다.#!!! 일부 특수 방은 열리지 않습니다."}, -- Dad's Key [176] = {"176", "줄기세포", "↑ 최대 체력 +1#↑ 빨간하트 +1#↑ {{Shotspeed}}탄속 +0.16"}, -- Stem Cells - [178] = {"178", "성수", "{{Throwable}} {{ColorOrange}}투척형{{ColorText}}#공격하는 방향으로 날아가며 적에게 접촉 시 부서집니다.#파괴 시 파란 장판이 생성되며 장판에 닿은 적은 석화 상태가 되고 초당 28의 피해를 입습니다."}, -- Holy Water + [178] = {"178", "성수", "{{Throwable}} {{ColorOrange}}투척형{{CR}}#공격하는 방향으로 날아가며 적에게 접촉 시 부서집니다.#파괴 시 파란 장판이 생성되며 장판에 닿은 적은 석화 상태가 되고 초당 28의 피해를 입습니다."}, -- Holy Water [181] = {"181", "하얀 조랑말", "소지중일 때 비행 능력을 얻습니다.# {{Speed}}이동속도가 1.5 이상으로 고정됩니다.#사용 시 바라보는 방향으로 돌진하여 접촉한 적에게 공격력 x4 +28의 피해를 입히고 지나간 길에 빛줄기를 소환합니다."}, -- White Pony [182] = {"182", "성스러운 심장", "↑ 최대 체력 +1#체력을 모두 회복합니다.#↑ {{Damage}}공격력 +1#↑ {{Damage}}공격력 배율 x2.3#↓ {{Tears}}연사 -0.4#↑ {{Range}}사거리 +0.5#↓ {{Shotspeed}}탄속 -0.25#공격에 유도 효과가 생깁니다.#폭탄에 유도 효과가 생깁니다."}, -- Sacred Heart [184] = {"184", "신성한 성배", "↑ 최대 체력 +1#↑ 빨간하트 +1#비행 능력을 얻습니다."}, -- Holy Grail @@ -108,7 +108,7 @@ local repCollectibles={ [262] = {"262", "찢어진 페이지 2", "↑ 블랙하트 +1#피격 시 체력이 1칸 이하일 때 방 안의 모든 적에게 80의 피해를 줍니다.#↑ 블랙하트와 {{Collectible35}}Necronomicon, {{Card14}}The Death의 공격력 +40"}, -- Missing Page 2 [263] = {"263", "투명한 룬", "룬을 하나 드랍합니다.#사용 시 소지중인 룬의 효과를 발동합니다.#룬에 따라서 충전량이 달라집니다."}, -- Clear Rune [272] = {"272", "베프", "대각선으로 돌아다니며 적에게 접촉 시 폭발하여 100의 피해를 입힙니다."}, -- BBF - [273] = {"273", "밥의 뇌", "{{Throwable}} {{ColorOrange}}투척형{{ColorText}}#공격하는 방향으로 날아가며 적에게 접촉 시 폭발하여 100의 방어 무시 피해를 입힙니다."}, -- Bob's Brain + [273] = {"273", "밥의 뇌", "{{Throwable}} {{ColorOrange}}투척형{{CR}}#공격하는 방향으로 날아가며 적에게 접촉 시 폭발하여 100의 방어 무시 피해를 입힙니다."}, -- Bob's Brain [274] = {"274", "최고의 짝꿍", "피격 시 캐릭터 주위를 돌며 접촉하는 적에게 초당 150의 피해를 줍니다."}, -- Best Bud [275] = {"275", "꼬마 유황", "공격하는 방향으로 최대 공격력 20의 혈사포를 충전하여 발사합니다."}, -- Lil Brimstone [276] = {"276", "아이작의 심장", "캐릭터를 따라다니며 캐릭터가 무적이 되고 심장이 피격당할 시 캐릭터가 피해를 입습니다.#공격키를 누르면 움직이지 않으며 공격키를 떼면 주변의 적을 밀쳐냅니다."}, -- Isaac's Heart @@ -339,7 +339,7 @@ local repCollectibles={ [664] = {"664", "폭식가", "↑ 최대 체력 +1#모든 아이템이 음식(체력 증가) 아이템과 1초마다 전환되며 두 아이템 중 하나를 선택할 수 있습니다.#음식 아이템 획득 시 30초간 {{Damage}}공격력이 +3.6 증가하며 영구적으로 {{Speed}}이동속도가 -0.03 감소하고 특정한 능력치 2개가 증가합니다."}, -- Binge Eater [665] = {"665", "구피의 눈", "상자와 자루 픽업, 장애물의 내용물을 볼 수 있습니다."}, -- Guppy's Eye [666] = {"666", "", ""}, -- - [667] = {"667", "밀짚인형", "동전 체력 3개를 가진 Keeper 캐릭터가 2p 플레이어로 소환됩니다.#Keeper가 소환되어 있는 동안 체력 거래가 동전 거래로 바뀝니다.#!!! Keeper 캐릭터도 아이템을 획득할 수 있으며 사망 시 획득한 아이템({{ColorRed}}루트 진행 아이템 포함{{ColorText}})이 영구적으로 사라집니다."}, -- Strawman + [667] = {"667", "밀짚인형", "동전 체력 3개를 가진 Keeper 캐릭터가 2p 플레이어로 소환됩니다.#Keeper가 소환되어 있는 동안 체력 거래가 동전 거래로 바뀝니다.#!!! Keeper 캐릭터도 아이템을 획득할 수 있으며 사망 시 획득한 아이템({{ColorRed}}루트 진행 아이템 포함{{CR}})이 영구적으로 사라집니다."}, -- Strawman [668] = {"668", "아빠의 쪽지", "!!! 획득 시 역행을 위한 스테이지 재시작#재시작한 이후 스테이지의 특수 방은 {{BossRoom}}보스방과 {{TreasureRoom}}보물방으로만 이루어져 있으며 획득 이전에 해당 방에서 버린 장신구는 전부 {{Card78}}깨진 열쇠로 바뀝니다.#!!! 깨진 열쇠는 붉은 열쇠 해금 이후에만 바뀝니다."}, -- Dad's Note [669] = {"669", "소세지", "↑ 최대 체력 +1#체력을 모두 회복합니다.#↑ {{Damage}}공격력 +0.5#↑ {{Tears}}연사 +0.5#↑ {{Range}}사거리 +1.5#↑ {{Speed}}이동속도 +0.2#↑ {{Shotspeed}}탄속 +0.2#↑ {{Luck}}행운 +1#↑ {{DevilChance}}악마방 확률 +6.9%#↑ {{PlanetariumChance}}첫 천체방 확률 +6.9%"}, -- Sausage [670] = {"670", "선택권?", "방 클리어 보상 아이템이 2개가 나오며 하나를 선택하면 나머지는 사라집니다."}, -- Options? @@ -607,7 +607,7 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { [480] = "흡수한 픽업 아이템 갯수만큼의 체력을 가진 불꽃을 소환합니다.", -- Compost [481] = "확률적으로 적을 랜덤한 효과의 불꽃으로 바꾸는 불꽃을 소환합니다.", -- Dataminer [482] = "랜덤한 효과의 불꽃을 소환합니다.", -- Clicker - [483] = "꺼지면 {{ColorGold}}황금 트롤 폭탄{{ColorText}}을 드랍하는 불꽃을 8마리 소환합니다.", -- Mama Mega! + [483] = "꺼지면 {{ColorGold}}황금 트롤 폭탄{{CR}}을 드랍하는 불꽃을 8마리 소환합니다.", -- Mama Mega! [484] = "방 이동 시 사라지며 꺼지면 {{Collectible484}}주위에 충격파를 일으키는 불꽃을 소환합니다.", -- Wait What? [485] = "꺼지면 50% 확률로 소환되어 있는 불꽃을 2배로 복사하거나 모두 없애는 불꽃을 소환합니다.", -- Crooked Penny [486] = "눈물을 발사하지 않는 불꽃을 소환합니다.", -- Dull Razor @@ -807,9 +807,9 @@ EID.descriptions[languageCode].goldenTrinketEffects = { [46] = { "반칸", "한칸", "한칸 반" }, -- Tick (replace): A full replacement for Golden / Mom's Box / Both, as the Golden version can be removed and only one effect is tripled [53] = { - "방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{ColorText}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}두칸{{ColorText}} 회복합니다.", - "!!! 교체불가#방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{ColorText}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}두칸{{ColorText}} 회복합니다.", - "방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{ColorText}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}세칸{{ColorText}} 회복합니다.", + "방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{CR}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}두칸{{CR}} 회복합니다.", + "!!! 교체불가#방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{CR}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}두칸{{CR}} 회복합니다.", + "방 입장 시 체력이 60 이상인 적의 체력을 {{ColorGold}}30%{{CR}} 깎습니다.#보스방 입장 시 체력을 {{ColorGold}}세칸{{CR}} 회복합니다.", }, -- Rainbow Worm (append): With Mom's Box, it gives 2 copies of the temp worm, and doubles 1 of those copies, for triple effect [64] = { "일부 벌레 장신구의 능력치 증가 효과 2배", "일부 벌레 장신구의 능력치 증가 효과 3배", "일부 벌레 장신구의 능력치 증가 효과 4배", }, @@ -995,12 +995,12 @@ EID.descriptions[languageCode].horsepills={ ---------- Misc, Text local repDiceEffects = { - [1] = {"1", "1번", "{{Collectible284}} {{ColorCyan}}주사위를 발동시킨 플레이어{{ColorText}}의 소지중인 아이템 변경"}, + [1] = {"1", "1번", "{{Collectible284}} {{ColorCyan}}주사위를 발동시킨 플레이어{{CR}}의 소지중인 아이템 변경"}, [2] = {"2", "2번", "{{Collectible166}} 방 안의 모든 픽업 아이템 변경"}, [3] = {"3", "3번", "{{Collectible166}} 스테이지 안의 모든 픽업 아이템 변경"}, [4] = {"4", "4번", "{{Collectible105}} 스테이지 안의 모든 아이템 변경"}, [5] = {"5", "5번", "{{Collectible127}} 스테이지 재시작"}, - [6] = {"6", "6번", "{{Collectible283}} 스테이지 안의 아이템, 픽업 아이템, {{ColorCyan}}모든 플레이어{{ColorText}}의 소지중인 아이템 변경"}, + [6] = {"6", "6번", "{{Collectible283}} 스테이지 안의 아이템, 픽업 아이템, {{ColorCyan}}모든 플레이어{{CR}}의 소지중인 아이템 변경"}, } EID:updateDescriptionsViaTable(repDiceEffects, EID.descriptions[languageCode].dice) diff --git a/eid_api.lua b/eid_api.lua index 74fa2373..ca1f5d53 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -732,7 +732,6 @@ end -- Returns the last used KColor function EID:renderString(str, position, scale, kcolor) str = EID:replaceShortMarkupStrings(str) - EID.LastRenderCallColor = EID:copyKColor(kcolor) -- Save last Color for eventual Color Reset call local textPartsTable = EID:filterColorMarkup(str, kcolor) local offsetX = 0 for i, textPart in ipairs(textPartsTable) do diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 548bf009..3fb63c34 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -221,7 +221,7 @@ local game = Game() if multiplier == 2 then v = 16.5 elseif multiplier == 3 then v = (1/6)*100 end -- convert 17% to 33% or 50% elseif v == 33 and (multiplier == 1.5 or multiplier == 3) then v = (1/3)*100 end -- convert 33% to 50% or 100% - return "{{ColorGold}}" .. string.format("%.4g",v*multiplier) .. "{{ColorText}}" + return "{{ColorGold}}" .. string.format("%.4g",v*multiplier) .. "{{CR}}" end end) end diff --git a/main.lua b/main.lua index 3168a9e3..af118b62 100644 --- a/main.lua +++ b/main.lua @@ -433,7 +433,6 @@ function EID:printBulletPoints(description, renderPos) local textboxWidth = tonumber(EID.Config["TextboxWidth"]) local textScale = Vector(EID.Scale, EID.Scale) description = EID:replaceShortMarkupStrings(description) - for line in string.gmatch(description, "([^#]+)") do local formatedLines = EID:fitTextToWidth(line, textboxWidth) local textColor = EID:getTextColor() @@ -447,6 +446,7 @@ function EID:printBulletPoints(description, renderPos) else textColor = EID:renderString(bpIcon, renderPos, textScale , textColor) end + EID.LastRenderCallColor = EID:copyKColor(textColor) -- Save line start Color for eventual Color Reset call end textColor = EID:renderString(lineToPrint, renderPos + Vector(12 * EID.Scale, 0), textScale, textColor) renderPos.Y = renderPos.Y + EID.lineHeight * EID.Scale