Add `str_utf8_offset_bytes_to_chars` and `str_utf8_offset_chars_to_bytes` functions to base system to convert between byte and UTF-8 character offsets in UTF-8 strings.
Previously, this was separately implemented in the textrender and in the lineinput helper.
These textrender functions are entirely replaced by the new functions:
- `ITextRender::SelectionToUTF8OffSets` (by `str_utf8_offset_chars_to_bytes`)
- `ITextRender::UTF8OffToDecodedOff` (by `str_utf8_offset_bytes_to_chars`)
- `ITextRender::DecodedOffToUTF8Off` (by `str_utf8_offset_chars_to_bytes`)
These lineinput helper functions are reimplemented using the new functions:
- `CLineInput::OffsetFromActualToDisplay` (uses `str_utf8_offset_bytes_to_chars`)
- `CLineInput::OffsetFromDisplayToActual` (uses `str_utf8_offset_chars_to_bytes`)
Register the `OnWindowResize` listener in the engine client instead of the game client and properly dispatch the event also to the editor, so text containers in the editor are cleared when the window is resized.
Closes#7018.
Fix text containers rendering broken text after the language is changed, as this cleared the glyph atlas without clearing the references to the glyph positions in the text containers. Now `OnWindowResize` is also called on language change to reset all text containers.
However, the glyph atlas is not cleared on normal window resize anymore, because this seems to be unnecessary.
In `LoadPlayerData` exactly the `LIMIT 1` clause was getting truncated from the query due to the buffer size being insufficient. Depending on the length of the table name prefix the query could have been truncated at any other position resulting in syntax errors.
In `ShowTeamTop5` the buffer size is increased because it could cause truncation with a longer than default table name prefix.
Using `/timecp` with a player name that has no time on the current map incorrectly cleared the player score/time causing it to not be shown in the scoreboard anymore.
Use different colors to highlight tuning parameters when using `dbg_tuning`:
- red: value changed globally
- blue: value changed only in current zone
- green: value changed globally but reset to default by tune zone
- grey: value unchanged globally and in current zone
In addition to this, with `dbg_tuning 1` the unchanged parameters and the velramp graphs are not shown anymore. With `dbg_tuning 2` all parameters and graphs are shown as it was previously the case with `dbg_tuning 1`.
The position of the debug information is adjusted so it overlaps less with the HUD. When many tuning parameters are shown, the parameters now wrap to another column instead of extending beyond the height of the screen.
Headers are also added to each column.
Also show current tune zone.
Show value on every line instead of having some lines without a value.
Improve labels.
Reduce duplicate code and improve readability.
Saves were deleted without the team getting its state when /load and
/save both happened during mysql server not reachable.
Before this fix, the saves were only in the DDNet log output for
recovery, not in any database anymore.
`Write::BACKUP_FIRST` is 0 so always false, so the previous code
didn't harm other code paths (especially `Write::NORMAL`).
The saves were tried to retrieve two times from the database, therefore
at the second time it didn't exist anymore. One time erroneously in
`Write::BACKUP_FIRST` and the second time in `Write::NORMAL_FAILED`.
Fixes#6924
The server does not allow adding more than `MAX_VOTE_OPTIONS` vote options, so the client will now also refuse to add more options than that.
Supersedes #6930.