momentum-mod/game

HUD Customizer

Opened this issue · 1 comments

Apparently I never made an issue for this. Okay!

This is a pet project of mine that I've messed with on-and-off for a couple of years, but is too low-priority to justify working on. Others have shown some interest however, so we've got the C++ side merged and my WIP Pano stuff is pushed to https://github.com/momentum-mod/panorama/tree/feat/hud-customizer-v1

Here's where I got to, and what still needs doing:

  • C++ API for layout file IO
  • Flatten the current HUD so every component lives in the same <Hud> container, and is absolute positioned
  • Drag-n-drop (including snapping)
  • Resizing
  • Clean up layout of individual HUD panels
    • I've done some work on this, removing random margins and things from when everything was stacked on top of each other
    • The hard part is getting styling behave when a panel is resized, especially fonts
  • Make "edit mode" versions of panels that display mock data, e.g. comparisons
    • Without this there's literally nothing to look at for some panels
    • Should create new events HudCustomizerEnableEditing/Disable and dispatch to every customizable HUD panel. They listen for each and display mock data when enabled. Some C++ functionality might get in the way, just let me or another licensee know if anything is misbehaving!
  • Actually making a good default layout

On that last one, you'll need a hud_default.kv3 file in momentum/cfg/ for the C++ API to work, this should be enough to get started

<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->
{
	components =
	{
		Chat = 
		{
			position = [ 60, 384 ]
			snaps = [ 1, 3 ]
		}
	}
	settings =
	{
		gridSize = 5
	}
}

As we work on this more this file will obviously change, but this lives in a private repo so you'll need to let a licensee know if you want to get any changes pushed to Steam.

There's waaaay more we could do with this project in the future, but this is ample work for now. Getting this finished would make layouting the HUD much nicer for everyone, and would be really great to have for 1.0.0 release.

https://github.com/momentum-mod/game/assets/35813309/54acea09-6dac-408f-88de-e93b3e6f3aa7
Video of current stuff for anyone that hasn't seen (bit outdated)