openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

ColoredString not properly parsing map name #312

Closed ezio416 closed 1 year ago

ezio416 commented 1 year ago

I've noticed in Grinding Stats I have map names with missing letters and wrong colors. Looking through the code, it is using the ColoredString method (https://openplanet.dev/docs/api/global/ColoredString). The problem may also lie in UI::Text (https://openplanet.dev/docs/api/UI/Text). It seems there are some edge cases not accounted for. I have a map named like so, with "Mag" being black, "Pipe" being white, and "1" being red:

$0Mag$gPipe $f301

In the plugin this shows as a blue "ag", then the rest is fine, so it's taking "$0M" as the first color code. The "$0" at the beginning really should have been "$000" to avoid things like this, but the game takes it and shows it properly, so plugins therefore also should. The ITB club tag also uses just "$0" for black which is how I learned it was possible. Trackmania.io displays both the map name and club tag correctly.

I have C# code here (https://github.com/ezio416/TMTracker/tree/main/Models, see StyledChar + StyledString) that handles it well, but I'm not sure how easy it would be to adapt it for Openplanet. Seeing as Trackmania.io works fine, I would imagine my code is altogether unnecessary.

codecat commented 1 year ago

In general these kinds of situations should be pretty rare, but you're right that they should be handled correctly.

codecat commented 1 year ago

This will be fixed in the next update, thank you!

image