diff --git a/Content.Client/Lathe/UI/LatheMenu.xaml.cs b/Content.Client/Lathe/UI/LatheMenu.xaml.cs index 02464d22e124..b333f6699e7e 100644 --- a/Content.Client/Lathe/UI/LatheMenu.xaml.cs +++ b/Content.Client/Lathe/UI/LatheMenu.xaml.cs @@ -94,8 +94,23 @@ public void PopulateRecipes() if (!_prototypeManager.TryIndex(recipe, out var proto)) continue; - if (CurrentCategory != null && proto.Category != CurrentCategory) - continue; + // Category filtering + if (CurrentCategory != null) + { + if (proto.Categories.Count <= 0) + continue; + + bool validRecipe = false; + foreach (var category in proto.Categories) + if (category == CurrentCategory) + { + validRecipe = true; + break; + } + + if (!validRecipe) + continue; + } if (SearchBar.Text.Trim().Length != 0) { @@ -179,18 +194,22 @@ private string GenerateTooltipText(LatheRecipePrototype prototype) public void UpdateCategories() { + // Get categories from recipes var currentCategories = new List>(); foreach (var recipeId in Recipes) { var recipe = _prototypeManager.Index(recipeId); - if (recipe.Category == null) + if (recipe.Categories.Count <= 0) continue; - if (currentCategories.Contains(recipe.Category.Value)) - continue; + foreach (var category in recipe.Categories) + { + if (currentCategories.Contains(category)) + continue; - currentCategories.Add(recipe.Category.Value); + currentCategories.Add(category); + } } if (Categories != null && (Categories.Count == currentCategories.Count || !Categories.All(currentCategories.Contains))) diff --git a/Content.Shared/Research/Prototypes/LatheRecipePrototype.cs b/Content.Shared/Research/Prototypes/LatheRecipePrototype.cs index 0fabbd671669..e95760b698d2 100644 --- a/Content.Shared/Research/Prototypes/LatheRecipePrototype.cs +++ b/Content.Shared/Research/Prototypes/LatheRecipePrototype.cs @@ -66,9 +66,9 @@ public sealed partial class LatheRecipePrototype : IPrototype, IInheritingProtot public bool ApplyMaterialDiscount = true; /// - /// A category used for visually sorting lathe recipes in the UI. + /// List of categories used for visually sorting lathe recipes in the UI. /// [DataField] - public ProtoId? Category; + public List> Categories = new(); } } diff --git a/Resources/Prototypes/Recipes/Lathes/Parts.yml b/Resources/Prototypes/Recipes/Lathes/Parts.yml index 0202919cb9a7..895c31eee2a1 100644 --- a/Resources/Prototypes/Recipes/Lathes/Parts.yml +++ b/Resources/Prototypes/Recipes/Lathes/Parts.yml @@ -2,7 +2,8 @@ - type: latheRecipe abstract: true id: BasePartRecipe - category: Parts + categories: + - Parts completetime: 2 materials: Steel: 300 diff --git a/Resources/Prototypes/Recipes/Lathes/biogen.yml b/Resources/Prototypes/Recipes/Lathes/biogen.yml index 4f8887a130d0..60ff298911c9 100644 --- a/Resources/Prototypes/Recipes/Lathes/biogen.yml +++ b/Resources/Prototypes/Recipes/Lathes/biogen.yml @@ -1,7 +1,8 @@ - type: latheRecipe id: BioGenMonkeyCube result: MonkeyCube - category: Food + categories: + - Food completetime: 3 materials: Biomass: 70 @@ -9,7 +10,8 @@ - type: latheRecipe id: BioGenKoboldCube result: KoboldCube - category: Food + categories: + - Food completetime: 3 materials: Biomass: 70 @@ -17,7 +19,8 @@ - type: latheRecipe id: BioGenMaterialCloth1 result: MaterialCloth1 - category: Materials + categories: + - Materials icon: sprite: Objects/Materials/materials.rsi state: cloth @@ -28,7 +31,8 @@ - type: latheRecipe id: BioGenMaterialCardboard1 result: MaterialCardboard1 - category: Materials + categories: + - Materials icon: sprite: Objects/Materials/materials.rsi state: cardboard @@ -39,7 +43,8 @@ - type: latheRecipe id: BioGenPaper result: Paper - category: Materials + categories: + - Materials completetime: 1 materials: Biomass: 2 @@ -47,7 +52,8 @@ - type: latheRecipe id: BioGenPaperRolling1 result: PaperRolling1 - category: Materials + categories: + - Materials completetime: 1 materials: Biomass: 1 @@ -55,7 +61,8 @@ - type: latheRecipe id: BioGenCandle result: Candle - category: Materials + categories: + - Materials completetime: 3 materials: Biomass: 3 @@ -64,7 +71,8 @@ id: BioGenPlantBGone resultReagents: PlantBGone: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Tools/Hydroponics/sprays.rsi state: plantbgone @@ -76,7 +84,8 @@ id: BioGenWeedKiller resultReagents: WeedKiller: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Tools/Hydroponics/sprays.rsi state: weedspray @@ -88,7 +97,8 @@ id: BioGenPestKiller resultReagents: PestKiller: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Tools/Hydroponics/sprays.rsi state: weedspray @@ -100,7 +110,8 @@ id: BioGenLeft4Zed resultReagents: Left4Zed: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Specific/Chemistry/bottle.rsi state: bottle-1 @@ -112,7 +123,8 @@ id: BioGenEZNutrient resultReagents: EZNutrient: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Specific/Chemistry/bottle.rsi state: bottle-1 @@ -124,7 +136,8 @@ id: BioGenRobustHarvest resultReagents: RobustHarvest: 10 - category: Chemicals + categories: + - Chemicals icon: sprite: Objects/Specific/Chemistry/bottle.rsi state: bottle-1 @@ -136,7 +149,8 @@ id: BioGenMilk resultReagents: Milk: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Drinks/milk.rsi state: icon @@ -148,7 +162,8 @@ id: BioGenMilkSoy resultReagents: MilkSoy: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Drinks/soymilk.rsi state: icon @@ -160,7 +175,8 @@ id: BioGenEthanol resultReagents: Ethanol: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Drinks/glass_clear.rsi state: icon @@ -172,7 +188,8 @@ id: BioGenCream resultReagents: Cream: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Drinks/cream.rsi state: icon @@ -184,7 +201,8 @@ id: BioGenBlackpepper resultReagents: Blackpepper: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Food/condiments.rsi state: packet-pepper @@ -196,7 +214,8 @@ id: BioGenEnzyme resultReagents: Enzyme: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Food/condiments.rsi state: bottle-empty @@ -208,7 +227,8 @@ id: BioGenFlour resultReagents: Flour: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Food/ingredients.rsi state: flour-big @@ -220,7 +240,8 @@ id: BioGenSugar resultReagents: Sugar: 10 - category: Food + categories: + - Food icon: sprite: Objects/Consumable/Food/ingredients.rsi state: sugar-big diff --git a/Resources/Prototypes/Recipes/Lathes/devices.yml b/Resources/Prototypes/Recipes/Lathes/devices.yml index 5d7c649cdeba..4ccc7f329ea4 100644 --- a/Resources/Prototypes/Recipes/Lathes/devices.yml +++ b/Resources/Prototypes/Recipes/Lathes/devices.yml @@ -43,7 +43,8 @@ - type: latheRecipe id: ExplosivePayload result: ExplosivePayload - category: Weapons + categories: + - Weapons completetime: 4 materials: Steel: 100 @@ -73,7 +74,8 @@ - type: latheRecipe id: AnomalyLocator result: AnomalyLocatorEmpty - category: Tools + categories: + - Tools completetime: 3 materials: Steel: 400 @@ -82,7 +84,8 @@ - type: latheRecipe id: AnomalyLocatorWide result: AnomalyLocatorWideEmpty - category: Tools + categories: + - Tools completetime: 3 materials: Steel: 400 @@ -99,7 +102,8 @@ - type: latheRecipe id: WeaponPistolCHIMP result: WeaponPistolCHIMP - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 500 @@ -108,7 +112,8 @@ - type: latheRecipe id: WeaponGauntletGorilla result: WeaponGauntletGorilla - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 1500 @@ -153,7 +158,8 @@ - type: latheRecipe id: WeaponForceGun result: WeaponForceGun - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 500 @@ -172,7 +178,8 @@ - type: latheRecipe id: WeaponProtoKineticAccelerator result: WeaponProtoKineticAccelerator - category: Weapons + categories: + - Weapons completetime: 5 materials: Steel: 1000 @@ -182,7 +189,8 @@ - type: latheRecipe id: WeaponTetherGun result: WeaponTetherGun - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 500 @@ -192,7 +200,8 @@ - type: latheRecipe id: WeaponGrapplingGun result: WeaponGrapplingGun - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 500 diff --git a/Resources/Prototypes/Recipes/Lathes/electronics.yml b/Resources/Prototypes/Recipes/Lathes/electronics.yml index 5e51dec195aa..3f95d43ce9a8 100644 --- a/Resources/Prototypes/Recipes/Lathes/electronics.yml +++ b/Resources/Prototypes/Recipes/Lathes/electronics.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseElectronicsRecipe - category: Circuitry + categories: + - Circuitry completetime: 2 materials: Steel: 100 diff --git a/Resources/Prototypes/Recipes/Lathes/mech_parts.yml b/Resources/Prototypes/Recipes/Lathes/mech_parts.yml index db7443256cd3..1f12a6c03820 100644 --- a/Resources/Prototypes/Recipes/Lathes/mech_parts.yml +++ b/Resources/Prototypes/Recipes/Lathes/mech_parts.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseMechPartRecipe - category: Mech + categories: + - Mech completetime: 10 # Recipes diff --git a/Resources/Prototypes/Recipes/Lathes/medical.yml b/Resources/Prototypes/Recipes/Lathes/medical.yml index 08250290ec78..c5ffc5a6e06f 100644 --- a/Resources/Prototypes/Recipes/Lathes/medical.yml +++ b/Resources/Prototypes/Recipes/Lathes/medical.yml @@ -75,7 +75,8 @@ - type: latheRecipe id: HandheldHealthAnalyzer result: HandheldHealthAnalyzerEmpty - category: Tools + categories: + - Tools completetime: 4 materials: Glass: 500 diff --git a/Resources/Prototypes/Recipes/Lathes/misc.yml b/Resources/Prototypes/Recipes/Lathes/misc.yml index a9ae608674ef..f93745208b80 100644 --- a/Resources/Prototypes/Recipes/Lathes/misc.yml +++ b/Resources/Prototypes/Recipes/Lathes/misc.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseLightRecipe - category: Lights + categories: + - Lights completetime: 2 materials: Steel: 50 diff --git a/Resources/Prototypes/Recipes/Lathes/powercells.yml b/Resources/Prototypes/Recipes/Lathes/powercells.yml index 82c7b96affa9..d35085084f7e 100644 --- a/Resources/Prototypes/Recipes/Lathes/powercells.yml +++ b/Resources/Prototypes/Recipes/Lathes/powercells.yml @@ -1,7 +1,8 @@ - type: latheRecipe id: PowerCellSmall result: PowerCellSmallPrinted - category: Parts + categories: + - Parts completetime: 1 materials: Steel: 100 @@ -10,7 +11,8 @@ - type: latheRecipe id: PowerCellMedium result: PowerCellMediumPrinted - category: Parts + categories: + - Parts completetime: 6 materials: Steel: 300 @@ -21,7 +23,8 @@ - type: latheRecipe id: PowerCellHigh result: PowerCellHighPrinted - category: Parts + categories: + - Parts completetime: 10 materials: Steel: 300 @@ -32,7 +35,8 @@ - type: latheRecipe id: PowerCellMicroreactor result: PowerCellMicroreactorPrinted - category: Parts + categories: + - Parts completetime: 10 materials: Steel: 500 diff --git a/Resources/Prototypes/Recipes/Lathes/robotics.yml b/Resources/Prototypes/Recipes/Lathes/robotics.yml index a4413e01ebee..77dd17813a70 100644 --- a/Resources/Prototypes/Recipes/Lathes/robotics.yml +++ b/Resources/Prototypes/Recipes/Lathes/robotics.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseRoboticsRecipe - category: Robotics + categories: + - Robotics completetime: 2 - type: latheRecipe diff --git a/Resources/Prototypes/Recipes/Lathes/salvage.yml b/Resources/Prototypes/Recipes/Lathes/salvage.yml index 4cf9b9073ce2..feb50041e2bd 100644 --- a/Resources/Prototypes/Recipes/Lathes/salvage.yml +++ b/Resources/Prototypes/Recipes/Lathes/salvage.yml @@ -21,7 +21,8 @@ - type: latheRecipe id: Fulton result: Fulton1 - category: Tools + categories: + - Tools completetime: 1 materials: Steel: 200 @@ -30,7 +31,8 @@ - type: latheRecipe id: FultonBeacon result: FultonBeacon - category: Tools + categories: + - Tools completetime: 5 materials: Steel: 1000 @@ -40,7 +42,8 @@ - type: latheRecipe id: SeismicCharge result: SeismicCharge - category: Tools + categories: + - Tools completetime: 1 materials: Plastic: 1500 diff --git a/Resources/Prototypes/Recipes/Lathes/security.yml b/Resources/Prototypes/Recipes/Lathes/security.yml index f6f303e5e3b1..3fba4a0a31c4 100644 --- a/Resources/Prototypes/Recipes/Lathes/security.yml +++ b/Resources/Prototypes/Recipes/Lathes/security.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseWeaponRecipe - category: Weapons + categories: + - Weapons completetime: 2 materials: Steel: 300 @@ -18,7 +19,8 @@ - type: latheRecipe abstract: true id: BaseAmmoRecipe - category: Ammo + categories: + - Ammo completetime: 5 - type: latheRecipe diff --git a/Resources/Prototypes/Recipes/Lathes/tools.yml b/Resources/Prototypes/Recipes/Lathes/tools.yml index fc35153317e7..fd35de20031f 100644 --- a/Resources/Prototypes/Recipes/Lathes/tools.yml +++ b/Resources/Prototypes/Recipes/Lathes/tools.yml @@ -3,7 +3,8 @@ - type: latheRecipe abstract: true id: BaseToolRecipe - category: Tools + categories: + - Tools completetime: 2 materials: Steel: 200 @@ -52,7 +53,8 @@ - type: latheRecipe id: CableStack result: CableApcStack1 - category: Parts + categories: + - Parts completetime: 0.1 materials: Steel: 30