by AFADoomer » Fri Apr 23, 2021 9:05 pm
I think we have narrowed down the cause of this bug...
V_BreakLines does not account for colors that are defined after the space that ends up being use to split the string into lines once the max width is hit...
So something nonsensical like this:
SetHudSize(640, 400, 1);
SetHUDWrapWidth(150);
HudMessage(s:"\cCThis is a test string\cR!!!!!!!!"; 0, 1, CR_UNTRANSLATED, 100.0, 100.0, 0, 1.0);
...would end up split between 'test' and 'string', but because the "\cR" would have already been parsed before the max width was hit (but after the last whitespace was set), the next line would start out colored dark red (R), despite still being supposed to be gray (C).
Simple map with this script included is attached.
- Attachments
-
MAP01.wad
- (1.91 KiB) Downloaded 49 times
I think we have narrowed down the cause of this bug...
V_BreakLines does not account for colors that are defined after the space that ends up being use to split the string into lines once the max width is hit...
So something nonsensical like this:
SetHudSize(640, 400, 1);
SetHUDWrapWidth(150);
HudMessage(s:"\cCThis is a test string\cR!!!!!!!!"; 0, 1, CR_UNTRANSLATED, 100.0, 100.0, 0, 1.0);
...would end up split between 'test' and 'string', but because the "\cR" would have already been parsed before the max width was hit (but after the last whitespace was set), the next line would start out colored dark red (R), despite still being supposed to be gray (C).
Simple map with this script included is attached.