feat: Panorama skill HUD and menu, CSS 1.0.375

- Skill card and W/S/E target menu drawn as CCSCustomHudLayout panels via PanoramaManager
  (panorama/ sources), replacing PrintToCenterHtml and WASDMenuAPI; WASDMenuAPI.dll dropped
- Custom status lines (cooldowns, charges) overwrite the description on the card; Medic keeps its
  description with the charge count below
- css_setoverride toggles a per-player cooldown bypass
- YourSkillChatInfo also gates the round-start skill description in chat
- Language: "[css_useSkill]" becomes the configured button name, "Press ... key" wording,
  welcome message trimmed to its first line
- Build against CounterStrikeSharp.API 1.0.375
This commit is contained in:
Astra 2026-09-24 21:28:37 +01:00
parent 20dafd2a7c
commit 793370a55f
37 changed files with 1076 additions and 415 deletions

View file

@ -0,0 +1,42 @@
<root>
<styles>
<include src="s2r://panorama/styles/gamestyles.vcss_c" />
<include src="s2r://panorama/styles/custom_game/jrs_menu.vcss_c" />
</styles>
<!--
W/S/E skill-target picker, replacing WASDMenuAPI's PrintToCenterHtml menu - driven by
src/utils/PanoramaMenu.cs through SkillUtils.CreateMenu/UpdateMenu/CloseMenu. Ported from
PanoramaHudDemo's skill_menu.xml but its own file: PanoramaManager warns two plugins driving
the same layout share one entity and fight over transmit.
mrow0..mrow9 is a fixed window onto a longer item list; how many are used comes from
config.json's WSADMenuVisibleItems. Not "row0".. - those ids belong to PanoramaManager's own
row pool.
-->
<Panel class="jrsmenu-viewport" hittest="false">
<Panel id="JrsMenuRoot" class="jrsmenu-root hidden" hittest="false">
<Panel class="jrsmenu-scrim" hittest="false" />
<Panel id="jrsmenu_card" class="jrsmenu-card">
<Label id="jrsmenu_skill" class="jrsmenu-skill" text="{s:menu_skill}" />
<Label id="jrsmenu_subtitle" class="jrsmenu-subtitle" text="{s:menu_subtitle}" />
<Panel class="jrsmenu-rows" hittest="false">
<Label id="mrow0" class="jrsmenu-row hidden" text="{s:mrow0_title}" />
<Label id="mrow1" class="jrsmenu-row hidden" text="{s:mrow1_title}" />
<Label id="mrow2" class="jrsmenu-row hidden" text="{s:mrow2_title}" />
<Label id="mrow3" class="jrsmenu-row hidden" text="{s:mrow3_title}" />
<Label id="mrow4" class="jrsmenu-row hidden" text="{s:mrow4_title}" />
<Label id="mrow5" class="jrsmenu-row hidden" text="{s:mrow5_title}" />
<Label id="mrow6" class="jrsmenu-row hidden" text="{s:mrow6_title}" />
<Label id="mrow7" class="jrsmenu-row hidden" text="{s:mrow7_title}" />
<Label id="mrow8" class="jrsmenu-row hidden" text="{s:mrow8_title}" />
<Label id="mrow9" class="jrsmenu-row hidden" text="{s:mrow9_title}" />
</Panel>
<Label class="jrsmenu-hint" text="{s:menu_hint}" />
</Panel>
</Panel>
</Panel>
</root>

View file

@ -0,0 +1,31 @@
<root>
<styles>
<include src="s2r://panorama/styles/gamestyles.vcss_c" />
<include src="s2r://panorama/styles/custom_game/skill_hud.vcss_c" />
</styles>
<!--
Stage 1 of the jRandomSkills HUD replacement (see CLAUDE.md's "Panorama HUD" section) - a
real CCSCustomHudLayout panel driving Event.UpdateSkillHUD in PlayerEvents.cs, for the ~119
skills that don't set a custom PrintHTML override. The 36 skills that do (custom bars/
cooldown visuals) still go through the original PrintToCenterHtml path untouched - that's
stage 2, not built yet.
Real per-skill hex colors (from skillsInfo.json) can't be sent here - the server can only
toggle a class, never a color value. skill_hud.css defines 5 rarity classes instead
(rarity-common..rarity-legendary), and PlayerEvents.cs picks one from the skill's own
configured Rarity.
No captured mouse, no row pool - this is a passive always-on display, same shape as
PanoramaHudDemo's panel_demo.xml. Same structural rules: root has no id (compiler-assigned),
authored hidden, PanoramaManager toggles it per player.
-->
<Panel class="skillhud-viewport" hittest="false">
<Panel id="SkillHudRoot" class="skillhud-root hidden" hittest="false">
<Panel id="skillhud_card" class="skillhud-card">
<Label id="skillhud_skill" class="skillhud-skill" text="{s:hud_skill}" />
<Label id="skillhud_extra" class="skillhud-extra" text="{s:hud_extra}" />
</Panel>
</Panel>
</Panel>
</root>

View file

@ -0,0 +1,109 @@
/*
jRandomSkills - styling for jrs_menu.xml. Same geometry as PanoramaHudDemo's skill_menu.css
(already tuned in-game), plus rarity colors for the skill name and a "special" row style for
the colored extra option some skills append (WASDMenuAPI's "#rrggbb|text" prefix).
*/
.jrsmenu-viewport {
width: 100%;
height: 100%;
}
.jrsmenu-root {
width: 100%;
height: 100%;
flow-children: down;
horizontal-align: center;
vertical-align: center;
}
.hidden {
visibility: collapse;
}
.jrsmenu-scrim {
width: 100%;
height: 100%;
background-color: #00000000;
z-index: -1;
/* First child of a flow-children container - without this it eats the whole flow. */
ignore-parent-flow: true;
}
.jrsmenu-card {
width: 300px;
flow-children: down;
horizontal-align: center;
vertical-align: center;
margin-top: 595px;
background-color: #14161bf0;
border: 2px solid #3a3a3aff;
border-radius: 6px;
padding: 14px;
}
.jrsmenu-skill {
width: 100%;
font-size: 20px;
font-weight: bold;
color: #c9a0ffff;
horizontal-align: center;
text-align: center;
margin-bottom: 6px;
}
.jrsmenu-skill.rarity-common { color: #9aa2acff; }
.jrsmenu-skill.rarity-uncommon { color: #4caf6dff; }
.jrsmenu-skill.rarity-rare { color: #4a90d9ff; }
.jrsmenu-skill.rarity-epic { color: #9b6cd6ff; }
.jrsmenu-skill.rarity-legendary { color: #f0a531ff; }
.jrsmenu-subtitle {
width: 100%;
font-size: 13px;
color: #9aa2acff;
white-space: normal;
horizontal-align: center;
text-align: center;
margin-bottom: 6px;
}
.jrsmenu-subtitle.empty {
visibility: collapse;
}
.jrsmenu-rows {
width: 100%;
flow-children: down;
margin-bottom: 6px;
}
.jrsmenu-row {
width: 100%;
font-size: 14px;
color: #d0d3d8ff;
horizontal-align: center;
text-align: center;
padding: 0px;
white-space: nowrap;
text-overflow: shrink min( 11px ) ellipsis;
}
.jrsmenu-row.special {
color: #f0a531ff;
}
/* Listed after .special so the highlight wins on the selected row. */
.jrsmenu-row.selected {
color: #45e0c8ff;
font-weight: bold;
}
.jrsmenu-hint {
width: 100%;
font-size: 11px;
color: #6b7480ff;
text-transform: uppercase;
horizontal-align: center;
text-align: center;
}

View file

@ -0,0 +1,79 @@
/*
jRandomSkills - styling for skill_hud.xml (stage 1 of the Panorama HUD replacement).
Panorama CSS, not web CSS - see CustomHudDemo/PanoramaHudDemo's own panel_demo.css for the
general traps (visibility:collapse not display:none, #rrggbbaa colors, silent unknown-property
drops, horizontal-align/vertical-align needing to be set on both the flow parent AND the flowed
child - not just the parent).
*/
.skillhud-viewport {
width: 100%;
height: 100%;
}
.skillhud-root {
width: 100%;
height: 100%;
flow-children: down;
horizontal-align: center;
vertical-align: bottom;
}
.hidden {
visibility: collapse;
}
.skillhud-card {
width: 320px;
flow-children: down;
horizontal-align: center;
/* Bottom-anchored on both the root and the card (align needs setting on both ends of a flow):
the bottom edge stays 125px up and extra lines grow the card upwards. */
vertical-align: bottom;
margin-bottom: 125px;
background-color: #14161bd0;
border: 1px solid #3a3a3aff;
border-radius: 4px;
padding: 6px 16px 8px 16px;
}
.skillhud-skill {
width: 100%;
font-size: 20px;
font-weight: bold;
horizontal-align: center;
text-align: center;
}
/* Real per-skill hex colors (skillsInfo.json) can't be sent from the server - only a class toggle
can. These 5 stand in for them, picked by PlayerEvents.cs from the skill's own Rarity. Same
palette already used elsewhere in this repo's Panorama work (admin_hud.css's accent-* classes),
not invented fresh here. */
.skillhud-skill.rarity-common { color: #9aa2acff; }
.skillhud-skill.rarity-uncommon { color: #4caf6dff; }
.skillhud-skill.rarity-rare { color: #4a90d9ff; }
.skillhud-skill.rarity-epic { color: #9b6cd6ff; }
.skillhud-skill.rarity-legendary { color: #f0a531ff; }
.skillhud-extra {
width: 100%;
font-size: 13px;
color: #9aa2acff;
white-space: normal;
horizontal-align: center;
text-align: center;
margin-top: 4px;
}
/* A skill's own status line (cooldown, fuel, countdown) rather than its description. */
.skillhud-extra.info {
font-size: 13px;
color: #f0f2f5ff;
}
/* Blank extra line collapses rather than leaving a gap - most skills without a description
visible right now (showDescriptionHUD false) would otherwise leave an empty row. */
.skillhud-extra.empty {
visibility: collapse;
}