feat(api): Add CreateMenu API function#24
Merged
Rushaway merged 8 commits intosrcdslab:masterfrom Mar 3, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the SM JSON API plugin to support creating SourceMod menus from JSON payloads, enabling external integrations (e.g., Torchlight !search) to present results as an in-game menu.
Changes:
- Added a new API function
API_CreateMenuplus a menu callback that publishes anOnMenuSelectforward event. - Extended request argument handling to accept JSON objects as function arguments and echo them back in the response args.
- Bumped plugin version to
1.1.0.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
addons/sourcemod/scripting/include/API.inc |
Adds the new menu-creation API and menu selection publish callback. |
addons/sourcemod/scripting/SMJSONAPI.sp |
Adds JSON object argument support in the dynamic request function argument handler. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is mainly made to make Torchlight !search command work with a menu