How to build a custom main menu?

Anything else here related to the mod goes here.
Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

How to build a custom main menu?

Post by Lloyd » Fri Apr 22, 2011 5:39 pm

Well I've been trying to find tutorials for ages now about how to add buttons and popup windows on your main menu screen.
Does anybody have a good tutorial for this? or is anyone willing to help me out on making a menu with a popup window with buttons that direct you to a server?
I think it's related to jaymod because I might need to edit the .pk3 or w/e:)

thanks alot,

Lloyd

MickyP
Server n00b
Posts: 40
Joined: Thu Jul 13, 2006 10:23 am

Re: How to build a custom main menu?

Post by MickyP » Fri Apr 22, 2011 6:46 pm

Are you refering to the Main Menu when you run ET or the Window that you see when you press Esc when on a jaymod server.

Its a little confusing when you say popup as when menus open what happens is that a command is run saying close 1 menu then open another

This is the line of code for opening the Jaymod menu from the Ingame menu (jaymod-2.1.10.pk3\ui\ingame_main.menu)

Code: Select all

BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "^xJAY^4MOD", .3, 14, close ingame_main; open jaymod_main )
You don't edit any of the Jaymod files you have to create a new PK3 file containing edited files.

Have a read of some of my posts on the thread below as this details a bit on menu making
http://jaymod.clanfu.org/forums/viewtopic.php?p=41580

If you can give more exact details then I can help a bit more.

There are some posts on the etpub forums about things like this but they can take a bit to find.

Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

Re: How to build a custom main menu?

Post by Lloyd » Fri Apr 22, 2011 7:40 pm

I was talking about the main menu,
-Play online
-Options
-credits
-quit

I think you're talking about the Ingame menu.

Well, I've read something about that code but if I unpack the jaymod PK3 and repack it with my main.menu it won't show on my main menu.
It might be server sided and I don't own a server.. I'm just a random member of that clan.

Is there a way to test it or w/e? or

MickyP
Server n00b
Posts: 40
Joined: Thu Jul 13, 2006 10:23 am

Re: How to build a custom main menu?

Post by MickyP » Sat Apr 23, 2011 3:38 am

The coding for the main.menu (the one your talking about) & the ingame.menu is almost the same.

With the main.menu this is not not jaymod related, the file is contained in pak0.pk3 if your using 2.55/2.56 or pak2.pk3 if your running 2.60/2.60b

The important stuff.

Never edit any official pk3 you must create a new file. If you edit any of these files you will not be able to join a server. (if you edit the jaymod files you might get away with just having to redownload the files).

The reason editing the jaymod file won't work is because that is located in the jaymod folder & the files that are read when you start ET are in the etmain folder but see the above for why you still should not edit it.

I still need more infomation from you other wise I can't help

Are you wanting a button to click that opens a new menu with links to 2 or more servers (need to know how many servers)?
Do you want 1 more more buttons on the main menu that will just directly connect you to a server (again need to know how many)?

What version of et are you using?

Is this just for yourself or is this wanted for your clan to use as a download from their server?

I know the coding, but I can't post how to do this without knowing your exact requirments.

Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

Re: How to build a custom main menu?

Post by Lloyd » Sat Apr 23, 2011 8:08 am

running 2.55
Well it's for server use so I can't be using a massive pak0.pk3 file.

The idea is to make all the buttons look like this.
-------------------------
"Playonline"
"Servers"
"Rules"
"Website"
"replays"
"options"
"profile"
"credits"
"exit game"
--------------------------
Servers, Pop up window with 3 buttons in it that direct you to the servers.

Rules, Pop up window with space for 10 lines.

Website, A button that redirects you to a website.
---------------------------

Also, how is it possible to run a custom menu mod like this without editing the 200mb pak0.pk3?

Thanks alot,

Lloyd

Destroy666
Server n00b
Posts: 30
Joined: Wed Mar 23, 2011 8:43 am

Re: How to build a custom main menu?

Post by Destroy666 » Sat Apr 23, 2011 8:52 am

You have to make a NEW PK3 with menu files and additional stuff (images etc.).
I suggest you to download a menu or just look in etmain/Jaymod directory for a PK3 with menu only, open it and see how it's made.

Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

Re: How to build a custom main menu?

Post by Lloyd » Sat Apr 23, 2011 9:09 am

Where could I find a download for a simple menu?

ps. I figured out how to make smaller pk3s and how to run them..

they have to be in the top of the folder that's why most servers use the name ~.pk3 because the files that are in the top .pk3 will run first and ET will not load the ones in the normal pak0.pk3 because it already has loaded a .. for example main.menu .. :)

Genert
Server n00b
Posts: 12
Joined: Thu Mar 24, 2011 9:10 am

Re: How to build a custom main menu?

Post by Genert » Tue Apr 26, 2011 3:30 am

Lloyd wrote:running 2.55
"Playonline"
"Servers"
"Rules"
"Website"
"replays"
"options"
"profile"
"credits"
"exit game"
Menu coding is like programming.
This is what do you look:
E: Forgot :lol: In main.menu
Replace

Code: Select all

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	128
#define WINDOW_HEIGHT	200
#define GROUP_NAME		"grpMain"

With

Code: Select all

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH		160
#define WINDOW_HEIGHT		248
#define GROUP_NAME		"grpMain"
Now where are buttons replace it with this:

Code: Select all

// Buttons //

	GBUTTON( 6, 32, WINDOW_WIDTH-12, 18, "^7Play Online", .3, 14, close main ; /*close backgroundmusic ; open backgroundmusic_server ;*/ uiScript UpdateFilter ; uiScript ServerSortDown 4 ; open playonline )
	GBUTTON( 6, 56, WINDOW_WIDTH-12, 18, "^7Servers", .3, 14, close main ; open Lloyd_servers
	GBUTTON( 6, 80, WINDOW_WIDTH-12, 18, "^7Rules", .3, 14, close main ; open Lloyd_rules )
	GBUTTON( 6, 104, WINDOW_WIDTH-12, 18, "^7Website", .3, 14, close main ; open Lloyd_website )
	GBUTTON( 6, 128, WINDOW_WIDTH-12, 18, "^7Replays", .3, 14, close main ; open viewreplay )
	GBUTTON( 6, 152, WINDOW_WIDTH-12, 18, "^7Options", .3, 14, close main ; open options )
	GBUTTON( 6, 176, WINDOW_WIDTH-12, 18, "^7Profile", .3, 14, close main ; open profile )
	GBUTTON( 6, 200, WINDOW_WIDTH-12, 18, "^7Credits", .3, 14, close main ; open credits_splashdamage )
	GBUTTON( 6, 224, WINDOW_WIDTH-12, 18, "^?Exit Game", .3, 14, close main ; open quit )
}
And in menumacros,almost in end,before //Jay tag add this:

Code: Select all

#define GBUTTON( BUTTON_X, BUTTON_Y, BUTTON_W, BUTTON_H, BUTTON_TEXT, BUTTON_TEXT_SCALE, BUTTON_TEXT_ALIGN_Y, BUTTON_ACTION )					\
	itemDef {															\
		name		"bttn"##BUTTON_TEXT									\
		group		GROUP_NAME											\
		rect		$evalfloat(BUTTON_X) $evalfloat(BUTTON_Y) $evalfloat(BUTTON_W) $evalfloat(BUTTON_H)					\
		type		ITEM_TYPE_BUTTON									\
		text		BUTTON_TEXT											\
		textfont	UI_FONT_ARIBLK_16								\
		textscale	BUTTON_TEXT_SCALE									\
		textalign	ITEM_ALIGN_CENTER									\
		textalignx	$evalfloat(0.5*(BUTTON_W))							\
		textaligny	BUTTON_TEXT_ALIGN_Y									\
		style		WINDOW_STYLE_FILLED									\
		backcolor	.1 .1 .1 .9											\
		forecolor	.6 .6 .6 1											\
		border		WINDOW_BORDER_FULL									\
		bordercolor	.1 .1 .1 1											\
		visible		1													\
																		\
		mouseEnter {													\
			setitemcolor "bttn"##BUTTON_TEXT forecolor .9 .9 .9 1 ;		\
			setitemcolor "bttn"##BUTTON_TEXT backcolor .2 .2 .2 .9		\
		}																\
																		\
		mouseExit {														\
			setitemcolor "bttn"##BUTTON_TEXT forecolor .6 .6 .6 1 ;		\
			setitemcolor "bttn"##BUTTON_TEXT backcolor .1 .1 .1 .9		\
		}																\
																		\
		action {														\
			setitemcolor "bttn"##BUTTON_TEXT forecolor .6 .6 .6 1 ;		\
			setitemcolor "bttn"##BUTTON_TEXT backcolor .1 .1 .1 .9 ;	\
			play "sound/menu/select.wav" ;								\
			BUTTON_ACTION												\
		}																\
	}

#define GBUTTONEXT( BUTTONEXT_X, BUTTONEXT_Y, BUTTONEXT_W, BUTTONEXT_H, BUTTONEXT_TEXT, BUTTONEXT_TEXT_SCALE, BUTTONEXT_TEXT_ALIGN_Y, BUTTONEXT_ACTION, BUTTONEXT_EXT )					\
	itemDef {															\
		name		"bttnext"##BUTTONEXT_TEXT							\
		group		GROUP_NAME											\
		rect		$evalfloat(BUTTONEXT_X) $evalfloat(BUTTONEXT_Y) $evalfloat(BUTTONEXT_W) $evalfloat(BUTTONEXT_H)					\
		type		ITEM_TYPE_BUTTON									\
		text		BUTTONEXT_TEXT										\
		textfont	UI_FONT_ARIBLK_16									\
		textscale	BUTTONEXT_TEXT_SCALE								\
		textalign	ITEM_ALIGN_CENTER									\
		textalignx	$evalfloat(0.5*(BUTTONEXT_W))						\
		textaligny	BUTTONEXT_TEXT_ALIGN_Y								\
		style		WINDOW_STYLE_FILLED									\
		backcolor	.1 .1 .1 .9											\
		forecolor	.6 .6 .6 1											\
		border		WINDOW_BORDER_FULL									\
		bordercolor	.1 .1 .1 1											\
		visible		1													\
																		\
		mouseEnter {													\
			setitemcolor "bttnext"##BUTTONEXT_TEXT forecolor .9 .9 .9 1 ;		\
			setitemcolor "bttnext"##BUTTONEXT_TEXT backcolor .2 .2 .2 .9		\
		}																\
																		\
		mouseExit {														\
			setitemcolor "bttnext"##BUTTONEXT_TEXT forecolor .6 .6 .6 1 ;		\
			setitemcolor "bttnext"##BUTTONEXT_TEXT backcolor .1 .1 .1 .9		\
		}																\
																		\
		action {														\
			setitemcolor "bttnext"##BUTTONEXT_TEXT forecolor .6 .6 .6 1 ;		\
			setitemcolor "bttnext"##BUTTONEXT_TEXT backcolor .1 .1 .1 .9 ;	\
			play "sound/menu/select.wav" ;								\
			BUTTONEXT_ACTION											\
		}																\
																		\
		BUTTONEXT_EXT				
Now go to menus.txt
And add this:

Code: Select all

// Lloyd
loadMenu { "ui/Lloyd_servers.menu" }
loadMenu { "ui/Lloyd_website.menu" }
loadMenu { "ui/Lloyd_rules.menu" }
Now you must do Lloyd_rules.menu,Lloyd_webiste.menu and Lloyd_servers.menu
Good luck with that:)
Lloyd wrote:Where could I find a download for a simple menu?

ps. I figured out how to make smaller pk3s and how to run them..

they have to be in the top of the folder that's why most servers use the name ~.pk3 because the files that are in the top .pk3 will run first and ET will not load the ones in the normal pak0.pk3 because it already has loaded a .. for example main.menu .. :)
z_menu.pk3 loads in last.

Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

Re: How to build a custom main menu?

Post by Lloyd » Tue Apr 26, 2011 12:02 pm

Worked my ass off.. and it.. WORKS :mrgreen:
thanks to all of you for the help..

Image

Image
-----------------------------------------------------------------------------------
https://rapidshare.com/files/459301198/__.pk3

MickyP
Server n00b
Posts: 40
Joined: Thu Jul 13, 2006 10:23 am

Re: How to build a custom main menu?

Post by MickyP » Tue Apr 26, 2011 12:19 pm

Website & Rules are covered in my other post
http://jaymod.clanfu.org/forums/viewtopic.php?p=41580
You might need to change a few settings

For servers you also use another menu like this

Code: Select all

#include "ui/menudef.h"

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	128
#define WINDOW_HEIGHT	176
#define GROUP_NAME		"grpOptions"

// Macros //

#include "ui/menumacros.h"
		
// Options Menu //
	
menuDef {
	name		"servers"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	
	onESC {
		close Lloyd_servers ;
#ifdef FUI
		open main
#else
		open ingame_main
#endif // FUI
	}

// Window //

	WINDOW( "^1S^2ERVERS", 118 )
	
// Buttons //

	BUTTON( 6, 32, WINDOW_WIDTH-12, 18, "Server 1", .24, 14, close Lloyd_servers ; exec "connect 123.456.789.1:27961" )
	BUTTON( 6, 56, WINDOW_WIDTH-12, 18, "Server 2", .24, 14, close Lloyd_servers ; exec "connect 123.456.789.1:27962" )
	BUTTON( 6, 80, WINDOW_WIDTH-12, 18, "Server 3", .24, 14, close Lloyd_servers ; exec "connect 123.456.789.1:27963" )
	BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "Server 4", .24, 14, close Lloyd_servers ; exec "connect 123.456.789.1:27964" )
	BUTTON( 6, 128, WINDOW_WIDTH-12, 18, "Server 5", .24, 14, close Lloyd_servers ; exec "connect 123.456.789.1:27965" )

#ifdef FUI
	BUTTON ( 6, 152, WINDOW_WIDTH-12, 18, "^1B^2ACK", .25, 14, close Lloyd_servers ; open main )
#else
	BUTTON ( 6, 152, WINDOW_WIDTH-12, 18, "^1B^2ACK", .25, 14, close Lloyd_servers ; open ingame_main )
#endif // FUI
}
That code is for 5 servers & is a single menu that can be run from the main & ingame menu

Just chage the text ( "server 1" etc) & the ip:port ( "connect 123.456.789.1:27961" etc )

Lloyd
Server n00b
Posts: 9
Joined: Fri Apr 22, 2011 5:33 pm

Re: How to build a custom main menu?

Post by Lloyd » Tue Apr 26, 2011 12:30 pm

OMG I love you :)
I'll start working on the rule list :)
thanks alot

Shownie
Server n00b
Posts: 45
Joined: Sun Mar 27, 2011 10:23 am

Re: How to build a custom main menu?

Post by Shownie » Tue Apr 26, 2011 2:27 pm

This is so lame ... messing with the menus, noone really likes it, just annoying. We already talked about it here.

Make your own mod then you can start making your own menu. Suddenly every clan has its own custom menu. And you maybe play on five different servers and all of them have those custom menus.

This mess up ET, and some players don't know whats causing it. I was so tired of those custom menus which all servers had that I played on... now I don't play ET, I'm to sick of deleting not wanted shit paks :!:

:|

Genert
Server n00b
Posts: 12
Joined: Thu Mar 24, 2011 9:10 am

Re: How to build a custom main menu?

Post by Genert » Wed Apr 27, 2011 1:07 am

Shownie wrote:This is so lame ... messing with the menus, noone really likes it, just annoying. We already talked about it here.

Make your own mod then you can start making your own menu. Suddenly every clan has its own custom menu. And you maybe play on five different servers and all of them have those custom menus.

This mess up ET, and some players don't know whats causing it. I was so tired of those custom menus which all servers had that I played on... now I don't play ET, I'm to sick of deleting not wanted shit paks :!:

:|
Play in the NoDownload servers then:)

Shownie
Server n00b
Posts: 45
Joined: Sun Mar 27, 2011 10:23 am

Re: How to build a custom main menu?

Post by Shownie » Wed Apr 27, 2011 9:35 am

Is that your answer to every poor etplayer which encounter this type of problem?

Nice :wink: Good luck :!:

User avatar
[FL]Blindman
Server Pro
Posts: 864
Joined: Thu Jun 02, 2005 3:07 pm
Location: Champlain Valley

Re: How to build a custom main menu?

Post by [FL]Blindman » Wed Apr 27, 2011 1:25 pm

Shownie wrote:This is so lame ... messing with the menus, noone really likes it, just annoying. We already talked about it here.

Make your own mod then you can start making your own menu. Suddenly every clan has its own custom menu. And you maybe play on five different servers and all of them have those custom menus.

This mess up ET, and some players don't know whats causing it. I was so tired of those custom menus which all servers had that I played on... now I don't play ET, I'm to sick of deleting not wanted shit paks :!:

:|
Seriously? yea et is messed up because of menus? I have to agree, u dont like downloads, guess its no downloads for you. Its lame ass answers like that that put people off these forums, not custom menus.

Guy joins a month ago and now hes the expert on what people like, jeez how do I do that?
Image
Image

Post Reply