Skip to content

Add on and this Toolshed Commands#1049

Open
ishkab wants to merge 2 commits into
ProjectOmu:masterfrom
ishkab:onmap
Open

Add on and this Toolshed Commands#1049
ishkab wants to merge 2 commits into
ProjectOmu:masterfrom
ishkab:onmap

Conversation

@ishkab

@ishkab ishkab commented May 31, 2026

Copy link
Copy Markdown
Contributor

About the PR

This PR adds two Toolshed commands (8 total subcommands) for filtering entities based on map or grid predicates. All six subcommands of on are invertible with the usual not construction. These are mainly convenience functions for administration.

  • on:grid <gridid> filters an IEnumerable to only those entities that are on the grid with the ID given.
  • on:thisgrid filters an IEnumerable to only those entities that are on the same grid as the invoker.
  • on:gridof <ent> filters an IEnumerable to only those entities that are on the same grid as the entity given.
  • on:map <mapid> filters an IEnumerable to only those entities that are on the map with the ID given.
  • on:thismap filters an IEnumerable to only those entities that are on the same map as the invoker.
  • on:mapof <ent> filters an IEnumerable to only those entities that are on the same map as the entity given.
  • this:grid returns the grid that the invoker is on.
  • this:map returns the ID of the map that the invoker is on.

Why / Balance

  • These are Toolshed filters that I personally want.
  • They may be generally useful to anyone who uses Toolshed, e.g. in execs. With on:thisgrid, one can easily target only entities on-station, for instance.
  • Mappers should find the on command useful for removing stray grids created in error during the mapping process, as in entities on:thismap with MapGrid not with BecomesStation delete.

Technical details

I originally implemented this way out of code style with the rest of the repo. I think the code is less readable now, but it conforms.

I added OnCommand and ThisCommand along with three Toolshed errors. The commands require DEBUG permission.

Requirements

Breaking changes

I tested this very briefly and found it to be in enough of a working order to PR. If bugs are discovered, they should be strictly contained to the execution of the commands - a situation which makes for easy avoidance until a patch can be issued.

@github-actions github-actions Bot added the S: Untriaged Has not been set a status; currently not labeled. label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S: Untriaged Has not been set a status; currently not labeled. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants