Skip to content

Commit f5598bd

Browse files
committed
Fixed the fallback CenterHtmlMenu, plus updated its colors + docs
1 parent c650483 commit f5598bd

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A native CSSUniversalMenuAPI implementation, mirroring the behavior of SourceMod radio menus for CounterStrikeSharp.
44

5+
https://www.youtube.com/watch?v=Be7qop6pVpI
6+
57
When number keys are bound with the following snippet, automatically detected and the menu will look like it used to in CSS and CS:GO:
68

79
```
@@ -27,7 +29,10 @@ When these binds are not present, the player is prevented from moving, and the f
2729

2830
![](./docs/GunsWasdMenuCropped.png)
2931

30-
https://www.youtube.com/watch?v=Be7qop6pVpI
32+
In the event that there is no spectator on which to create the predicted view model, the system will further fall back to
33+
a CenterHtmlMenu for that free roaming player.
34+
35+
![](./docs/CenterHtmlFallbackCropped.png)
3136

3237
Many thanks to [@T3Marius's CS2ScreenMenuAPI](https://github.com/T3Marius/CS2ScreenMenuAPI) for acting as reference when it comes to using the point_worldtext entity.
3338

docs/CenterHtmlFallbackCropped.png

232 KB
Loading

src/SharpModMenu/PlayerMenuState.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,17 @@ public bool DrawActiveMenu()
344344
if (CurrentMenu is not null && !CurrentMenu.IsDirty)
345345
return true;
346346
}
347-
WasPressingForward = WasPressingBack = WasPressingLeft = WasPressingRight = WasPressingReload = WasPressingUse = WasPressingTab = true;
347+
else
348+
{
349+
// setting these here inhibit existing player inputs from being registered, requiring they at least be released first
350+
WasPressingForward = true;
351+
WasPressingBack = true;
352+
WasPressingLeft = true;
353+
WasPressingRight = true;
354+
WasPressingReload = true;
355+
WasPressingUse = true;
356+
WasPressingTab = true;
357+
}
348358

349359
if (CurrentMenu is null)
350360
{
@@ -468,9 +478,10 @@ void writeLine(string text, TextStyling style, int? selectIndex)
468478

469479
var color = style switch
470480
{
471-
{ Highlight: true } => "#F74843",
472-
{ Foreground: true } => "#E28B12",
473-
_ => "#E7CCA5",
481+
{ Foreground: true, Highlight: true} => "#EFCE21",
482+
{ Foreground: true, Highlight: false } => "#E28B12",
483+
{ Foreground: false, Highlight: true } => "#EFE472",
484+
{ Foreground: false, Highlight: false } => "#E7CCA5",
474485
};
475486

476487
var selectionPrefix = selectIndex.HasValue ? $"/{selectIndex.Value} " : string.Empty;

0 commit comments

Comments
 (0)