ddnet-insta / ddnet-insta

A teeworlds instagib (grenade/laser capture the flag/death match/catch) mod based on DDRaceNetwork (gctf/ictf/idm/gdm/zcatch)
https://ddnet.org
Other
7 stars 3 forks source link

unstack chat breaks name highlight #139

Closed ChillerDragon closed 1 month ago

ChillerDragon commented 1 month ago

The ddnet client requires a space before the hilite match or it has to be the beginning of the line. So putting a unicode character without space in front breaks the highlight.

Putting the unicode at the end breaks the unstack feature.

Prefixing the name with a space would make it visible to the user that there is some offset.

Relevant client code:

https://github.com/ddnet/ddnet/blob/b34edb64c0a20373214bdc28d666ba445f43263d/src/game/client/components/chat.cpp#L559

The nicest for the user but CPU expensive for the server solution i see is the following: If the prefix symbol is not empty (yes sometimes its none) and the message starts with a string that is a name of a connected player then also insert a space after the unicode character.

ChillerDragon commented 1 month ago

It now looks like this. And always pings. But there is a visible space if it starts with a player name.

2024-09-22 14:05:01 I chat: 1:-2:foo,bar: x
2024-09-22 14:05:06 I chat: 1:-2:foo,bar: x ChillerDragon
2024-09-22 14:05:08 I chat: 1:-2:foo,bar: ChillerDragon x
2024-09-22 14:05:09 I chat: 1:-2:foo,bar: ‎ ChillerDragon x
2024-09-22 14:05:11 I chat: 1:-2:foo,bar: ⁠ ChillerDragon x
2024-09-22 14:05:13 I chat: *** 'foo,bar' has been muted for 60 seconds

image