Skip to content
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

Add Command.cmdset_source #3342

Merged
merged 1 commit into from Dec 2, 2023
Merged

Add Command.cmdset_source #3342

merged 1 commit into from Dec 2, 2023

Conversation

volundmush
Copy link
Contributor

Brief overview of PR changes/additions

This simply modifies CmdSet.add() to stamp each newly added command with cmd.cmdset_source = self

So, Commands now know EXACTLY which CmdSet they came from.

Motivation for adding to Evennia

This allows a Command to reference properties, methods, state, etc, on their CmdSet, which can be useful in a number of ways.

See, for instance, creating a kind of pseudo-menu which is aware of all of the commands available to the 'menu'.

Other info (issues closed, discussion etc)

This is such a tiny - but useful - change, it doesn't appear to cause any issues.

Copy link
Member

@Griatch Griatch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the use of cmdsets for data storage. But I like the notion of storing the source-cmdset on the cmd for debug purposes. This may be useful in combination with expanding the examine command to show where each available cmd is actually coming from.

@Griatch Griatch merged commit 4857f93 into evennia:main Dec 2, 2023
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants