Skip to content

Add player name display option#4643

Open
starnotes-xj wants to merge 10 commits into
danielkrupinski:masterfrom
starnotes-xj:master
Open

Add player name display option#4643
starnotes-xj wants to merge 10 commits into
danielkrupinski:masterfrom
starnotes-xj:master

Conversation

@starnotes-xj
Copy link
Copy Markdown

Summary

  • Add a player name panel for in-world player info.
  • Add configuration and UI options for player name display.
  • Update config compatibility tests and mocks for the new option.

Test plan

  • Not run; PR only includes the already committed local changes.

Generated with Claude Code

Copilot AI review requested due to automatic review settings May 18, 2026 05:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a configurable "Player Name" display to the Player Info In World feature, including the new config variable, UI dropdown, panel rendering, and version-bumped config compatibility tests.

Changes:

  • Introduces PlayerNameEnabled config variable, schema entry, and v11 config compatibility expectations.
  • Adds PlayerNamePanel/PlayerNamePanelParams rendering pipeline plus PlayerController::getName() accessor.
  • Wires up the new dropdown in the Panorama UI (CreateGUI.js / VisualsTab.h).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Source/CS2/Classes/Entities/CCSPlayerController.h Adds m_sSanitizedPlayerName schema alias.
Source/GameClient/Entities/PlayerController.h Adds getName() using offset from player color.
Source/Features/Visuals/PlayerInfoInWorld/PlayerNamePanel.h New panel updating label with player name.
Source/Features/Visuals/PlayerInfoInWorld/PlayerNamePanelParams.h Visual styling params for the name label.
Source/Features/Visuals/PlayerInfoInWorld/PlayerInfoInWorldPanelFactory.h Factory method to create the new label panel.
Source/Features/Visuals/PlayerInfoInWorld/PlayerInfoPanelTypes.h Registers PlayerNamePanel in panel tuple.
Source/Features/Visuals/PlayerInfoInWorld/PlayerInfoInWorldConfigVariables.h Adds PlayerNameEnabled config var.
Source/Config/ConfigVariableTypes.h Registers new variable in the type list.
Source/Config/ConfigSchema.h Adds JSON (de)serialization for PlayerName.
Source/UI/Panorama/VisualsTab.h Hooks up the new dropdown handler.
Source/UI/Panorama/CreateGUI.js Adds Player Name section to UI.
Tests/Configs/config_current.cfg Updates current config fixture with PlayerName.
Tests/FunctionalTests/Config/ConfigCompatibilityTests.cpp Adds v11 expectations layer.
Tests/Mocks/MockPlayerController.h Adds getName mock method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Source/GameClient/Entities/PlayerController.h Outdated
Comment thread Source/GameClient/Entities/PlayerController.h Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@starnotes-xj
Copy link
Copy Markdown
Author

@copilot apply changes based on the comments in this thread

starnotes-xj and others added 2 commits May 18, 2026 14:33
Use a dedicated player-name offset pattern so the name field no longer depends on the player color field layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Revert the incorrect sanitized-name pattern so the player name display uses the working offset path again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@starnotes-xj
Copy link
Copy Markdown
Author

starnotes-xj and others added 3 commits May 31, 2026 22:28
- 从PlayerInfoPanelTypes(脚部面板)中移除PlayerNamePanel
- 在InWorldPanels中添加单独的PlayerNamePanel池
- 修复面板创建问题:使用容器+标签子级模式,而不是仅使用标签
- 使用多级回退机制更新PlayerController::getName()方法
- 修复了OffsetToPlayerColor和UiItem3dPanel的过时Windows样式
- 添加build-release.ps1便捷构建脚本
@danielkrupinski
Copy link
Copy Markdown
Owner

danielkrupinski commented May 31, 2026

Recent commits are going in the wrong direction, so I will comment on 0dc0c82:

  • The text is hardly readable - you should change the font style, probably size and weight
  • Some player names differ from the scoreboard - e.g. bot names. Player names should be the same as on the scoreboard and killfeed.
  • Player name probably looks better when placed below player health
  • Option to change player name color (e.g. team color or health-based) should be added (unless it would affect text readability).

starnotes-xj and others added 2 commits June 1, 2026 14:00
- Improve readability: larger font, black weight, stronger shadow
- Prefer sanitized name to match scoreboard/killfeed (e.g. bot names)
- Render name below health via container child, reverting the
  independent world-space projection
- Add name color option (white / team color / health-based)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Pattern scan logging: write all not-found patterns with module name
  and index to %APPDATA%/OsirisCS2/pattern_scan.log before hooks
  initialization, preventing silent crash on null pointer dereference
- i18n: add Language config variable (enum class), translations for
  ~130 UI strings, language toggle button (EN/中文) in navbar,
  live label refresh via $.Osiris.registerTranslatable() / refreshLanguage()
- Config variables now support enum class types via existing code path
- Add /utf-8 MSVC flag for Chinese character support in source files

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@starnotes-xj
Copy link
Copy Markdown
Author

Thanks for the review! All the requested changes have been addressed:

  1. Font readability - Updated font style, size and weight for better readability
  2. Player name consistency - Player names now match the scoreboard and killfeed (including bot names)
  3. Name placement - Player name is now positioned below player health
  4. Name color options - Added configurable player name color modes: White, Team Color, and Health-based

Additionally, this update includes:

  • Pattern scan crash diagnostics - Logs all pattern scan failures with module name and index to %APPDATA%/OsirisCS2/pattern_scan.log before hooks initialization, making it easier to diagnose crashes caused by outdated signatures
  • Chinese/English i18n - Full UI translation support with a language toggle button (EN/中文) in the navbar, ~130 translated strings, and live label refresh on language switch. Language preference is persisted in config.

Let me know if there's anything else that needs adjustment!

@starnotes-xj
Copy link
Copy Markdown
Author

@danielkrupinski

Previously flushLogToFile() returned early when logWritePos == 0, so
no log file was created when all patterns were found successfully. Now
it always writes a summary line (OK or count of failures).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@starnotes-xj
Copy link
Copy Markdown
Author

@mdilai @ClaudiuHKS @Heyter

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.

3 participants