Skip to content

Add proper support for custom client schemes, HUD layouts, etc. + related changes to HL2 Protagonist System#510

Open
Blixibon wants to merge 4 commits intomapbase-source:developfrom
Blixibon:mapbase/feature/custom-hud-and-protag-sys-changes
Open

Add proper support for custom client schemes, HUD layouts, etc. + related changes to HL2 Protagonist System#510
Blixibon wants to merge 4 commits intomapbase-source:developfrom
Blixibon:mapbase/feature/custom-hud-and-protag-sys-changes

Conversation

@Blixibon
Copy link
Member

This PR adds support for clientscheme.res, hudlayout.res, and hudanimations.txt to be overridden in-game by a map, by VScript, or by the HL2 Protagonist System. It also adds support for custom weapon names and sound overrides to the Protagonist System.

Mapbase's previous implementation of custom client schemes tried to override Panel::GetScheme directly, which was a bit of a mess and didn't override every part of the scheme (e.g. the fonts). This implementation instead modifies the behavior of CBaseViewport::ReloadScheme, which is what applies clientscheme.res and also technically supports the use of a different file. The function has been modified so that, when the scheme differs from the previous one, it re-initializes the HUD and the default settings of each HUD panel. The latter required the addition of Panel::SetApplyDefaultSettings to apply the required flag. CBaseViewport has been modified further to support custom HUD layout and animations as well.

These files can be used through the existing implementation of Mapbase's map-specific files (e.g. <map name>_clientscheme.res) or the exposed VScript functions (e.g. Mapbase.LoadCustomClientSchemeFile("resource/clientscheme_custom.res")). Additionally, the HL2 Protagonist System now has the ability to load these files on a protagonist-by-protagonist basis so that different protagonists have different HUDs.

The Protagonist System also now supports custom weapon names and sound overrides to complement custom HUDs.

Some notes regarding this:

  • The map-specific HUD files were originally intended for HL2 maps that have you play as a different protagonist, and this niche is now filled by the Protagonist System. There may be other uses for it (maybe in TF2?), but this has not been tested much outside of the Protagonist System and may need further changes to be viable.
  • Custom HUD animations are more hacky and less stable than the custom client scheme or HUD layout. The next Mapbase update may try to transfer hardcoded HUD animation colors to the client scheme so that custom HUD animations are less necessary.
  • Changes have been made to some of HL2's HUD elements to allow them to be overridden by custom HUD layouts and/or the Protagonist System's print name override.

PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant