diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml.cs b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml.cs index daabe940f5..3716bfc89d 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml.cs +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml.cs @@ -149,7 +149,24 @@ public sealed partial class CP14WorkbenchWindow : DefaultWindow OptionCategories.Clear(); OptionCategories.AddItem(Loc.GetString("cp14-recipe-category-all"), AllCategoryId); - foreach (var entry in recipesState.Recipes.OrderByDescending(e => e.Craftable)) + // First, we sort all the recipes by priority and category. + var sortedRecipes = recipesState.Recipes + .OrderByDescending(e => e.Craftable) + .ThenByDescending(e => + { + if (!_prototype.TryIndex(e.ProtoId, out CP14WorkbenchRecipePrototype? recipe)) + return 0; + return recipe.Priority; + }) + .ThenBy(e => + { + if (!_prototype.TryIndex(e.ProtoId, out CP14WorkbenchRecipePrototype? recipe) || + !_prototype.TryIndex(recipe.Category, out CP14WorkbenchRecipeCategoryPrototype? category)) + return string.Empty; + return category.ID; + }); + + foreach (var entry in sortedRecipes) { if (!_prototype.TryIndex(entry.ProtoId, out var indexedEntry)) continue; @@ -169,6 +186,18 @@ public sealed partial class CP14WorkbenchWindow : DefaultWindow entries.Add(entry); } + // Sort categories by priority + var sortedCategories = _categories + .OrderByDescending(c => + { + var categoryProto = _prototype.EnumeratePrototypes() + .FirstOrDefault(p => p.Name == c.Key); + return categoryProto?.Priority ?? 0; + }) + .ToList(); + + _categories = sortedCategories.ToDictionary(pair => pair.Key, pair => pair.Value); + var count = 0; foreach (var category in _categories) { diff --git a/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipeCategoryPrototype.cs b/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipeCategoryPrototype.cs index 326a99528b..aa4dda8eec 100644 --- a/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipeCategoryPrototype.cs +++ b/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipeCategoryPrototype.cs @@ -15,4 +15,7 @@ public sealed class CP14WorkbenchRecipeCategoryPrototype : IPrototype [DataField(required: true)] public LocId Name; + + [DataField] + public int Priority = 0; // In descending order. More means it will be first. } diff --git a/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipePrototype.cs b/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipePrototype.cs index a964920c78..e501c741a8 100644 --- a/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipePrototype.cs +++ b/Content.Shared/_CP14/Workbench/Prototypes/CP14WorkbenchRecipePrototype.cs @@ -53,4 +53,7 @@ public sealed class CP14WorkbenchRecipePrototype : IPrototype [DataField] public ProtoId? Category; + + [DataField] + public int Priority = 0; // In descending order. More means it will be first. } diff --git a/Resources/Locale/en-US/_CP14/workbench/categories.ftl b/Resources/Locale/en-US/_CP14/workbench/categories.ftl index 37c65c5f29..5fdb46983e 100644 --- a/Resources/Locale/en-US/_CP14/workbench/categories.ftl +++ b/Resources/Locale/en-US/_CP14/workbench/categories.ftl @@ -7,4 +7,11 @@ cp14-recipe-category-weapon = Weapon cp14-recipe-category-armor = Armor cp14-recipe-category-carpet = Carpets cp14-recipe-category-wallpaper = Wallpapers -cp14-recipe-category-clothing = Clothing \ No newline at end of file +cp14-recipe-category-clothing = Clothing + +cp14-recipe-category-backpack = Backpacks +cp14-recipe-category-backpack-satchel = Satchels +cp14-recipe-category-backpack-upgrade = Backpack Upgrade +cp14-recipe-category-backpack-satchel-upgrade = Satchel Upgrade +cp14-recipe-category-belt = Belts +cp14-recipe-category-leather = Leather Working \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/_PROTO/entities/entities.ftl b/Resources/Locale/ru-RU/_CP14/_PROTO/entities/entities.ftl index 9c5d283901..cd3d7a8c22 100644 --- a/Resources/Locale/ru-RU/_CP14/_PROTO/entities/entities.ftl +++ b/Resources/Locale/ru-RU/_CP14/_PROTO/entities/entities.ftl @@ -724,34 +724,34 @@ ent-CP14ClothingBackBackpackT0 = мешок .desc = Простой тканевый мешок с базовой вместимостью. Легкий, но не очень надежный. ent-CP14ClothingBackBackpackT1 = рюкзак - .desc = Стандартный рюкзак с приличным объемом хранения. Идеально подходит для повседневного использования. Немного стесняет движения, но защищает спину от ударов! + .desc = Стандартный рюкзак с приличным объемом. Идеален для повседневного использования. Защищает спину от ударов! -ent-CP14ClothingBackBackpackT2 = расширенный рюкзак - .desc = Расширенный рюкзак увеличенной вместимости. Идеально подходит для длительных поездок. Стесняет движения, но защищает спину от ударов и сохраняет тепло! +ent-CP14ClothingBackBackpackT2 = вместительный рюкзак + .desc = Увеличенный рюкзак с большей вместимостью. Идеален для длительных походов. Незначительно сковывает при беге, но защищает спину от ударов и сохраняет тепло! -ent-CP14ClothingBackBackpackT3 = рюкзак путешественника - .desc = Большой, хорошо организованный рюкзак, предназначенный для длительных путешествий, с несколькими отделениями. Значительно стесняет движения, но защищает спину! +ent-CP14ClothingBackBackpackT3 = дорожный рюкзак + .desc = Большой, хорошо организованный рюкзак для длительных путешествий с несколькими отделениями. Сковывает при беге и защищает спину и шею от ударов!. -ent-CP14ClothingBackBackpackReinforced = усиленный рюкзак - .desc = Прочный рюкзак с усиленными швами и материалами для дополнительной защиты ваших вещей. Стесняет движения, но защищает спину от ударов и сохраняет тепло! +ent-CP14ClothingBackBackpackReinforced = укрепленный рюкзак + .desc = Прочный рюкзак с усиленной строчкой и материалами для дополнительной защиты ваших вещей. Сковывает при беге, но зато защищает спину и бока от ударов и сохраняет тепло! ent-CP14ClothingBackBackpackCargo = грузовая сумка - .desc = Утилитарная грузовая сумка, предназначенная для тяжелых условий эксплуатации. Удобна для переноски и хранения рабочих вещей. + .desc = Утилитарная грузовая сумка для тяжелых условий эксплуатации. Удобна для переноски и хранения рабочих принадлежностей. -ent-CP14ClothingBackSatchelT0 = подсумок - .desc = Небольшой базовый подсумок для переноски предметов первой необходимости. Можно носить на поясе или через плечо. +ent-CP14ClothingBackSatchelT0 = сумка + .desc = Небольшая сумка для переноски необходимых вещей. Можно носить на поясе или через плечо. ent-CP14ClothingBackSatchelT1 = деревенская сумка - .desc = Кожаная сумка ручной работы с деревенским шармом. Обеспечивает скромное хранение с традиционным стилем. Можно носить на поясе или через плечо. Мешает спринту. + .desc = Ручная кожаная сумка с деревенским шармом. Обеспечивает скромное хранилище в традиционном стиле. Можно носить на поясе или через плечо. ent-CP14ClothingBackSatchelT2 = курьерская сумка - .desc = Профессиональная сумка, предназначенная для курьеров, с организованными отделениями для быстрого доступа. Мешает спринту. + .desc = Профессиональная сумка, разработанная для курьеров, с организованными отделениями для быстрого доступа. ent-CP14ClothingBackSatchelT3 = вещмешок - .desc = Прочный вещмешок военного образца с большой вместимостью, предназначенный для длительного использования в полевых условиях. Мешает спринту. + .desc = Прочный вещмешок с большой вместимостью, предназначенный для длительного использования в полевых условиях. Незначительно стесняет движения, но зато может прикрыть спину. -ent-CP14ClothingBackSatchelReinforced = усиленный вещмешок - .desc = Прочный вещмешок с усиленными швами и влагостойкими материалами для тяжелых условий. Мешает спринту. +ent-CP14ClothingBackSatchelReinforced = укрепленная сумка + .desc = Прочная сумка с усиленными швами и водостойкими материалами для тяжелых условий. ent-CP14ClothingBeltPouchPotions = подсумок для зелий .desc = Мешочек для хранения зелий - здесь они точно не разобьются. diff --git a/Resources/Locale/ru-RU/_CP14/workbench/categories.ftl b/Resources/Locale/ru-RU/_CP14/workbench/categories.ftl index ee9121617a..0ac8b89fc9 100644 --- a/Resources/Locale/ru-RU/_CP14/workbench/categories.ftl +++ b/Resources/Locale/ru-RU/_CP14/workbench/categories.ftl @@ -7,4 +7,11 @@ cp14-recipe-category-weapon = Оружие cp14-recipe-category-armor = Броня cp14-recipe-category-carpet = Ковры cp14-recipe-category-wallpaper = Обои -cp14-recipe-category-clothing = Одежда \ No newline at end of file +cp14-recipe-category-clothing = Одежда + +cp14-recipe-category-backpack = Рюкзаки +cp14-recipe-category-backpack-satchel = Сумки +cp14-recipe-category-backpack-upgrade = Расширение Рюкзака +cp14-recipe-category-backpack-satchel-upgrade = Расширение Сумки +cp14-recipe-category-belt = Пояса +cp14-recipe-category-leather = Кожанный изделия diff --git a/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks.yml b/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks.yml index a4878d5ec0..ccfce55030 100644 --- a/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks.yml +++ b/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks.yml @@ -42,7 +42,7 @@ id: CP14ClothingBackBackpackT1 name: Backpack suffix: backpack T1 - description: A standard backpack with decent storage space. Perfect for everyday use. It restricts movement a little, but it protects your back from blows! + description: A standard backpack with decent storage space. Perfect for everyday use. It covers your back from blows! components: - type: Clothing slots: @@ -105,7 +105,7 @@ id: CP14ClothingBackBackpackT3 name: Traveler Backpack suffix: backpack T3 - description: A large, well-organized backpack designed for extensive traveling with multiple compartments. It greatly restricts movement, but it protects your back! + description: A large, well-organized backpack designed for extensive traveling with multiple compartments. It protects your back and neck from blows! But unfortunately, it is not comfortable to run with. components: - type: Sprite sprite: _CP14/Clothing/Back/Backpacks/backpack_t3.rsi diff --git a/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks_satchels.yml b/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks_satchels.yml index b9d9f4b5f3..e522365ed4 100644 --- a/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks_satchels.yml +++ b/Resources/Prototypes/_CP14/Entities/Clothing/Back/backpacks_satchels.yml @@ -58,7 +58,7 @@ id: CP14ClothingBackSatchelT1 name: Rustic Satchel suffix: backpack T1 - description: A handcrafted leather satchel with rustic charm. Provides modest storage with traditional styling. Can be worn on the belt or over the shoulder. Interferes with sprinting. + description: A handcrafted leather satchel with rustic charm. Provides modest storage with traditional styling. Can be worn on the belt or over the shoulder. components: - type: Clothing slots: @@ -87,7 +87,7 @@ id: CP14ClothingBackSatchelT2 name: Courier Satchel suffix: backpack T2 - description: A professional-grade satchel designed for messengers, with organized compartments for quick access. Interferes with sprinting. + description: A professional-grade satchel designed for messengers, with organized compartments for quick access. components: - type: Clothing slots: @@ -121,7 +121,7 @@ id: CP14ClothingBackSatchelT3 name: Haversack suffix: backpack T3 - description: A sturdy military-style haversack with ample capacity, designed for extended field use. Interferes with sprinting. + description: A sturdy haversack with ample capacity, designed for extended field use. Interferes with sprinting. components: - type: Sprite sprite: _CP14/Clothing/Back/Satchel/satchel_t3.rsi @@ -161,7 +161,7 @@ id: CP14ClothingBackSatchelReinforced name: Reinforced Satchel suffix: backpack T2 - description: A heavy-duty satchel with reinforced seams and weather-resistant materials for tough conditions. Interferes with sprinting. + description: A heavy-duty satchel with reinforced seams and weather-resistant materials for tough conditions. components: - type: Sprite sprite: _CP14/Clothing/Back/Satchel/satchel_t2_reinforced.rsi diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks.yml index a7cd193e75..c7c12c800a 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks.yml @@ -2,6 +2,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT0 tag: CP14RecipeLeatherWorking + category: Backpacks + priority: 4 craftTime: 4 requirements: - !type:StackResource @@ -15,6 +17,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT1 tag: CP14RecipeLeatherWorking + category: Backpacks + priority: 3 craftTime: 4 requirements: - !type:StackResource @@ -29,6 +33,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT2 tag: CP14RecipeLeatherWorking + category: Backpacks + priority: 2 craftTime: 6 requirements: - !type:StackResource @@ -46,6 +52,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT3 tag: CP14RecipeLeatherWorking + category: Backpacks + priority: 1 craftTime: 10 requirements: - !type:StackResource @@ -68,6 +76,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT1_Upgrade tag: CP14RecipeLeatherWorking + category: BackpackUpgrade + priority: 3 craftTime: 6 requirements: - !type:ProtoIdResource @@ -86,6 +96,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT2_Upgrade tag: CP14RecipeLeatherWorking + category: BackpackUpgrade + priority: 2 craftTime: 8 requirements: - !type:ProtoIdResource @@ -104,6 +116,8 @@ - type: CP14Recipe id: CP14ClothingBackBackpackT3_Upgrade tag: CP14RecipeLeatherWorking + category: BackpackUpgrade + priority: 1 craftTime: 12 requirements: - !type:ProtoIdResource diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_explorer.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_explorer.yml index 3a7e2e0205..3666b5317a 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_explorer.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_explorer.yml @@ -2,6 +2,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT0 # tag: CP14RecipeLeatherWorking +# category: Explorers +# priority: 4 # craftTime: 4 # requirements: # - !type:StackResource @@ -12,6 +14,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT1 # tag: CP14RecipeLeatherWorking +# category: Explorers +# priority: 3 # craftTime: 4 # requirements: # - !type:StackResource @@ -25,6 +29,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT2 # tag: CP14RecipeLeatherWorking +# category: Explorers +# priority: 2 # craftTime: 6 # requirements: # - !type:StackResource @@ -41,6 +47,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT3 # tag: CP14RecipeLeatherWorking +# category: Explorers +# priority: 1 # craftTime: 10 # requirements: # - !type:StackResource @@ -62,6 +70,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT1_Upgrade # tag: CP14RecipeLeatherWorking +# category: ExplorerUpgrade +# priority: 3 # craftTime: 6 # requirements: # - !type:ProtoIdResource @@ -80,6 +90,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT2_Upgrade # tag: CP14RecipeLeatherWorking +# category: ExplorerUpgrade +# priority: 2 # craftTime: 8 # requirements: # - !type:ProtoIdResource @@ -98,6 +110,8 @@ # - type: CP14Recipe # id: CP14ClothingBackExplorerBackpackT3_Upgrade # tag: CP14RecipeLeatherWorking +# category: ExplorerUpgrade +# priority: 1 # craftTime: 12 # requirements: # - !type:ProtoIdResource diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_satchels.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_satchels.yml index f8b18e1352..337d8057cb 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_satchels.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/backpacks_satchels.yml @@ -2,6 +2,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT0 tag: CP14RecipeLeatherWorking + category: Satchels + priority: 4 craftTime: 4 requirements: - !type:StackResource @@ -18,6 +20,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT1 tag: CP14RecipeLeatherWorking + category: Satchels + priority: 3 craftTime: 4 requirements: - !type:StackResource @@ -31,6 +35,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT2 tag: CP14RecipeLeatherWorking + category: Satchels + priority: 2 craftTime: 6 requirements: - !type:StackResource @@ -47,6 +53,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT3 tag: CP14RecipeLeatherWorking + category: Satchels + priority: 1 craftTime: 10 requirements: - !type:StackResource @@ -68,6 +76,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT1_Upgrade tag: CP14RecipeLeatherWorking + category: SatchelUpgrade + priority: 3 craftTime: 6 requirements: - !type:ProtoIdResource @@ -86,6 +96,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT2_Upgrade tag: CP14RecipeLeatherWorking + category: SatchelUpgrade + priority: 2 craftTime: 8 requirements: - !type:ProtoIdResource @@ -104,6 +116,8 @@ - type: CP14Recipe id: CP14ClothingBackSatchelT3_Upgrade tag: CP14RecipeLeatherWorking + category: SatchelUpgrade + priority: 1 craftTime: 12 requirements: - !type:ProtoIdResource diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/belts.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/belts.yml index ad00ef46d9..75d8ed1ce5 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/belts.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/belts.yml @@ -5,6 +5,7 @@ - type: CP14Recipe id: CP14ClothingBeltQuiverRecipe tag: CP14RecipeLeatherWorking + category: Belts craftTime: 1 requirements: - !type:StackResource @@ -19,6 +20,7 @@ - type: CP14Recipe id: CP14ClothingBeltPouchPotionsRecipe tag: CP14RecipeLeatherWorking + category: Belts craftTime: 1 requirements: - !type:StackResource diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/tanner.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/tanner.yml index 2afe4d7849..5f6fba3349 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/tanner.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/LeatherWorking/tanner.yml @@ -6,6 +6,7 @@ - type: CP14Recipe id: CP14ScrapHideRecipe tag: CP14RecipeLeatherWorking + category: LeatherWorking craftTime: 2 requirements: - !type:ProtoIdResource @@ -20,6 +21,7 @@ - type: CP14Recipe id: CP14ThinToRegularHideRecipe tag: CP14RecipeLeatherWorking + category: LeatherWorking craftTime: 2 requirements: - !type:StackResource diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/categories.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/categories.yml index 01926d3c53..aadae687a4 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/categories.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/categories.yml @@ -29,3 +29,47 @@ - type: CP14RecipeCategory id: Clothing name: cp14-recipe-category-clothing + +# ===================================== +# Leather Working +- type: CP14RecipeCategory + id: Backpacks + name: cp14-recipe-category-backpack + priority: 8 + +- type: CP14RecipeCategory + id: Satchels + name: cp14-recipe-category-backpack-satchel + priority: 7 + +# - type: CP14RecipeCategory # TODO need sprites =( +# id: Explorers +# name: cp14-recipe-category-backpack-explorer +# priority: 6 + +- type: CP14RecipeCategory + id: BackpackUpgrade + name: cp14-recipe-category-backpack-upgrade + priority: 5 + +- type: CP14RecipeCategory + id: SatchelUpgrade + name: cp14-recipe-category-backpack-satchel-upgrade + priority: 4 + +# - type: CP14RecipeCategory +# id: ExplorerUpgrade +# name: cp14-recipe-category-backpack-explorer-upgrade +# priority: 3 + +- type: CP14RecipeCategory + id: Belts + name: cp14-recipe-category-belt + priority: 2 + +- type: CP14RecipeCategory + id: LeatherWorking + name: cp14-recipe-category-leather + priority: 1 + +# ===================================== \ No newline at end of file