Add player name display option#4643
Conversation
There was a problem hiding this comment.
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
PlayerNameEnabledconfig variable, schema entry, and v11 config compatibility expectations. - Adds
PlayerNamePanel/PlayerNamePanelParamsrendering pipeline plusPlayerController::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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
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>
- 从PlayerInfoPanelTypes(脚部面板)中移除PlayerNamePanel - 在InWorldPanels中添加单独的PlayerNamePanel池 - 修复面板创建问题:使用容器+标签子级模式,而不是仅使用标签 - 使用多级回退机制更新PlayerController::getName()方法 - 修复了OffsetToPlayerColor和UiItem3dPanel的过时Windows样式 - 添加build-release.ps1便捷构建脚本
|
Recent commits are going in the wrong direction, so I will comment on 0dc0c82:
|
- 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>
|
Thanks for the review! All the requested changes have been addressed:
Additionally, this update includes:
Let me know if there's anything else that needs adjustment! |
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>
Add isConnected() check to PlayerController to validate that a player's CCSPlayerController is still active on the server. In CS2, when a player disconnects, their controller entity can persist in the entity system for several frames, causing them to be incorrectly included in the spectator list. The fix ensures only connected players (m_iConnected != 0) are considered as valid spectators. Fixes bug where disconnected players remained in the spectator overlay.
Add bonePosition(), headPosition(), chestPosition(), stomachPosition() methods to PlayerPawn. Reads bone coordinates from CSkeletonInstance's BoneArray via: GameSceneNode (+0x330) → ModelState (+0x150) → BoneArray (+0x80) → CTransform[boneIndex] (stride 32). Also adds BoneIndex enum (Head=6, Neck=5, Chest=4, Stomach=2, Pelvis=0), PlayerConnectedState enum for spectator list fix, Hud::rootPanel() for SpectatorList panel attachment, and PanelHandle::getOrInit MSVC fix.
|
add |
Summary
Test plan
Generated with Claude Code