Menu.AddItem Formatting
Have you ever been annoyed like I have at the fact that when you are adding items to a menu, you can't format what is displayed?
What I mean by this is when you do something like: PHP Code:
I present to you... Menu.AddItemFormat! PHP Code:
Here is an example of this being used in a plugin: PHP Code:
EDIT: I just noticed that this function pretty much exists with this include https://forums.alliedmods.net/showthread.php?t=265325 Use this version if you prefer using methodmaps. |
Re: Menu.AddItem Formatting
Modifying menus.inc, or any existing sourcemod include, sounds like a bad idea. Instead I'd consider making your own MethodMap that inherits from Menu and adds the function you want in your own custom include.
|
Re: Menu.AddItem Formatting
Maybe Menu's various natives could be made into format-class functions in stock Sourcemod? I'll poke some people on the IRC channel to see if this is feasible.
|
Re: Menu.AddItem Formatting
That seems like a good alternative to this:
PHP Code:
|
Re: Menu.AddItem Formatting
Quote:
|
Re: Menu.AddItem Formatting
Quote:
|
Re: Menu.AddItem Formatting
Adding format functionality to the existing .AddItem native seems reasonable as it would be backwards compatible with existing plugins
|
Re: Menu.AddItem Formatting
Quote:
Format-class functions exist across Sourcemod. From the various PrintTo*() functions, KickClient, ServerCommand, ClientCommand, ShowActivity, BuildPath, the logging functions, etc are all examples of this. We combine the formatting into the function for convenience. There is an ongoing discussion in the Sourcemod Discord/IRC server about this, and the potential issues. |
Re: Menu.AddItem Formatting
Quote:
|
Re: Menu.AddItem Formatting
Quote:
|
All times are GMT -4. The time now is 19:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.