Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to make a Menu with Submenu ?

Skilled Illusionist
Joined
May 11, 2011
Messages
316
Reaction score
28
I hope anyone can help me to make a Menu with Submenu on the Start menu.
Visible for Administrator or higher.
I don't know where and what i must do...
Some test are not working for me... ;(
Thanks.
 
Last edited:
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
CWndTaskMenu::OnInitialUpdate():
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		CWndButton* pWndButton8 = AppendMenu( this, 0, 0 , _t("Menu")); pWndButton8->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );
	}

Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
	m_pMenu8 = new CWndMenu;
	m_pMenu8->CreateMenu( this );
	pWndButton = AppendMenu( m_pMenu8, 0, APP_INFO_NOTICE   , GETTEXT( TID_APP_INFO_NOTICE   ) ); 
	pWndButton8->SetMenu( m_pMenu8 );
	}

Untested, but should work don't really have full access to a PC atm but can look @ it more when i get home later.
 
Skilled Illusionist
Joined
May 11, 2011
Messages
316
Reaction score
28
Hey Bro,
i don't get it work :(

atm i have this at wndtaskbar.cpp:

Code:
m_pMenu9 = NULL;
...
SAFE_DELETE( m_pMenu9 );

and this

Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		CWndButton* pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );	
	}

and this

Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		CWndButton* pWndButton9 = NULL;
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );	
	}

and at wndtaskbar.h

Code:
CWndMenu* m_pMenu9;

compiling without error but client crash when i click start menu ;(

the funniest part is, if i remove the isauthhigher if loop, it works...
 
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
Have you tried leaving only the auth for the top one?
 
Skilled Illusionist
Joined
May 11, 2011
Messages
316
Reaction score
28
Have you tried leaving only the auth for the top one?

pWndButton8 is for the user menu and this works.



i try now this :
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		CWndButton* pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );	
	}
and this
Code:
		CWndButton* pWndButton9 = NULL;
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );
compiling: no error
result: click on start -> neuz crash



next try this :
Code:
	CWndButton* pWndButton9 = NULL;
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );	
	}
and this
Code:
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );
compiling: no error
result: click on start -> everyone can see the admin tools



next try this :
Code:
	CWndButton* pWndButton9 = NULL;
		pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );
and this
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );	
	}
compiling: no error
result: click on start -> everyone can see the admin tools



next try this :
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{	
		CWndButton* pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );	
	}
and this
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{
		CWndButton* pWndButton9 = NULL;
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );	
	}
compiling: no error
result: click on start -> neuz crash



my last try:
Code:
	if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
	{	
		CWndButton* pWndButton9 = AppendMenu( this, 0, 0 , _T( "Admin Tools" ) ); pWndButton9->SetTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, _T( "icon_Folder.dds" ) ) );	
		m_pMenu9 = new CWndMenu;
		m_pMenu9->CreateMenu( this );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_BAG_EX , GETTEXT( TID_APP_BAG_EX ) );
		pWndButton = AppendMenu( m_pMenu9, 0, APP_HOUSING, GETTEXT(TID_GAME_HOUSING_BOX));
		pWndButton = AppendMenu( m_pMenu9, 0, APP_MOTION   , GETTEXT( TID_APP_MOTION       ) );
		pWndButton9->SetMenu( m_pMenu9 );	
	}
compiling: no error
result: click on start -> everyone can see admin tools
 
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
I'll give it a go later today and see what i can come up with.
 
Back
Top