[TUT]Basic D3D Menu

10/16/2012 16:39 GinoGambino#1
Leeched from ghbsys /GinoGambino


Underneath a 'basic' menu system with:
- menuitems with multiple custom states like: "Off" "On" or "Head" "Neck" "Spine"
- text menuitems (nonselectable)
- folder style items
- minimal code

A little better screenshot
[Only registered and activated users can see links. Click Here To Register...]

Changes: version 1.2
- small bugfix contributed by Wieter20

Download the latest D3Dmenu files in Attachment /Dl Link

In Endscene you put
Code:
	if (Mmax==0) RebuildMenu();
	MenuShow(10,10,m_pFont);		// show the menu at loc 10,10 with a specified font
	MenuNav();

Somewhere in your code you define your menu like :
Code:
char		sFPS[20]="xxx fps";
int		CH_cheats	  = 1;
int		CH_weap	   = 1;

int		CH_stamina	= 0;
int		CH_fastammo   = 1;
int		CH_fasthealth = 0;
int		CH_fastrepair = 0;
int		CH_fastflag   = 1;
int		CH_nospread   = 1;
int		CH_norecoil   = 1;
int		CH_unlammo	= 1;

// none standard options
char *sStamina[] = { "Off","Stealth","Full" };

void RebuildMenu(void)
{
  strcpy(Mtitle,"== D3Dmenu by Hans211 ==");
  MenuAddItem("[cheats]", Moptfolder, &CH_cheats, 2, MENUFOLDER);
  if (CH_cheats) {
	  MenuAddItem("Stamina"	 , sStamina  , &CH_stamina   , 3, MENUITEM);
	  MenuAddItem("Fast ammo"   , Moptonoff , &CH_fastammo  , 2, MENUITEM);
	  MenuAddItem("Fast health" , Moptonoff , &CH_fasthealth, 2, MENUITEM);
	  MenuAddItem("Fast repair" , Moptonoff , &CH_fastrepair, 2, MENUITEM);
	  MenuAddItem("Fast flag"   , Moptonoff , &CH_fastflag  , 2, MENUITEM);
  }
  MenuAddItem("[Weapons]", Moptfolder, &CH_weap, 2, MENUFOLDER);
  if (CH_weap) {
	  MenuAddItem("No spread"	 , Moptonoff , &CH_nospread, 2, MENUITEM);
	  MenuAddItem("No recoil"	 , Moptonoff , &CH_norecoil, 2, MENUITEM);
	  MenuAddItem("Unlimited ammo", Moptonoff , &CH_unlammo , 2, MENUITEM);
  }
  MenuAddItem("Framerate"		, (char **)sFPS , 0,0,MENUTEXT);
}

Its just basic but it can be easily enhanced...

VT:
[Only registered and activated users can see links. Click Here To Register...]
DL:

[Only registered and activated users can see links. Click Here To Register...]
10/17/2012 11:37 lyght03#2
sir bat walang ganito
\/\/\/

ex : #include "blabla.h"
10/30/2012 15:52 FapMax#3
Its missing a File.
Called : "d3dfont.h"
Please Reupload with all Files.
11/05/2012 18:20 ~.ScoiL#4
Use Google! ;)