Page 1 of 1

Menu tutorials?

Posted: Tue Feb 27, 2018 11:34 pm
by ANUBITEK
Are the any tutorials I could look at that could help me understand ShowMenu(), how menu systems work, and how to set up my own menu system? Also bonus points for any HUD tutorials.

I'd like to make a menu system that can be pulled up when the player does an input, and I want to use my own byte values to cycle through individual options in the menu. I want to then be able to open another menu (or sub-menu?) based on what option I have 'selected'. In this sub-menu, I'd like to scroll through a list of potential int variables from 0-49 and be able to select one of these values, which should assign it to a value to be plugged into a fire() command (for instance, fire(11) ). From there, I'd like to be able to back out to the previous menu then exit out of that and go back into playing the game.

I have the input code to open the main menu here, I think:

Code: Select all

exec function CommandThree( optional byte F )
{
	if ( Health > 0 )
	{
		if ( bShowMenu || Len(Level.Pauser)>0 )
			return;
		else
		{
			bUsedCommandThree = true;
			//ShowMenu(); ???
			return;
		}
	}
}
And I've been looking at the menu call found in PlayerPawn:

Code: Select all

exec function ShowMenu()
{
	WalkBob = vect(0,0,0);
	bShowMenu = true; // menu is responsible for turning this off
	Player.Console.GotoState('Menuing');

	if ( Level.Netmode == NM_Standalone )
		SetPause(true);
}
And I've noticed some interesting code already, namely 'Player.Console.GotoState('Menuing');'.

Re: Menu tutorials?

Posted: Fri Mar 02, 2018 12:33 am
by Feralidragon
I don't know any, but tutorials like those would come in handy.

Although I never worked with that specific kind of menu, so I can't help much on that at the moment, I did work with the menus in general (namely the Mod menu, for which I created a more easier version to handle), and they are terribly messy to work with.
The level of over-engineering and hardcoding going on there is off the charts, and it has put off a lot of even big names around the community from working with it due to that.

Not saying it's terribly hard to understand, because it's not, but it's just messy to work with and get it working correctly, so probably you won't find many tutorials on the web.
Therefore I suggest you to take a good look around the source code (UnCodex, like the one you have in your signature) and try to figure it out first.

If in the meanwhile someone comes up with a tutorial link, great, if not, you can at least post here any bumps you find along the way, and you might get some additional help from someone then.