Commit 9a0b1d5
Fix chat message length calculation with colorCoded enabled (#4370)
* Fix chat message length calculation with colorCoded enabled
When colorCoded = true, the chat message length calculation was incorrectly counting hex color codes as part of the text.
This caused the message width to be miscalculated, so some texts did not fit properly in the chat box.
This PR updates the logic to ignore hex color codes during length calculation, ensuring that only visible characters are counted.
Result
Chat messages now display correctly without being cut off.
Length is calculated only from visible text, not formatting codes.
* Update CStaticFunctionDefinitions.cpp
comments deleted.
* Update CStaticFunctionDefinitions.cpp
done.
* Update CStaticFunctionDefinitions.cpp
* Update CStaticFunctionDefinitions.cpp
* Update CStaticFunctionDefinitions.cpp
done
---------
Co-authored-by: Shady1 <[email protected]>1 parent 4d4d6c9 commit 9a0b1d5
File tree
2 files changed
+21
-14
lines changed- Client/mods/deathmatch/logic
2 files changed
+21
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1412 | 1412 | | |
1413 | 1413 | | |
1414 | 1414 | | |
1415 | | - | |
| 1415 | + | |
| 1416 | + | |
1416 | 1417 | | |
1417 | 1418 | | |
1418 | 1419 | | |
| |||
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
| 283 | + | |
278 | 284 | | |
279 | 285 | | |
280 | 286 | | |
| |||
0 commit comments