Sort tabs in logical sequence

This commit is contained in:
juliancoffee 2021-06-26 16:23:11 +03:00
parent c93748224b
commit 123b2814cf

View File

@ -138,17 +138,18 @@ impl<'a> Crafting<'a> {
#[derive(Copy, Clone, Debug, EnumIter, PartialEq)] #[derive(Copy, Clone, Debug, EnumIter, PartialEq)]
pub enum CraftingTab { pub enum CraftingTab {
All, All,
Tool,
Armor, Armor,
Weapon, Weapon,
Food, ProcessedMaterial,
Dismantle, Dismantle,
Food,
Potion, Potion,
Bag, Bag,
Tool,
Utility, Utility,
Glider, Glider,
ProcessedMaterial,
} }
impl CraftingTab { impl CraftingTab {
fn name_key(&self) -> &str { fn name_key(&self) -> &str {
match self { match self {
@ -205,10 +206,7 @@ impl CraftingTab {
ItemKind::Tool(_) => !item.tags().contains(&ItemTag::CraftingTool), ItemKind::Tool(_) => !item.tags().contains(&ItemTag::CraftingTool),
_ => false, _ => false,
}, },
CraftingTab::Dismantle => match item.kind() { CraftingTab::Dismantle => matches!(item.kind(), ItemKind::Ingredient { .. }),
ItemKind::Ingredient { .. } => !item.tags().contains(&ItemTag::CraftingTool),
_ => false,
},
} }
} }
} }