Fix categories (#10683)
This commit is contained in:
@@ -167,7 +167,7 @@ namespace Content.Client.Construction.UI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(category) && category != Loc.GetString("construction-presenter-category-all"))
|
if (!string.IsNullOrEmpty(category) && category != Loc.GetString("construction-category-all"))
|
||||||
{
|
{
|
||||||
if (recipe.Category != category)
|
if (recipe.Category != category)
|
||||||
continue;
|
continue;
|
||||||
@@ -191,11 +191,11 @@ namespace Content.Client.Construction.UI
|
|||||||
var uniqueCategories = new HashSet<string>();
|
var uniqueCategories = new HashSet<string>();
|
||||||
|
|
||||||
// hard-coded to show all recipes
|
// hard-coded to show all recipes
|
||||||
uniqueCategories.Add(Loc.GetString("construction-presenter-category-all"));
|
uniqueCategories.Add(Loc.GetString("construction-category-all"));
|
||||||
|
|
||||||
foreach (var prototype in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
foreach (var prototype in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
||||||
{
|
{
|
||||||
var category = Loc.GetString(prototype.Category);
|
var category = prototype.Category;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(category))
|
if (!string.IsNullOrEmpty(category))
|
||||||
uniqueCategories.Add(category);
|
uniqueCategories.Add(category);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ namespace Content.Shared.Construction.Prototypes
|
|||||||
[Prototype("construction")]
|
[Prototype("construction")]
|
||||||
public sealed class ConstructionPrototype : IPrototype
|
public sealed class ConstructionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
|
private string _category = string.Empty;
|
||||||
|
|
||||||
[DataField("conditions")] private List<IConstructionCondition> _conditions = new();
|
[DataField("conditions")] private List<IConstructionCondition> _conditions = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -52,7 +54,12 @@ namespace Content.Shared.Construction.Prototypes
|
|||||||
[DataField("canBuildInImpassable")]
|
[DataField("canBuildInImpassable")]
|
||||||
public bool CanBuildInImpassable { get; private set; }
|
public bool CanBuildInImpassable { get; private set; }
|
||||||
|
|
||||||
[DataField("category")] public string Category { get; private set; } = string.Empty;
|
[DataField("category")]
|
||||||
|
public string Category
|
||||||
|
{
|
||||||
|
get => _category;
|
||||||
|
private set => _category = Loc.GetString(value);
|
||||||
|
}
|
||||||
|
|
||||||
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;
|
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
construction-category-furniture = Furniture
|
construction-category-all = All
|
||||||
|
construction-category-furniture = Furniture
|
||||||
construction-category-storage = Storage
|
construction-category-storage = Storage
|
||||||
construction-category-tools = Tools
|
construction-category-tools = Tools
|
||||||
construction-category-materials = Materials
|
construction-category-materials = Materials
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
construction-presenter-category-all = All
|
construction-presenter-to-craft = To craft this item, you need to:
|
||||||
construction-presenter-to-craft = To craft this item, you need to:
|
|
||||||
construction-presenter-to-build = To build this, first you need to:
|
construction-presenter-to-build = To build this, first you need to:
|
||||||
|
|
||||||
construction-presenter-step-wrapper = {$step-number}. {$text}
|
construction-presenter-step-wrapper = {$step-number}. {$text}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
graph: DisposalMachine
|
graph: DisposalMachine
|
||||||
startNode: start
|
startNode: start
|
||||||
targetNode: mailing_unit
|
targetNode: mailing_unit
|
||||||
category: Utilities
|
category: construction-category-utilities
|
||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
icon:
|
icon:
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
graph: flowercrown
|
graph: flowercrown
|
||||||
startNode: start
|
startNode: start
|
||||||
targetNode: flowercrown
|
targetNode: flowercrown
|
||||||
category: Misc
|
category: construction-category-misc
|
||||||
description: "A coronet of fresh and fragrant flowers."
|
description: "A coronet of fresh and fragrant flowers."
|
||||||
icon:
|
icon:
|
||||||
sprite: Clothing/Head/Misc/flower-crown.rsi
|
sprite: Clothing/Head/Misc/flower-crown.rsi
|
||||||
|
|||||||
Reference in New Issue
Block a user