halflife icon indicating copy to clipboard operation
halflife copied to clipboard

Add vgui2 codes to SDK

Open kungfulon opened this issue 11 years ago • 8 comments

VGUI2 offers more features than the old VGUI. I think it should be included in the SDK since CS 1.6 uses it.

kungfulon avatar Jul 16 '15 02:07 kungfulon

CS 1.6 uses VGUI 1, VGUI 2 is for Source games.

JoelTroch avatar Nov 02 '15 00:11 JoelTroch

Nope, CS 1.6 does use VGUI2 with surface v028. You can use disassemble softwares to check it.

kungfulon avatar Nov 02 '15 04:11 kungfulon

@kungfulon is it VGUI_Surface026 that's used by the engine?

tschumann avatar Feb 06 '16 05:02 tschumann

ah yes. i mistyped the version. thanks for correcting me >.<

kungfulon avatar Feb 18 '16 12:02 kungfulon

I strongly support the exposure of VGUI2 features to the SDK. To make this concrete, I propose a new UserMessage implementation that allows modders to use the VGUI2 engine (already present in CS 1.6) to create modern, lightweight menus without relying on heavy MOTD/HTML windows.

Here is a detailed specification for the feature:

1. Expanded Color System (Tags) Currently, we are severely limited to ~4 colors. I propose expanding the native tag parser to support a standard palette of 15 essential colors using simple abbreviations, plus Hex support for specific needs.

Proposed Tag List (Shortcodes):

Classics: \w (White), \r (Red), \y (Yellow), \d (Default/Grey).

New Additions:

\g (Green), \b (Blue), \c (Cyan), \m (Magenta), \o (Orange) \p (Purple), \l (Lime), \pk (Pink), \br (Brown), \bl (Black)

Hex Fallback: {#RRGGBB} (For any custom color not listed above).

2. Layout & Alignment (Auto-Size & Columns) The VGUI panel should handle layout dynamically:

  • Auto-Size Background: The background box should optionally scale to wrap the content (as seen in Fig 1 of the mockup), instead of covering the full screen.
  • Styling & Translucency: Support for RGBA color definitions for both the Background and the Border. This allows for translucent backgrounds (e.g., see-through black) and semi-transparent borders to blend seamlessly with the game world.
  • Right Alignment (R Suffix): Adding R to any color tag aligns the subsequent text to the Right edge of the panel.
    • Usage: \glR$5000 -> Displays "$5000" in Gold, aligned to the Right.
    • Usage: \rR[LOCKED] -> Displays "[LOCKED]" in Red, aligned to the Right.

3. Backward Compatibility (Legacy/Non-Official Clients) To ensure this update does not cause Host_Error or crashes on older builds (non-steam/legacy protocols):

  • Feature Negotiation: The server plugin queries client_has_feature().

-Automatic Fallback: If the client does not support the new message, the plugin automatically falls back to the classic ShowMenu (White Text).

Result: Modern clients get the VGUI2 styled menu; Legacy clients get the functional classic menu. Zero friction, zero crashes.

4. Visual Mockup The image below demonstrates the Auto-Size capability (Left) vs. Full Layout (Right) using the proposed Color Tags and Right-Alignment logic.

Image

Zetsukt avatar Dec 11 '25 20:12 Zetsukt

@Zetsukt this works only on build 10210?

di57inct avatar Dec 15 '25 08:12 di57inct

+1 - Update ... ?

benjarogit avatar Oct 29 '26 12:10 benjarogit

tmp64/hl1_source_sdk has it.

sabianroberts avatar Oct 29 '26 15:10 sabianroberts