Raised This Month: $32 Target: $400
 8% 

[REQ] menu proprieties


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-12-2017 , 10:39   [REQ] menu proprieties
Reply With Quote #1

Could you guys add a property to the new menu system to remove the feature which displays the number of pages at the end of the title ?

I'm talking about "Menu Title 1/2"

PHP Code:
menu_setprop(iMenuMPROP_COUNTPAGE0
__________________

Last edited by Depresie; 12-12-2017 at 11:08.
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2017 , 12:44   Re: [REQ] menu proprieties
Reply With Quote #2

Yes, please.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-12-2017 , 14:59   Re: [REQ] menu proprieties
Reply With Quote #3

Alrighty, added to TODO.

Last edited by klippy; 12-12-2017 at 14:59.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-12-2017 , 15:18   Re: [REQ] menu proprieties
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
Alrighty, added to TODO.
You the boss
__________________
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2017 , 15:30   Re: [REQ] menu proprieties
Reply With Quote #5

Can I use the same topic for another simple suggestion? Yes? Thanks.

Add a bool in the precache_model function to set whether the model being precached is a player model or anything else. If the bool is set to true, the function will check if a player model with a T.mdl file exists and will automatically precache that file if found. Also, if the string doesn't contain ".mdl" and the bool is set to true, it will automatically form the proper player model path, so the function can be used in three different ways:

PHP Code:
precache_model("models/some_model.mdl"// for regular models
precache_model("models/player/McDonalds/McDonalds.mdl"true// for player models (with path)
precache_model("McDonalds"true// for player models (without path) 
Not precaching T.mdl files can lead to server crash and most coders seem to forget about this when changing player models in plugins. Another variant can be adding a separate precache_player_model function. This is what I use:

PHP Code:
precache_player_model(szModel[])
{
    static 
szFile[128]
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel)
    
precache_model(szFile)
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl")
    
    if(
file_exists(szFile))
        
precache_model(szFile)

__________________

Last edited by OciXCrom; 12-12-2017 at 15:30.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 12-12-2017 , 16:32   Re: [REQ] menu proprieties
Reply With Quote #6

T models aren't only used by player models.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2017 , 17:18   Re: [REQ] menu proprieties
Reply With Quote #7

Hm, I've never seen any others, but if that's the case then it would be better if the function always checks for the existence of such a model and keep the bool's purpose as forming a player model path if only the model name is used.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-13-2017 , 01:54   Re: [REQ] menu proprieties
Reply With Quote #8

https://github.com/alliedmodders/amxmodx/pull/473
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-13-2017 , 11:52   Re: [REQ] menu proprieties
Reply With Quote #9

Quote:
Originally Posted by KliPPy View Post
I love you man

I know i may be forcing my luck, but could we have a couple more things added to the menus ?

For example
1. A menu property to not close a menu after selecting an option ( if possible )
2. A menu property to not number the options automatically

And most important i think it would be to have some forwards on menu_display and menu_destroy/menu_select
It is impossible to hook menu open/close atm without orpheu

I.e
PHP Code:
forward_menu_display(iMenuiTotalItems)
forward_menu_select(iMenuiItemNumber)
forward_menu_destroy(iMenuiTotalItems
__________________

Last edited by Depresie; 12-13-2017 at 11:56.
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-13-2017 , 12:44   Re: [REQ] menu proprieties
Reply With Quote #10

Quote:
Originally Posted by Depresie View Post
PHP Code:
forward_menu_display(iMenuiTotalItems)
forward_menu_select(iMenuiItemNumber)
forward_menu_destroy(iMenuiTotalItems
id is the most important parameter that will be needed in this kind of forwards. The total items number can still be retrieved using menu_getprop. Oh, wait... Guys, where is menu_getprop?!
__________________

Last edited by OciXCrom; 12-13-2017 at 12:45.
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 18:23.


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