Repository navigation
Let custom item types behave as starting materials or equipment - #2205
Draft
jbouquiaux wants to merge 3 commits into
Draft
jbouquiaux wants to merge 3 commits into
jbouquiaux wants to merge 3 commits into
Conversation
Custom item types inheriting from StartingMaterial or Equipment can declare datalab_behave_as to be listed with, and share the inventory permissions of, that built-in type. INVENTORY_TYPES becomes a set that registration extends, and /info/types exposes the hint. Without the hint, behaviour is unchanged.
Custom types with the hint are registered as inventory/equipment types, offered in the matching create dialog, added to the right list on creation, and included in item searches for the built-in type they behave as.
jbouquiaux
marked this pull request as draft
October 9, 2026 13:20
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2205 +/- ##
==========================================
+ Coverage 82.48% 82.53% +0.05%
==========================================
Files 91 91
Lines 8782 8797 +15
==========================================
+ Hits 7244 7261 +17
+ Misses 1538 1536 -2
🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Follow up on #2204
Plugins can already define custom item types that subclass
StartingMaterialorEquipment, but in practice those types still behave like samples: they show up on the Samples page and are private to whoever created them. That's because the core decides listings and permissions from type strings ("starting_materials","equipment"), so a subclass with its own type never matches.This PR lets a plugin opt in to the behaviour of the built-in type it extends:
With the hint,
Precursoritems are listed and created from the Starting Materials page, are shared like inventory (no owner, visible to everyone or restricted to groups, followingUNGROUPED_INVENTORY), and show up in item pickers that search for starting materials. Equipment works the same way.