-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow resources to retrieve the invoking resource of commands #3012
Open
Mycroft-Studios
wants to merge
1
commit into
citizenfx:master
Choose a base branch
from
SQ-Lab:add-resource-to-commands
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Mycroft-Studios
changed the title
feat: allow invoking resource for commands, to be read
feat: allow resources to retrieve the invoking resource of commands
Dec 17, 2024
github-actions
bot
added
triage
Needs a preliminary assessment to determine the urgency and required action
invalid
Requires changes before it's considered valid and can be (re)triaged
and removed
triage
Needs a preliminary assessment to determine the urgency and required action
labels
Dec 17, 2024
prikolium-cfx
added
enhancement
Feature or other request that adds functionality or improved usability
and removed
invalid
Requires changes before it's considered valid and can be (re)triaged
RedM
Issues/PRs related to RedM
labels
Jan 10, 2025
github-actions
bot
added
the
invalid
Requires changes before it's considered valid and can be (re)triaged
label
Jan 10, 2025
Thanks. And as a last step could you please squash your commits into one |
…_COMMANDS formatting(citicore/console): spaces instead of tab fix(citicore/console/Console.Commands.h): typo in template formatting(citicore): fix formatting from command commits tweak(citcore/console): improve function naming adjusted `getResource` to `GetResourceName` and `fromResource` to `MatchResourceName` fix(native-decls): GetRegisteredCommands showing wrong example data fix(citcore/console/CommandHelpers): correct issues from git push for some reason, pushing this change did some weird formatting tweak(native-decls): Adjust GET_REGISTERED_COMMANDS to show the correct data feat(native-decls): Add GET_RESOURCE_COMMANDS native This native allows resources to find commands registered by a specific resource feat(citizen-scripting-core): define resource in Command Object
Mycroft-Studios
force-pushed
the
add-resource-to-commands
branch
from
January 10, 2025 14:58
2ad5d20
to
27acc57
Compare
Done :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Feature or other request that adds functionality or improved usability
invalid
Requires changes before it's considered valid and can be (re)triaged
ready-to-merge
This PR is enqueued for merging
RedM
Issues/PRs related to RedM
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.
Goal of this PR
The goal of this PR is quite simple: allow resources to see which resource, registered which command.
This goal, was mainly sparked by a suggestion in txAdmin:
How is this PR achieving the goal
This PR achieves this by:
REGISTER_COMMAND
in the Command ObjectGetRegisteredCommands
GET_RESOURCE_COMMANDS
, that allows resources to retrieve the command list, from specific resources, allowing for much cleaner code.internal
for the resource.This PR applies to the following area(s)
FiveM, RedM, Server, Natives
Successfully tested on
Platforms: Windows
Checklist