SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 13/02/2009, 10:14 PM   #1
ғαιιοцт
High-roller
 
ғαιιοцт's Avatar
 
Join Date: Feb 2008
Posts: 1,702
Reputation: 188
Default [INC] Fallout's New Menu Styles. Updated: V4 (new functions)

Fallout's New Menu Styles



I made a new menu type for sa-mp because the normal one can only have 12 rows, you can't change it's colors, ...
This one is easy to use (most of the functions are the same as the normal ones)

Features:
- Maximum rows of a menu = 20 now (you can change it to more but than you may exceed the maximum amount of textdraws if you have many menus)
- You can change the color of every part of the menu (text colors, background colors, box colors)
- Adjustable position
- Adjustable box length (the length of the background of your menu)

Functions:
Code:
native F_CreateMenu(title[], Float:x, Float:y, Float:boxlength); //returns the ID of the created menu (starting at ID 0)
native F_DestroyMenu(menuid);
native F_HideMenuForPlayer(menuid, playerid);
native F_ShowMenuForPlayer(menuid, playerid);
native F_AddMenuItem(menuid, title[]); //returns the ID of the created menu item (starting at ID 0)

native F_SetMenuTitleTextColor(menuid, color);
native F_SetMenuTitleBgColor(menuid, color); //(bg = background)
native F_SetMenuTitleBoxColor(menuid, color);

native F_SetMenuItemTextColor(menuid, color);
native F_SetMenuItemBgColor(menuid, color); //(bg = background)
native F_SetMenuItemBoxColor(menuid, color);

native F_SetMenuSelectedItemTextColor(menuid, color);
native F_SetMenuSelectedItemBgColor(menuid, color); //(bg = background)
native F_SetMenuSelectedItemBoxColor(menuid, color);

//Only for V4:
native F_ShowMenuForAll(menuid);
native F_HideMenuForAll(menuid);
native F_SelectMenuRow(menuid, playerid, row);
Example:
I've made a little example for you:
the 1st menu is an example of a menu with submenus and standard colors (if you didn't change the standard colors)
the 2nd, 3rd and 4th are the submenus of the 1st example, and have different collor combinations and positions (just as an example)

link of example code:
http://pastebin.com/f1c9eebd0

pictures of examples:





Download:

V1


V2


V3


V4


How to install:

V1
- Put this inc in this folder: server\pawno\include\<here>
- Add #include <F_Menu> to any script where you want to use it.
- Add F_OnPlayerKeyStateChange(playerid, newkeys); under OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

V2
- Put this inc in this folder: server\pawno\include\<here>
- Add #include <F_Menu> to any script where you want to use it.
- Add F_Menu_OnInit(); under OnFilterScriptInit() or under OnGameModeInit() (depends on what type of script you use)

V3
- Put this inc in this folder: server\pawno\include\<here>
- Add #include <F_Menu> to any script where you want to use it.
- Add F_Menu_OnInit(); under OnFilterScriptInit() or under OnGameModeInit() (depends on what type of script you use)

V4
- Put this inc in this folder: server\pawno\include\<here>
- Add #include <F_Menu> to any script where you want to use it.
- Add F_Menu_OnInit(); under OnFilterScriptInit() or under OnGameModeInit() (depends on what type of script you use)

Keys:

V1
menu item up = VEHICLE_LOOKLEFT
menu item down = VEHICLE_LOOKRIGHT
exit = VEHICLE_ENTER_EXIT (enter)
select = PED_SPRINT (shift or space)

V2
menu item up = arrow up
menu item down = arrow down
exit = VEHICLE_ENTER_EXIT (enter)
select = PED_SPRINT (shift or space)

V3
menu item up = arrow up
menu item down = arrow down
exit = VEHICLE_ENTER_EXIT (enter)
select = PED_SPRINT (shift or space)

V4
menu item up = arrow up
menu item down = arrow down
exit = VEHICLE_ENTER_EXIT (enter)
select = PED_SPRINT (shift or space)

Changelog:

V1
first release

V2
- Keys changed to arrow keys instead of numpads.
(like normal menu's now)
- When holding down a key, you can scroll faster to another menu-item.

V3
- Fixed some bugs.

V4
- Code optimised.
- New functions:
Code:
native F_ShowMenuForAll(menuid);
native F_HideMenuForAll(menuid);
native F_SelectMenuRow(menuid, playerid, row);
How to use:
The menus (F_CreateMenu()) return an id, so you can do this at the top:

Code:
new MyMenu;
then you assign MyMenu to a menu (possibly under OnGameModeInit):

Code:
MyMenu = F_CreateMenu(title[], Float:x, Float:y);
next step: adding rows (menu items) to the menu:

Code:
F_AddMenuItem(MyMenu, "Row1");
F_AddMenuItem(MyMenu, "Row2");
F_AddMenuItem(MyMenu, "Row3");
//...
Unnecessary: changing the colors of the menu:

you can use:
Code:
F_SetMenuTitleTextColor(menuid, color);
F_SetMenuTitleBgColor(menuid, color); (bg = background)
F_SetMenuTitleBoxColor(menuid, color);

F_SetMenuItemTextColor(menuid, color);
F_SetMenuItemBgColor(menuid, color); (bg = background)
F_SetMenuItemBoxColor(menuid, color);

F_SetMenuSelectedItemTextColor(menuid, color);
F_SetMenuSelectedItemBgColor(menuid, color); (bg = background)
F_SetMenuSelectedItemBoxColor(menuid, color);
example:
Code:
F_SetMenuTitleTextColor(MyMenu , 0xFF3399AA);
and at least: show the code:
Code:
F_ShowMenuForPlayer(MyMenu, playerid);
or hide it:
Code:
F_HideMenuForPlayer(MyMenu, playerid);
and maybe destroy it:
Code:
F_DestroyMenuForPlayer(MyMenu);

Last edited by ғαιιοцт; 24/07/2010 at 01:45 PM.
ғαιιοцт is offline   Reply With Quote
Old 13/02/2009, 10:19 PM   #2
Maercell
Little Clucker
 
Join Date: Jul 2008
Posts: 17
Reputation: 0
Default Re: [INC] Fallout's New Menu Styles.

Woowww... really nice!
Better than the normal menus.
Well done
Maercell is offline   Reply With Quote
Old 13/02/2009, 10:20 PM   #3
ғαιιοцт
High-roller
 
ғαιιοцт's Avatar
 
Join Date: Feb 2008
Posts: 1,702
Reputation: 188
Default Re: [INC] Fallout's New Menu Styles.

Quote:
Originally Posted by Maercell
Woowww... really nice!
Better than the normal menus.
Well done
thx Maercell
I hope it works good, i didn't find any bugs yet and let's keep it that way ><
ғαιιοцт is offline   Reply With Quote
Old 13/02/2009, 10:28 PM   #4
harrold
Huge Clucker
 
Join Date: Jan 2009
Posts: 260
Reputation: 0
Default Re: [INC] Fallout's New Menu Styles.

Good man i had the same idea xD
harrold is offline   Reply With Quote
Old 13/02/2009, 10:48 PM   #5
Jese
High-roller
 
Jese's Avatar
 
Join Date: Jul 2008
Location: Slovenia
Posts: 1,452
Reputation: 121
Default Re: [INC] Fallout's New Menu Styles.

Good work Fallout!
__________________
Jese is offline   Reply With Quote
Old 13/02/2009, 10:49 PM   #6
ғαιιοцт
High-roller
 
ғαιιοцт's Avatar
 
Join Date: Feb 2008
Posts: 1,702
Reputation: 188
Default Re: [INC] Fallout's New Menu Styles.

Quote:
Originally Posted by harrold
Good man i had the same idea xD
Quote:
Originally Posted by *Jesenice*
Good work Fallout!
ty
ғαιιοцт is offline   Reply With Quote
Old 13/02/2009, 10:52 PM   #7
Grove
Gangsta
 
Join Date: Jan 2007
Posts: 845
Reputation: 6
Default Re: [INC] Fallout's New Menu Styles.

They look nice, but what is wrong with the normal menus?
Grove is offline   Reply With Quote
Old 13/02/2009, 10:53 PM   #8
ғαιιοцт
High-roller
 
ғαιιοцт's Avatar
 
Join Date: Feb 2008
Posts: 1,702
Reputation: 188
Default Re: [INC] Fallout's New Menu Styles.

Quote:
Originally Posted by Jay_
They look nice, but what is wrong with the normal menus?
only 12 menu rows (or 13?) and this looks better (i think because you can make as many color combinations as you want)
ғαιιοцт is offline   Reply With Quote
Old 13/02/2009, 11:33 PM   #9
Kanji_Suzuki
Huge Clucker
 
Join Date: Jul 2008
Posts: 342
Reputation: 2
Default Re: [INC] Fallout's New Menu Styles.

wow love the look of it, well done
Kanji_Suzuki is offline   Reply With Quote
Old 14/02/2009, 12:54 AM   #10
Dinero
Little Clucker
 
Join Date: Dec 2008
Posts: 46
Reputation: 0
Default Re: [INC] Fallout's New Menu Styles.

Looks very cool man nice work!
Dinero is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [FS] Fallout's SpeedoMeter - Updated for 0.3! ғαιιοцт Filterscripts 209 20/09/2014 03:10 PM
[Include] [INC] Math functions [Updated - 02/08/2010] ettans Includes 21 28/09/2012 07:09 PM
help | Fallout new menu styles RonLipel_ Help Archive 2 10/07/2009 08:18 PM
Fallout new menu styles RonLipel_ Help Archive 0 10/07/2009 08:16 PM


All times are GMT. The time now is 10:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.