Repository navigation
Conversation
- Only start the 30s layout retry cooldown on failure - Compare per-player Panorama state directly instead of building signature strings, and cache the last world-text message per player - Gate !hudstyle on entwatch/entwatch_hud, remove stale world-text entities once a player renders with Panorama - Don't write default HUD style/position/size back to preferences on load - Cap Panorama HUD position at 95% - Generate hud.xml/hud.css from templates (scripts/generate-panorama.py) - Replace compile-panorama.ps1 with a cross-platform Python script - Check in compiled Panorama resources and drop the CI Workshop Tools download - Revert whitespace-only churn in unrelated files Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagcvZZBfqEnBVSzXh88yb
Panorama still needs more testing on real servers and maps, and requires the packaged panorama resources on server and clients, so keep the existing world-text renderer as the default. Panorama stays opt-in via entwatch_hud_style 1 or !hudstyle new. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagcvZZBfqEnBVSzXh88yb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional Panorama (custom_hud_layout) renderer for the EntWatch item HUD
Summary
EntWatch's item HUD is currently drawn with a per-player
point_worldtextentity parented to the player's view. This PR adds a second renderer based on a
single shared
custom_hud_layout(Panorama) entity, and moves the HUD codebehind a small renderer-independent interface so both can coexist.
World text stays the default. Panorama is opt-in per server
(
entwatch_hud_style 1) or per player (!hudstyle new). Existing servers shouldsee no change unless they turn it on.
Why
The world-text HUD has limits that come from how it is built:
layout.
to tune and look different on different resolutions and FOVs.
A Panorama layout is drawn by the client as normal UI. That allows a proper
per-item row (name, owner, ability cooldown, remaining uses / counter value),
and screen-percentage positioning that behaves the same on every resolution.
There is one shared entity; per-player differences are sent as per-slot CSS
classes and dialog variables.
What changed
Code structure
entwatch_hud.h/entwatch_hud.cpp: item rows are gathered once per updateinto a renderer-independent
EntwatchHudRowlist (name, owner, state,cooldown, ammo), then handed to whichever renderer each player uses.
entwatch_hud_worldtext.cpp: the existing world-text renderer, moved out ofentwatch.cpp/playermanager.cppwith its behavior preserved. It does notdepend on Panorama.
(classes for position/size/mode, dialog variables for changed rows).
Up to 64 rows plus an overflow counter are supported.
text, and retries every 30 seconds.
EW_UpdateHud()is now also called on config unload, round start,!hud, and when preferences load, so the HUD hides or updates immediatelyinstead of waiting for the next tick.
Player-facing
!hudstyle [old|new|default]: choose the renderer. Stored per player.!hudpos [x y|reset]and!hudsize [size|reset]now configure the player'sactive renderer. Each renderer has its own stored values:
size as a percentage (50 to 200, default 100).
!hudpos/!hudsizenow reject non-numeric or out-of-range input instead ofsilently using
atof(which returned 0 for garbage).entwatch_hud_style,entwatch_panorama_hudpos_x/y,entwatch_panorama_hudsize.entwatch_hud_style(server default, 0 = world text),cs2f_entwatch_panorama_debug(extra logging).Panorama resources and tooling
assets_source/panorama.hud.xmlandhud.cssaregenerated by
scripts/generate-panorama.pyfrom small templates, so the 64item rows and the per-position / per-size CSS classes are not edited by hand.
Row count, position cap and size range are read from the C++ constants so the
two sides cannot drift apart (
--checkfails if the generated files are stale).scripts/compile-panorama.pyruns the generator, then the CS2 Workshop Toolsresourcecompiler, and copies the results toassets/panorama. It is plainPython (the same language as the rest of the build scripts) rather than a
PowerShell script.
hud.vxml_c,hud.vcss_c) are checked in, sonormal and release builds don't need Workshop Tools. They only change when the
HUD layout changes.
PackageScriptcopies them into the package next to theexisting sounds and particles.
Small robustness fixes touched along the way
customhudlayout.cpp(click/disconnect callbacks, slotrange) and a null handler check in
GetHandlerStateText.EW_DestroyHud()on plugin unload.Things reviewers should know
docs, Panorama files reach clients through a packed workshop addon or a
workshop map (
panorama/layout/custom_gameand the styles folder are part ofthe publishable content), not through the server plugin. The compiled files
have to be on the server and shipped to clients the same way as the existing
CS2Fixes particles/sounds. I have not tested what a client without the files
sees, so this is from documentation, not from observation. That is another
reason Panorama is off by default. Input from people who already distribute
custom content to players would be welcome.
assets/panorama/**/*_care binaryoutputs from Valve's compiler. I kept them in the tree so releases do not
depend on a Steam login in CI. Happy to change that if you prefer another
approach.
the bottom of the screen was considered and skipped for now.
Testing
Honest scope: this has been tested in singleplayer, on a couple of maps,
with test data (simulated EntWatch items), not on a populated server.
!hudstyle, and updatecooldown / uses / counter values.
!hudpos,!hudsizeandresetwork for both styles, and values survivereconnecting.
hud.xml/hud.cssbyte for byte (checked before the 95% position cap was applied).
Not yet tested: multiple real players at once, many simultaneous items,
real map configs on a live server, slot reuse after disconnect/reconnect with
several players, and different client resolutions / aspect ratios. Panorama
should be tried on more servers and maps before it becomes the default, which
is why the config default is world text.
Disclosure
The code was written by an AI assistant (Claude) and reviewed by me. I am not
very familiar with C++ or with CS2Fixes / CS2 server modding, so extra
scrutiny is welcome, especially of the
custom_hud_layoutusage, and the entity lifecycle (map change, round restart,plugin unload).