[Include] iMenu.inc | Clickable TextDraw Menus | CS Buy Menu Style
#1

iMenu.inc
v1.2

by iAmir
Start and Informations

Clickable TextDraw menu , designed with iPLEOMAX's TextDraw Editor .
it can be used for shops , inventories , team selections in TDM or anything else,
Thanks for your support.


Video

Click on meh



Screen Shots :




Change log:
Код:
15/10/2017 - v1.2
  • Added function iMenu_RemoveItem to remove items
  • Added function iMenu_SetDefaultPreview
19/06/2017 - v1.1
  • Increased item limits per menu up to 16 !
  • Added parameters to able change colors of different parts
  • Added new parameter 'modelid' to 'iMenuPlayerResponse'
07/06/2017 - v1
Released
Functions and details
PHP код:

stock iMenu_ShowForPlayer
(playerid im_menuid im_caption[] , framecolor 128 headercolor 128 bordercolor = -5963521 captioncolor = -5963521 buttoncolor 255 mainbuttontextcolor 0xFFFFFFFF noprevtextcolor 0xFFFFFFFF)
// It shows the frame and some datils of menu and makes it ready to add items
// playerid - ID of Player
// im_menuid - ID of menu (you can define)
// im_caption - caption of menu , like in screen shots and the video
// framecolor - Info in Tutorials of Colors
// headercolor - Info in Tutorials of Colors
// bordercolor - Info in Tutorials of Colors
// captioncolor - Info in Tutorials of Colors
// buttoncolor - Info in Tutorials of Colors
// mainbuttontextcolor - Info in Tutorials of Colors
// noprevtextcolor - Info in Tutorials of Colors 
PHP код:
stock iMenu_AddItem(playerid im_item_number im_item_string[] , im_description[] , im_preview_model = -Float:im_rx 0.0 Float:im_ry 0.0 Float:im_rz 0.0 Float:im_zoom 1.0 itemtextcolor=0xFFFFFFFF ,desc_col=-5963521previewbg 255 vehcol1=-vehcol2=-1)
// adds items up to 12 
// playerid - ID of player
// im_item_number - the number of item which is from 0 to 12
// im_item_string - the text or caption of item 
// im_description - description of this item (like in screen shots and the video)
// im_preview_model - ID of object for showing in a box for this item (can be blank not be used then it shows NO PREVIEW )
// Float:im_rx - Rot X if this item uses preview model
// Float:im_ry - Rot Y if this item uses preview model
// Float:im_rz - Rot Z if this item uses preview model
// Float:im_zoom - Zoom if this item uses preview model
// itemtextcolor - Info in Tutorials of Colors
// desc_col - Info in Tutorials of Colors
// previewbg - Info in Tutorials of Colors
// vehcol1 - Info in Tutorials of Colors
// vehcol2 - Info in Tutorials of Colors 
PHP код:

stock iMenu_HideForPlayer
(playerid)
//Hides menu 
// playerid - ID of player 
PHP код:

stock iMenu_SetDefaultPreview
(playerid im_preview_model = -Float:im_rx 0.0 Float:im_ry 0.0 Float:im_rz 0.0 Float:im_zoom 1.0 previewbg 255 vehcol1=-vehcol2=-1)
// to set default preview model before selecting any items
// playerid - ID of player
// im_preview_model - ID of object for showing in the box
// Float:im_rx - Rot X if this item uses preview model
// Float:im_ry - Rot Y if this item uses preview model
// Float:im_rz - Rot Z if this item uses preview model
// Float:im_zoom - Zoom if this item uses preview model
// previewbg - Info in Tutorials of Colors
// vehcol1 - Info in Tutorials of Colors
// vehcol2 - Info in Tutorials of Colors 
PHP код:

stock iMenu_RemoveItem
(playerid im_item_number)
// removes a specific item
// playerid - ID of player
// im_item_number - Item Number 

Callbacks
[PHP]


PHP код:

public iMenuPlayerSelectItem(playerid im_item)
// Call when player clicks on an item
// playerid - ID of Player
// im_item - Selected item 
PHP код:

public iMenuPlayerResponse(playerid imenuid itemid modelid)
// Call when player clicks on Select while he already selected an item
// playerid - ID of player
// imenuid - ID of menu
// itemid - ID of selected item
// modelid - Model id of preview model object of selected item 
Tutorials for colors:



  • 1 - headercolor - Color of header
  • 2 - captioncolor - Color of caption text
  • 3 - itemtextcolor - Color of item text
  • 4 - buttoncolor - Color of button background including Select , Cancel , and Item buttons
  • 5 - framecolor - Color of main frame
  • 6 - previewbg - Color of preview model background
  • 7 - bordercolor - Color of main borders of buttons and preview model box
  • 8 - desc_col - Color of description text under the preview model box
  • 9 - mainbuttontextcolor - Color of Select and Cancel buttons
  • 10 - noprevtextcolor - Color of 'NO PREVIEW' text
  • 11 - vehcol1 - First color of vehicle (only works if object model is a vehicle)
  • 12 - vehcol2 - Second color of vehicle (only works if object model is a vehicle)
Downloads

New
iMenu.inc v1.2 : Pastebin

Old(s)
iMenu.inc v1.1 : Pastebin.com
example : Pastebin.com

iMenu.inc v1 : Pastebin.com
example : Pastebin.com



Credits
iPLEOMAX - for his edtior
Me - for scripting this include
Reply
#2

Not bad.
Reply
#3

Good job,would be nice if you provide how to change the colors.
Reply
#4

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Not bad.
Would be nice if you share any idea that can make it better and more useful cause I'm not actually creative


Quote:
Originally Posted by Dice_
Посмотреть сообщение
Good job,would be nice if you provide how to change the colors.
I'll add this feature for next update and add parameters for changing colors from default to everything you like
Reply
#5

Cool textdraws.
Reply
#6

Nice
Reply
#7

Cool, my suggestion is to add paginations so you will have a higher limit for menu items not only 12.
Reply
#8

guud
Reply
#9

Great work.
Reply
#10

Quote:
Originally Posted by X337
Посмотреть сообщение
Cool, my suggestion is to add paginations so you will have a higher limit for menu items not only 12.
Yeah , I will add pagination

Quote:
Originally Posted by coool
Посмотреть сообщение
guud
Quote:
Originally Posted by SyS
Посмотреть сообщение
Nice
Quote:
Originally Posted by JesusChrysler
Посмотреть сообщение
Great work.
Thank y'all
Reply
#11

Hello! You must add function iMenu_AddItem new arguments to adjust the width and height of the images.

It would also be cool to increase the limit of menu items from 12 to 16 or best of all dynamic value.
Reply
#12

New Update ...

Change log:
Код:
19/06/2017 - v1.1
  • Increased item limits per menu up to 16 !
  • Added parameters to able change colors of different parts
  • Added new parameter 'modelid' to 'iMenuPlayerResponse'


  • 1 - headercolor - Color of header
  • 2 - captioncolor - Color of caption text
  • 3 - itemtextcolor - Color of item text
  • 4 - buttoncolor - Color of button background including Select , Cancel , and Item buttons
  • 5 - framecolor - Color of main frame
  • 6 - previewbg - Color of preview model background
  • 7 - bordercolor - Color of main borders of buttons and preview model box
  • 8 - desc_col - Color of description text under the preview model box
  • 9 - mainbuttontextcolor - Color of Select and Cancel buttons
  • 10 - noprevtextcolor - Color of 'NO PREVIEW' text
  • 11 - vehcol1 - First color of vehicle (only works if object model is a vehicle)
  • 12 - vehcol2 - Second color of vehicle (only works if object model is a vehicle)
Reply
#13

Nice update mate,i will use this include.
Reply
#14

Good Job with this include.
Reply
#15

I have a Doubt
PHP код:
// im_preview_model - ID of object for showing in a box for this item (can be blank not be used then it shows NO PREVIEW ) 
skin ids start from 0.....256
weapon ids also 0....256

so what we should add there for the difference in weapon and skin ??
Reply
#16

Take a look at how Texture Studio handles menus I think you will find it interesting.

https://github.com/Pottus/Texture-St...ts/tstudio/gui
https://github.com/Pottus/Texture-St...io/menugui.pwn
https://github.com/Pottus/Texture-St...o/menudata.pwn

I still consider this whole system as incomplete but it would have the ability to handle a system like this just some ideas for you.
Reply
#17

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Take a look at how Texture Studio handles menus I think you will find it interesting.

https://github.com/Pottus/Texture-St...ts/tstudio/gui
https://github.com/Pottus/Texture-St...io/menugui.pwn
https://github.com/Pottus/Texture-St...o/menudata.pwn

I still consider this whole system as incomplete but it would have the ability to handle a system like this just some ideas for you.
still dint get answer to my question
Reply
#18

Quote:
Originally Posted by bugmenotlol
Посмотреть сообщение
still dint get answer to my question
I was replying to the thread as there is no quote.
Reply
#19

Quote:
Originally Posted by bugmenotlol
Посмотреть сообщение
I have a Doubt
PHP код:
// im_preview_model - ID of object for showing in a box for this item (can be blank not be used then it shows NO PREVIEW ) 
skin ids start from 0.....256
weapon ids also 0....256

so what we should add there for the difference in weapon and skin ??
Weapon IDs are different with Weapon Object IDs , and also Skin IDs are between 0 and 311 and weapon IDs are between 0 and 46 , (other IDs are not weapons ! and don't have object IDs)

https://sampwiki.blast.hk/wiki/Skins:All
https://sampwiki.blast.hk/wiki/Weapons


Quote:
Originally Posted by Pottus
Посмотреть сообщение
Take a look at how Texture Studio handles menus I think you will find it interesting.

https://github.com/Pottus/Texture-St...ts/tstudio/gui
https://github.com/Pottus/Texture-St...io/menugui.pwn
https://github.com/Pottus/Texture-St...o/menudata.pwn

I still consider this whole system as incomplete but it would have the ability to handle a system like this just some ideas for you.
Thanks ! I will take a look.
And surely I'm gonna make it better in my free times which is less than the needed time to work
Reply
#20

Good one. +4
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)