Add partial prototypes, for defining and modifying prototype data with the same ID in different files - #6923
Add partial prototypes, for defining and modifying prototype data with the same ID in different files#6923DrSmugleaf wants to merge 5 commits into
Conversation
…h the same ID in different files
|
|
||
| public override void LoadDefaultPrototypes(Dictionary<Type, HashSet<string>>? changed = null) | ||
| { | ||
| PartialDirectory(new ResPath("/Prototypes/_Afterlight/")); |
| bool TryGetRandom<T>(IRobustRandom random, [NotNullWhen(true)] out IPrototype? prototype) where T : class, IPrototype; | ||
|
|
||
| /// <summary> | ||
| /// Like <see cref="PartialDirectory"/>, but only for a single file. |
There was a problem hiding this comment.
Convention is no indent on xmldoc.
|
should have a distinct syntax (probably partialType instead of type) so its easy to rg, as well as always being an error if a non-partial one doesnt exist by default imo. otherwise the lazy way of doing it for 99% of usecases results in broken prototypes that might survive yml linter |
One of the big things this is trying to fix is porting YML between downstreams being mighty annoying, if it always threw an error that would still be almost as annoying |
Doc bible attached
For downstreams of downstreams, you can specify the load order:
Or
Non partial directories are loaded before any partial ones.
Examples:
Add three loadouts and remove one:
Remove a component and remove a spawned from Butcherable:
To make it not add the prototype if the original one does not exist or is later removed: