AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   [REQ] menu proprieties (https://forums.alliedmods.net/showthread.php?t=303560)

Depresie 12-12-2017 10:39

[REQ] menu proprieties
 
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


OciXCrom 12-12-2017 12:44

Re: [REQ] menu proprieties
 
Yes, please.

klippy 12-12-2017 14:59

Re: [REQ] menu proprieties
 
Alrighty, added to TODO.

Depresie 12-12-2017 15:18

Re: [REQ] menu proprieties
 
Quote:

Originally Posted by KliPPy (Post 2565845)
Alrighty, added to TODO.

You the boss

OciXCrom 12-12-2017 15:30

Re: [REQ] menu proprieties
 
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)



PRoSToTeM@ 12-12-2017 16:32

Re: [REQ] menu proprieties
 
T models aren't only used by player models.

OciXCrom 12-12-2017 17:18

Re: [REQ] menu proprieties
 
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.

klippy 12-13-2017 01:54

Re: [REQ] menu proprieties
 
https://github.com/alliedmodders/amxmodx/pull/473

Depresie 12-13-2017 11:52

Re: [REQ] menu proprieties
 
Quote:

Originally Posted by KliPPy (Post 2565908)

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


OciXCrom 12-13-2017 12:44

Re: [REQ] menu proprieties
 
Quote:

Originally Posted by Depresie (Post 2566001)
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?!


All times are GMT -4. The time now is 16:29.

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