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;
+
+ var validRecipe = proto.Categories.Any(category => category == CurrentCategory);
+
+ if (!validRecipe)
+ continue;
+ }
if (SearchBar.Text.Trim().Length != 0)
{
public void UpdateCategories()
{
+ // Get categories from recipes
var currentCategories = new List<ProtoId<LatheCategoryPrototype>>();
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)))
public bool ApplyMaterialDiscount = true;
/// <summary>
- /// A category used for visually sorting lathe recipes in the UI.
+ /// List of categories used for visually sorting lathe recipes in the UI.
/// </summary>
[DataField]
- public ProtoId<LatheCategoryPrototype>? Category;
+ public List<ProtoId<LatheCategoryPrototype>> Categories = new();
}
}
- type: latheRecipe
abstract: true
id: BasePartRecipe
- category: Parts
+ categories:
+ - Parts
completetime: 2
materials:
Steel: 300
- type: latheRecipe
id: BioGenMonkeyCube
result: MonkeyCube
- category: Food
+ categories:
+ - Food
completetime: 3
materials:
Biomass: 70
- type: latheRecipe
id: BioGenKoboldCube
result: KoboldCube
- category: Food
+ categories:
+ - Food
completetime: 3
materials:
Biomass: 70
- type: latheRecipe
id: BioGenMaterialCloth1
result: MaterialCloth1
- category: Materials
+ categories:
+ - Materials
icon:
sprite: Objects/Materials/materials.rsi
state: cloth
- type: latheRecipe
id: BioGenMaterialCardboard1
result: MaterialCardboard1
- category: Materials
+ categories:
+ - Materials
icon:
sprite: Objects/Materials/materials.rsi
state: cardboard
- type: latheRecipe
id: BioGenPaper
result: Paper
- category: Materials
+ categories:
+ - Materials
completetime: 1
materials:
Biomass: 2
- type: latheRecipe
id: BioGenPaperRolling1
result: PaperRolling1
- category: Materials
+ categories:
+ - Materials
completetime: 1
materials:
Biomass: 1
- type: latheRecipe
id: BioGenCandle
result: Candle
- category: Materials
+ categories:
+ - Materials
completetime: 3
materials:
Biomass: 3
id: BioGenPlantBGone
resultReagents:
PlantBGone: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Tools/Hydroponics/sprays.rsi
state: plantbgone
id: BioGenWeedKiller
resultReagents:
WeedKiller: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Tools/Hydroponics/sprays.rsi
state: weedspray
id: BioGenPestKiller
resultReagents:
PestKiller: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Tools/Hydroponics/sprays.rsi
state: weedspray
id: BioGenLeft4Zed
resultReagents:
Left4Zed: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Specific/Chemistry/bottle.rsi
state: bottle-1
id: BioGenEZNutrient
resultReagents:
EZNutrient: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Specific/Chemistry/bottle.rsi
state: bottle-1
id: BioGenRobustHarvest
resultReagents:
RobustHarvest: 10
- category: Chemicals
+ categories:
+ - Chemicals
icon:
sprite: Objects/Specific/Chemistry/bottle.rsi
state: bottle-1
id: BioGenMilk
resultReagents:
Milk: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Drinks/milk.rsi
state: icon
id: BioGenMilkSoy
resultReagents:
MilkSoy: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Drinks/soymilk.rsi
state: icon
id: BioGenEthanol
resultReagents:
Ethanol: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Drinks/glass_clear.rsi
state: icon
id: BioGenCream
resultReagents:
Cream: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Drinks/cream.rsi
state: icon
id: BioGenBlackpepper
resultReagents:
Blackpepper: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Food/condiments.rsi
state: packet-pepper
id: BioGenEnzyme
resultReagents:
Enzyme: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Food/condiments.rsi
state: bottle-empty
id: BioGenFlour
resultReagents:
Flour: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Food/ingredients.rsi
state: flour-big
id: BioGenSugar
resultReagents:
Sugar: 10
- category: Food
+ categories:
+ - Food
icon:
sprite: Objects/Consumable/Food/ingredients.rsi
state: sugar-big
- type: latheRecipe
id: ExplosivePayload
result: ExplosivePayload
- category: Weapons
+ categories:
+ - Weapons
completetime: 4
materials:
Steel: 100
- type: latheRecipe
id: AnomalyLocator
result: AnomalyLocatorEmpty
- category: Tools
+ categories:
+ - Tools
completetime: 3
materials:
Steel: 400
- type: latheRecipe
id: AnomalyLocatorWide
result: AnomalyLocatorWideEmpty
- category: Tools
+ categories:
+ - Tools
completetime: 3
materials:
Steel: 400
- type: latheRecipe
id: WeaponPistolCHIMP
result: WeaponPistolCHIMP
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 500
- type: latheRecipe
id: WeaponGauntletGorilla
result: WeaponGauntletGorilla
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 1500
- type: latheRecipe
id: WeaponForceGun
result: WeaponForceGun
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 500
- type: latheRecipe
id: WeaponProtoKineticAccelerator
result: WeaponProtoKineticAccelerator
- category: Weapons
+ categories:
+ - Weapons
completetime: 5
materials:
Steel: 1000
- type: latheRecipe
id: WeaponTetherGun
result: WeaponTetherGun
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 500
- type: latheRecipe
id: WeaponGrapplingGun
result: WeaponGrapplingGun
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 500
- type: latheRecipe
abstract: true
id: BaseElectronicsRecipe
- category: Circuitry
+ categories:
+ - Circuitry
completetime: 2
materials:
Steel: 100
- type: latheRecipe
abstract: true
id: BaseMechPartRecipe
- category: Mech
+ categories:
+ - Mech
completetime: 10
# Recipes
- type: latheRecipe
id: HandheldHealthAnalyzer
result: HandheldHealthAnalyzerEmpty
- category: Tools
+ categories:
+ - Tools
completetime: 4
materials:
Glass: 500
- type: latheRecipe
abstract: true
id: BaseLightRecipe
- category: Lights
+ categories:
+ - Lights
completetime: 2
materials:
Steel: 50
- type: latheRecipe
id: PowerCellSmall
result: PowerCellSmallPrinted
- category: Parts
+ categories:
+ - Parts
completetime: 1
materials:
Steel: 100
- type: latheRecipe
id: PowerCellMedium
result: PowerCellMediumPrinted
- category: Parts
+ categories:
+ - Parts
completetime: 6
materials:
Steel: 300
- type: latheRecipe
id: PowerCellHigh
result: PowerCellHighPrinted
- category: Parts
+ categories:
+ - Parts
completetime: 10
materials:
Steel: 300
- type: latheRecipe
id: PowerCellMicroreactor
result: PowerCellMicroreactorPrinted
- category: Parts
+ categories:
+ - Parts
completetime: 10
materials:
Steel: 500
- type: latheRecipe
abstract: true
id: BaseRoboticsRecipe
- category: Robotics
+ categories:
+ - Robotics
completetime: 2
- type: latheRecipe
- type: latheRecipe
id: Fulton
result: Fulton1
- category: Tools
+ categories:
+ - Tools
completetime: 1
materials:
Steel: 200
- type: latheRecipe
id: FultonBeacon
result: FultonBeacon
- category: Tools
+ categories:
+ - Tools
completetime: 5
materials:
Steel: 1000
- type: latheRecipe
id: SeismicCharge
result: SeismicCharge
- category: Tools
+ categories:
+ - Tools
completetime: 1
materials:
Plastic: 1500
- type: latheRecipe
abstract: true
id: BaseWeaponRecipe
- category: Weapons
+ categories:
+ - Weapons
completetime: 2
materials:
Steel: 300
- type: latheRecipe
abstract: true
id: BaseAmmoRecipe
- category: Ammo
+ categories:
+ - Ammo
completetime: 5
- type: latheRecipe
- type: latheRecipe
abstract: true
id: BaseToolRecipe
- category: Tools
+ categories:
+ - Tools
completetime: 2
materials:
Steel: 200
- type: latheRecipe
id: CableStack
result: CableApcStack1
- category: Parts
+ categories:
+ - Parts
completetime: 0.1
materials:
Steel: 30