Make charm recipes accessible by putting them in the potion tab of the crafting menu

This commit is contained in:
James Melkonian 2024-06-30 23:27:33 +00:00 committed by Samuel Keiffer
parent 6214f9df5a
commit 3dcf9ab62e
6 changed files with 19 additions and 12 deletions

View File

@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Image-export for wiki now produces correct images of items as they look like in-game.
- Limit the minimum vertical scaling value in the world generation UI to 0.1 to prevent an overflow
- Wood log and worker/linen clothing pricing.
- Charm recipes can now be found in the Potions tab of the crafting menu
## [0.16.0] - 2024-03-30

View File

@ -17,5 +17,5 @@ ItemDef(
])
),
quality: Legendary,
tags: [],
tags: [Charm],
)

View File

@ -17,5 +17,5 @@ ItemDef(
])
),
quality: Legendary,
tags: [],
tags: [Charm],
)

View File

@ -16,5 +16,5 @@ ItemDef(
])
),
quality: Legendary,
tags: [],
tags: [Charm],
)

View File

@ -276,6 +276,7 @@ pub enum ItemTag {
Cultist,
Gnarling,
Potion,
Charm,
Food,
BaseMaterial, // Cloth-scraps, Leather...
CraftingTool, // Pickaxe, Craftsman-Hammer, Sewing-Set
@ -292,6 +293,7 @@ impl TagExampleInfo for ItemTag {
ItemTag::Cultist => "cultist",
ItemTag::Gnarling => "gnarling",
ItemTag::Potion => "potion",
ItemTag::Charm => "charm",
ItemTag::Food => "food",
ItemTag::BaseMaterial => "basemat",
ItemTag::CraftingTool => "tool",
@ -305,16 +307,17 @@ impl TagExampleInfo for ItemTag {
fn exemplar_identifier(&self) -> Option<&str> {
match self {
ItemTag::Material(material) => material.exemplar_identifier(),
ItemTag::MaterialKind(_) => None,
ItemTag::Cultist => Some("common.items.tag_examples.cultist"),
ItemTag::Gnarling => Some("common.items.tag_examples.gnarling"),
ItemTag::Potion => None,
ItemTag::Food => None,
ItemTag::BaseMaterial => None,
ItemTag::CraftingTool => None,
ItemTag::Utility => None,
ItemTag::Bag => None,
ItemTag::SalvageInto(_, _) => None,
ItemTag::MaterialKind(_)
| ItemTag::Potion
| ItemTag::Food
| ItemTag::Charm
| ItemTag::BaseMaterial
| ItemTag::CraftingTool
| ItemTag::Utility
| ItemTag::Bag
| ItemTag::SalvageInto(_, _) => None,
}
}
}

View File

@ -267,7 +267,10 @@ impl CraftingTab {
_ => false,
},
CraftingTab::Glider => matches!(&*item.kind(), ItemKind::Glider),
CraftingTab::Potion => item.tags().contains(&ItemTag::Potion),
CraftingTab::Potion => item
.tags()
.iter()
.any(|tag| matches!(tag, &ItemTag::Potion | &ItemTag::Charm)),
CraftingTab::ProcessedMaterial => item
.tags()
.iter()