mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 17:02:37 +01:00
-The chat box' parent window (the main toolbar, wtf?) doesn't care for the WE_ON_EDIT_TEXT_CANCEL event, so don't send one. This code looks like it was mindlessly copy&pasted from the query box -The initial string of the chat box is always the empty string, so don't jump through hoops to check if nothing was entered and simplify the code -The chat box has no visible window title, therefore remove the string -Calculate the maximum pixel width of the entered text in the chat box from the "text box"-widget instead of hardcoding an arbitrary - and wrong - number -The parent window of the chat box is always the main toolbar (?!), therefore don't pass this information as parameter -a buffer overflow of the chat box introduced in r1263. Don't tell the Textbuf an arbitrary number as size of the string buffer, but the real lengthof() it
51 KiB
51 KiB