Skip to content

Add player location to voice HUD for Condition Zero#298

Merged
a1batross merged 1 commit intoVelaron:mainfrom
Vladislav4KZ:czero-voicechat-locations
Mar 24, 2026
Merged

Add player location to voice HUD for Condition Zero#298
a1batross merged 1 commit intoVelaron:mainfrom
Vladislav4KZ:czero-voicechat-locations

Conversation

@Vladislav4KZ
Copy link
Contributor

Replaced a buggy sizeof(newLocation) calculation in CVoiceLabel::SetLocation with correct string length calculation using strlen() + 1 and copying via strcpy.
This prevents location names from being truncated to 4-8 characters.

Adjusted GetContentSize by replacing (m_playerName) + 8 with (m_buf) so the background box spans the full string (name + location), and removed the extra 8 pixels to reduce empty space on the right.

The official localization files use %ls (wchar_t).
Since regular strings (char*) are passed, the text would disappear due to a type mismatch.
As a result, code was added to replace %ls with %s, ensuring player and location names display correctly.

@Vladislav4KZ Vladislav4KZ force-pushed the czero-voicechat-locations branch 3 times, most recently from 0c6711d to 2d17c0e Compare March 24, 2026 07:51
@Vladislav4KZ Vladislav4KZ requested a review from a1batross March 24, 2026 07:54
@Vladislav4KZ Vladislav4KZ force-pushed the czero-voicechat-locations branch from 2d17c0e to a8e1f97 Compare March 24, 2026 09:46
@Vladislav4KZ
Copy link
Contributor Author

Replaced %ls replacement with a pattern that matches any case where there is a character between % and s, since older localizations may also use %hs.

@Vladislav4KZ Vladislav4KZ marked this pull request as draft March 24, 2026 11:26
@Vladislav4KZ Vladislav4KZ force-pushed the czero-voicechat-locations branch from a8e1f97 to cb00c0a Compare March 24, 2026 11:47
@Vladislav4KZ Vladislav4KZ marked this pull request as ready for review March 24, 2026 11:49
@a1batross a1batross merged commit 71bb037 into Velaron:main Mar 24, 2026
9 checks passed
@Vladislav4KZ Vladislav4KZ deleted the czero-voicechat-locations branch March 24, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants