zephyrus-store-preview-new-syntax icon indicating copy to clipboard operation
zephyrus-store-preview-new-syntax copied to clipboard

Made commands customizable

Open azalty opened this issue 2 years ago • 3 comments

This PR makes commands customizable through cvars. Not sure if not updating the .cfg file could be a problem, or if the plugin would just use the default values in this case.

Up to 10 commands are allowed for each command callback (store, inventory...), each command having a maximum length of 60 bytes. Feel free to modify that if you want to.

The zephstocks.inc's cvar value max string size was doubled (128 -> 256) in order to allow more commands.

This change could break plugins that try to run store commands through the console (with ServerCommand()) before configs are loaded, and on the initial load. It is a very specific case, but I guess it could happen, so I'm warning anyway.

This PR implies big changes and should be heavily tested before it is accepted as it could break other things, and render the plugin unusable (if bugged).

✅ Compiles fine ✅ Tested in game, and working

azalty avatar Feb 23 '23 23:02 azalty

Apart from that, implementing kidfearless' convar include could be useful, as it would allow for longer convar descriptions, and auto-refreshing of the cvars file (instead of having to regenerate it).

Auto-exec config has its drawbacks, being that you can't update or remove cvars with it, but only add some. (which isn't the case with kidfearless' Auto-Exec-Config-Class)

Implementing kidfearless' thing might require some changes to the code however. We could keep the current caching system if we're lazy.

azalty avatar Feb 23 '23 23:02 azalty

Found bugs with this PR, currently testing and fixing

azalty avatar May 03 '23 16:05 azalty

Seems to be working from my limited testing. I advise testing by yourselves

azalty avatar May 03 '23 21:05 azalty