Raised This Month: $12 Target: $400
 3% 

[REQ] menu proprieties


Post New Thread Reply   
 
Thread Tools Display Modes
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-15-2017 , 13:27   Re: [REQ] menu proprieties
Reply With Quote #21

Quote:
Originally Posted by Depresie View Post
I was also thinking about strings
A native to retrieve how many times a string contains a character
Adding a param to return on what cells it is present would also be nice

PHP Code:
// Prototype
stroc(const string[], "c")

//Functionality
new iNumO stroc("cool shirt""o")
// iNumO would be equal to 2 in this case 
May I ask you, what is the reason for this to get implemented? Because you can simply use something like this:
PHP Code:
    new data[6], _dummycount
    menu_item_getinfo
(menuitem_dummydatacharsmax(data), .callback _dummy)
    for(new 
ii<charsmax(data); i++)
        if(
data[i] == 'o')
            
count++ 
Idk if you were trying to make a joke or what, but it is random and useless. And yes, maybe you want to use that function because this would be faster in a module, but in that case, I would like to get this: included into next update.
PHP Code:
stock Array_Find(item, array[], size) {
    for(new 
ii<sizei++)
        if(array[
i] == item)
            return 
i
    
return -1

because I use this in one of my plugins. anyways, no offence, just giving my thoughts on that one. And I support the page numeration idea.
__________________
retired chump

Last edited by DjSoftero; 02-01-2020 at 06:25. Reason: grammar
DjSoftero is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-22-2017 , 13:05   Re: [REQ] menu proprieties
Reply With Quote #22

We already have natives for strings that have less use than what i suggested
You just asked a stupid question, what about we also remove strlen since it can be easily done with a loop ? or charsmax ? or sizeof ?

Btw ocixcrom is right, adding proprieties for formatting would be more useful, for both item numbering and page numbering, ofc with the possibility of also removing them completely

An example

Code:
menu_setprop(iMenu, MENU_FORMATNUMBERING, "[ ^$ ]")
- >
[1] Item 1
[2] Item 2
[3] Item 3

menu_setprop(iMenu, MENU_FORMATNUMBERING, "^0")
->
Item 1
Item 2
Item 3

menu_setprop(iMenu, MENU_FORMATPAGES, "[ ^$ ]")
- >
Menu Title [ 1/2 ]

menu_setprop(iMenu, MENU_FORMATPAGES, "^0")
-> 
Menu Title
__________________

Last edited by Depresie; 12-22-2017 at 13:13.
Depresie is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-22-2017 , 14:55   Re: [REQ] menu proprieties
Reply With Quote #23

that`s not a reason to include it. if you want it so bad, just write your own module...
__________________
retired chump
DjSoftero is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-23-2017 , 02:40   Re: [REQ] menu proprieties
Reply With Quote #24

Quote:
Originally Posted by DjSoftero View Post
that`s not a reason to include it. if you want it so bad, just write your own module...
Give me a reason to not include it, and no i don't want it so bad, just thought it would be useful to have it included to the string natives
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-23-2017 , 03:36   Re: [REQ] menu proprieties
Reply With Quote #25

Quote:
Originally Posted by Depresie View Post
Give me a reason to not include it, and no i don't want it so bad, just thought it would be useful to have it included to the string natives
We don't need a native for each small thing. People need to learn and get used to doing basic stuff on their own.
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-23-2017 , 04:23   Re: [REQ] menu proprieties
Reply With Quote #26

All things included in the strings module could be called "small things" most of them even smaller..

Also, it was just a suggestion, it is not a priority, but implying that this is too basic/small to be included doesn't make any sense, since most of the strings natives are as "small" or even "smaller" than this, so in this case we could just remove the strings module
__________________

Last edited by Depresie; 12-23-2017 at 04:44.
Depresie is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-23-2017 , 18:44   Re: [REQ] menu proprieties
Reply With Quote #27

The only thing new menu system should receive is to deprecate menu_item_getinfo, and put all of it's arguments inside the menu handler callback function (as arguments). It was even discussed before I guess.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-27-2018 , 10:42   Re: [REQ] menu proprieties
Reply With Quote #28

I submitted a pull request for menu_getprop - https://github.com/alliedmodders/amxmodx/pull/507
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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

Forum Jump


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


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