This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

New AMXX Menu System


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-25-2012 , 22:33   Re: New AMXX Menu System
Reply With Quote #371

Quote:
Originally Posted by 0920357689 View Post
if player open new menu
the old menu will be auto destroy?
Quote:
Originally Posted by Emp` View Post
If a menu overwrites another menu, MENU_EXIT is called on the first menu.
It won't be destroyed unless the handler of the first menu destroys the menu when MENU_EXIT case destroys it.
__________________

Last edited by fysiks; 03-25-2012 at 22:33.
fysiks is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 03-27-2012 , 05:46   Re: New AMXX Menu System
Reply With Quote #372

Quote:
Originally Posted by fysiks View Post
It won't be destroyed unless the handler of the first menu destroys the menu when MENU_EXIT case destroys it.
why the new menu can't add text

new menu is very nice...but can't add text

can change amxx core to make this?
0920357689 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-27-2012 , 12:17   Re: New AMXX Menu System
Reply With Quote #373

Quote:
Originally Posted by 0920357689 View Post
why the new menu can't add text

new menu is very nice...but can't add text

can change amxx core to make this?
What do you mean "can't add text"? Maybe you need to look into menu_addtext().
__________________

Last edited by fysiks; 03-27-2012 at 12:18.
fysiks is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-27-2012 , 13:44   Re: New AMXX Menu System
Reply With Quote #374

Quote:
Originally Posted by 0920357689 View Post
why the new menu can't add text

new menu is very nice...but can't add text

can change amxx core to make this?
You can only add text after adding items (text entries are tied to items). If you try to add text before items it should give you an error.

Code:
static cell AMX_NATIVE_CALL menu_addtext(AMX *amx, cell *params)
{
	GETMENU(params[1]);

	if (params[2] && (!pMenu->items_per_page && pMenu->GetItemCount() >= 10))
	{
		LogError(amx, AMX_ERR_NATIVE, "Non-paginated menus are limited to 10 items.");
		return 0;
	}

	if (!pMenu->m_Items.size())
	{
		LogError(amx, AMX_ERR_NATIVE, "Blanks can only be added after items.");
		return 0;
	}

	menuitem *item = pMenu->m_Items[pMenu->m_Items.size() - 1];

	BlankItem a;

	int len;
	a.SetText(get_amxstring(amx, params[2], 0, len));

	if (params[3] == 1)
		a.SetEatNumber(true);

	else
		a.SetEatNumber(false);

	item->blanks.push_back(a);

	return 1;
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
0920357689
Senior Member
Join Date: Apr 2008
Old 03-27-2012 , 13:55   Re: New AMXX Menu System
Reply With Quote #375

[QUOTE=Emp`;1676853]You can only add text after adding items (text entries are tied to items). If you try to add text before items it should give you an error.

Mmmmm......

look like

[001] MENU

1. a
2. b
XXXXXXXXX
3. c
4. f

how to add XXXXXXXXX in menu?
0920357689 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-27-2012 , 14:10   Re: New AMXX Menu System
Reply With Quote #376

You would use something like:
Code:
new iMenu = menu_create( "[001] MENU", "menu_handler" );
menu_additem( iMenu, "a", "1" );
menu_additem( iMenu, "b", "2" );
menu_addtext( iMenu, "XXXXXXXXX", .slot=0 );
menu_additem( iMenu, "c", "3" );
menu_additem( iMenu, "d", "4" );

Last edited by Emp`; 03-27-2012 at 14:11.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 04-01-2012 , 11:39   Re: New AMXX Menu System
Reply With Quote #377

I've read somewhere that you can outline text to the right (menu shows up at the left but i want to line some text of each key to the right for example
PHP Code:
    new menu menu_create("\ytestmenu""testmenu_handler");
    
menu_additem(menu"something                            \y[something]""1");
    
menu_additem(menu"something                          \y[something]""2"); 
the point is that I want to all the texts "[something]" to show precisly under each other.
I have tested with just putting spaces between the something and [something] but that didnt work,

is there a \.. command to line text to the right of the menu

Last edited by striker07; 04-01-2012 at 11:41.
striker07 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-01-2012 , 11:50   Re: New AMXX Menu System
Reply With Quote #378

Quote:
Originally Posted by striker07 View Post
is there a \.. command to line text to the right of the menu
https://forums.alliedmods.net/showth...46364#EndNotes
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 04-01-2012 , 14:52   Re: New AMXX Menu System
Reply With Quote #379

oh yes thanks,
i must have oversaw that part
striker07 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 04-05-2012 , 12:51   Re: New AMXX Menu System
Reply With Quote #380

is it possible to have to many submenu's?
becous i have made a plugin with alot of menus, np there it all worked just fine.
but when i made 2 extra menu's + a menu that lists all the menus into one the problem starts,

I can compile the plugin without any errors or warnings but when ppl try to join a server running that plugin then their cs/cz shuts down every time, always during "precaching resources".

anyone know what might be causing this?
striker07 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode