diff --git a/Nautilus/Assets/Gadgets/GadgetExtensions.cs b/Nautilus/Assets/Gadgets/GadgetExtensions.cs index ed2a696ca..25230270b 100644 --- a/Nautilus/Assets/Gadgets/GadgetExtensions.cs +++ b/Nautilus/Assets/Gadgets/GadgetExtensions.cs @@ -155,6 +155,48 @@ public static ScanningGadget SetPdaGroupCategoryBefore(this ICustomPrefab custom return scanningGadget.WithPdaGroupCategoryBefore(group, category, target); } + /// + /// Adds this item into a blueprint category to appear in. + /// + /// The custom prefab to add unlocks to. + /// The main group in the PDA blueprints where this item appears. + /// The category within the group in the PDA blueprints where this item appears. + /// It will be added after this target item or at the end if not found. + /// An instance to the created to continue the scanning settings on. + /// If the specified is a tech group that is present in the list, this item will automatically + /// become buildable. To avoid this, or make this item a buildable manually, use the method. + public static ScanningGadget SetPdaGroupCategoryAfter(this ICustomPrefab customPrefab, TechGroup group, TechCategory category, TechType target) + { + if (!customPrefab.TryGetGadget(out ScanningGadget scanningGadget)) + { + scanningGadget = new ScanningGadget(customPrefab, TechType.None); + customPrefab.AddGadget(scanningGadget); + } + + return scanningGadget.WithPdaGroupCategoryAfter(group, category, target); + } + + /// + /// Adds this item into a blueprint category to appear in. + /// + /// The custom prefab to add unlocks to. + /// The main group in the PDA blueprints where this item appears. + /// The category within the group in the PDA blueprints where this item appears. + /// It will be inserted before this target item or at the beginning if not found. + /// An instance to the created to continue the scanning settings on. + /// If the specified is a tech group that is present in the list, this item will automatically + /// become buildable. To avoid this, or make this item a buildable manually, use the method. + public static ScanningGadget SetPdaGroupCategoryBefore(this ICustomPrefab customPrefab, TechGroup group, TechCategory category, TechType target) + { + if (!customPrefab.TryGetGadget(out ScanningGadget scanningGadget)) + { + scanningGadget = new ScanningGadget(customPrefab, TechType.None); + customPrefab.AddGadget(scanningGadget); + } + + return scanningGadget.WithPdaGroupCategoryBefore(group, category, target); + } + /// /// Sets the type of equipment slot this item can fit into. ///