mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Crafting Tabs and more item tags
This commit is contained in:
parent
689480ec01
commit
06bbb7f0ff
10
CHANGELOG.md
10
CHANGELOG.md
@ -17,11 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Admin designated build areas
|
- Admin designated build areas
|
||||||
- Indicator text to collectable terrain sprites
|
- Indicator text to collectable terrain sprites
|
||||||
- You can now autorequest exact change by ctrl-clicking in a trade, and can quick-add individual items with shift-click.
|
- You can now autorequest exact change by ctrl-clicking in a trade, and can quick-add individual items with shift-click.
|
||||||
<<<<<<< HEAD
|
|
||||||
- Buy and sell prices in tooltips when trading with a merchant now have colors.
|
- Buy and sell prices in tooltips when trading with a merchant now have colors.
|
||||||
=======
|
|
||||||
- Attacks now emit sound effects from the target on hit.
|
- Attacks now emit sound effects from the target on hit.
|
||||||
>>>>>>> e2f8d1d27 (Changelog)
|
- Crafting menu tabs
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
@ -31,16 +30,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Separated character randomization buttons into appearance and name.
|
- Separated character randomization buttons into appearance and name.
|
||||||
- Reworked mindflayer to have unique attacks
|
- Reworked mindflayer to have unique attacks
|
||||||
- Glowing remains are now `Armor` instead of `Ingredients`.
|
- Glowing remains are now `Armor` instead of `Ingredients`.
|
||||||
- Generated a net world map
|
- Generated a new world map
|
||||||
- Overhauled clouds for more verticality and performance
|
- Overhauled clouds for more verticality and performance
|
||||||
- New tooltip for items with stats comparison
|
- New tooltip for items with stats comparison
|
||||||
- Improved bow feedback, added arrow particles
|
- Improved bow feedback, added arrow particles
|
||||||
<<<<<<< HEAD
|
|
||||||
- Retiered most sceptres and staves
|
- Retiered most sceptres and staves
|
||||||
- Loot tables can now recursively reference loot tables
|
- Loot tables can now recursively reference loot tables
|
||||||
=======
|
|
||||||
- "max_sfx_channels" default now set to 30
|
- "max_sfx_channels" default now set to 30
|
||||||
>>>>>>> e2f8d1d27 (Changelog)
|
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -4802,6 +4802,24 @@ dependencies = [
|
|||||||
"syn 1.0.67",
|
"syn 1.0.67",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strum"
|
||||||
|
version = "0.20.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strum_macros"
|
||||||
|
version = "0.20.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149"
|
||||||
|
dependencies = [
|
||||||
|
"heck",
|
||||||
|
"proc-macro2 1.0.24",
|
||||||
|
"quote 1.0.9",
|
||||||
|
"syn 1.0.67",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sum_type"
|
name = "sum_type"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -5645,6 +5663,8 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"specs",
|
"specs",
|
||||||
"specs-idvs",
|
"specs-idvs",
|
||||||
|
"strum",
|
||||||
|
"strum_macros",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"treeculler",
|
"treeculler",
|
||||||
|
@ -9,6 +9,6 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 18,
|
slots: 18,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 14,
|
slots: 14,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 9,
|
slots: 9,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 12,
|
slots: 12,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Epic,
|
quality: Epic,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 27,
|
slots: 27,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 16,
|
slots: 16,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Legendary,
|
quality: Legendary,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 36,
|
slots: 36,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Legendary,
|
quality: Legendary,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 36,
|
slots: 36,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 18,
|
slots: 18,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 6,
|
slots: 6,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 3,
|
slots: 3,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 18,
|
slots: 18,
|
||||||
)
|
)
|
||||||
|
@ -11,6 +11,6 @@ ItemDef(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Bag],
|
||||||
slots: 15,
|
slots: 15,
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "PotionExp",
|
kind: "PotionExp",
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "Potion",
|
kind: "Potion",
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Potion],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "ClothScraps",
|
kind: "ClothScraps",
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [BaseMaterial],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "ClothScrapsRed",
|
kind: "ClothScrapsRed",
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [BaseMaterial],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "LeatherScraps",
|
kind: "LeatherScraps",
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [BaseMaterial],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "TrollLeather",
|
kind: "TrollLeather",
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [BaseMaterial],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "CraftsmanHammer",
|
kind: "CraftsmanHammer",
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [CraftingTool],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "MortarPestle",
|
kind: "MortarPestle",
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [CraftingTool],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: "SewingSet",
|
kind: "SewingSet",
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [CraftingTool],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -18,5 +18,5 @@ ItemDef(
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Food],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -10,5 +10,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
10
assets/common/items/tag_examples/placeholder.ron
Normal file
10
assets/common/items/tag_examples/placeholder.ron
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
ItemDef(
|
||||||
|
name: "Placeholder",
|
||||||
|
description: "This is a placeholder because we intend to autogenerate these from the tags later",
|
||||||
|
kind: Ingredient(
|
||||||
|
kind: "Placeholder",
|
||||||
|
),
|
||||||
|
quality: Common,
|
||||||
|
tags: [],
|
||||||
|
)
|
||||||
|
|
@ -14,5 +14,5 @@ ItemDef(
|
|||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
quality: Low,
|
quality: Low,
|
||||||
tags: [],
|
tags: [CraftingTool],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Bomb,
|
kind: Bomb,
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ ItemDef(
|
|||||||
amount: 10,
|
amount: 10,
|
||||||
),
|
),
|
||||||
quality: Common,
|
quality: Common,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -6,5 +6,5 @@ ItemDef(
|
|||||||
),
|
),
|
||||||
amount: 1,
|
amount: 1,
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(Blue),
|
kind: Firework(Blue),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(Green),
|
kind: Firework(Green),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(Purple),
|
kind: Firework(Purple),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(Red),
|
kind: Firework(Red),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(White),
|
kind: Firework(White),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: Firework(Yellow),
|
kind: Firework(Yellow),
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
@ -5,5 +5,5 @@ ItemDef(
|
|||||||
kind: TrainingDummy,
|
kind: TrainingDummy,
|
||||||
),
|
),
|
||||||
quality: Moderate,
|
quality: Moderate,
|
||||||
tags: [],
|
tags: [Utility],
|
||||||
)
|
)
|
||||||
|
BIN
assets/voxygen/element/icons/armors.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/armors.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/crafting_tools.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/crafting_tools.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/dismantle.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/dismantle.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/endurance.png
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/endurance.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/fitness.png
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/fitness.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/foods.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/foods.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/gliders.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/gliders.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/potions.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/potions.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/utilities.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/utilities.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/weapons.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/weapons.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/willpower.png
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/willpower.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/misc_bg/pixel.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/misc_bg/pixel.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -4,6 +4,10 @@
|
|||||||
({
|
({
|
||||||
// Weapons
|
// Weapons
|
||||||
// Diary Example Images
|
// Diary Example Images
|
||||||
|
Tool("example_utility"): VoxTrans(
|
||||||
|
"voxel.weapon.projectile.fireworks_green-0",
|
||||||
|
(0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8,
|
||||||
|
),
|
||||||
Tool("example_sword"): VoxTrans(
|
Tool("example_sword"): VoxTrans(
|
||||||
"voxel.weapon.sword.greatsword_2h_dullahan",
|
"voxel.weapon.sword.greatsword_2h_dullahan",
|
||||||
(0.0, 0.0, 0.0), (90.0, 80.0, 0.0), 1.0,
|
(0.0, 0.0, 0.0), (90.0, 80.0, 0.0), 1.0,
|
||||||
|
@ -96,6 +96,12 @@ pub enum ItemTag {
|
|||||||
ModularComponent(ModularComponentTag),
|
ModularComponent(ModularComponentTag),
|
||||||
MetalIngot,
|
MetalIngot,
|
||||||
Cultist,
|
Cultist,
|
||||||
|
Potion,
|
||||||
|
Food,
|
||||||
|
BaseMaterial, // Cloth-scraps, Leather...
|
||||||
|
CraftingTool, // Pickaxe, Craftsman-Hammer, Sewing-Set
|
||||||
|
Utility,
|
||||||
|
Bag,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TagExampleInfo for ItemTag {
|
impl TagExampleInfo for ItemTag {
|
||||||
@ -106,9 +112,16 @@ impl TagExampleInfo for ItemTag {
|
|||||||
ItemTag::ModularComponent(kind) => kind.name(),
|
ItemTag::ModularComponent(kind) => kind.name(),
|
||||||
ItemTag::MetalIngot => "metal ingot",
|
ItemTag::MetalIngot => "metal ingot",
|
||||||
ItemTag::Cultist => "cultist",
|
ItemTag::Cultist => "cultist",
|
||||||
|
ItemTag::Potion => "potion",
|
||||||
|
ItemTag::Food => "food",
|
||||||
|
ItemTag::BaseMaterial => "basemat",
|
||||||
|
ItemTag::CraftingTool => "tool",
|
||||||
|
ItemTag::Utility => "utility",
|
||||||
|
ItemTag::Bag => "bag",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Autogenerate these?
|
||||||
fn exemplar_identifier(&self) -> &'static str {
|
fn exemplar_identifier(&self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
ItemTag::ClothItem => "common.items.tag_examples.cloth_item",
|
ItemTag::ClothItem => "common.items.tag_examples.cloth_item",
|
||||||
@ -116,6 +129,12 @@ impl TagExampleInfo for ItemTag {
|
|||||||
ItemTag::ModularComponent(tag) => tag.exemplar_identifier(),
|
ItemTag::ModularComponent(tag) => tag.exemplar_identifier(),
|
||||||
ItemTag::MetalIngot => "common.items.tag_examples.metal_ingot",
|
ItemTag::MetalIngot => "common.items.tag_examples.metal_ingot",
|
||||||
ItemTag::Cultist => "common.items.tag_examples.cultist",
|
ItemTag::Cultist => "common.items.tag_examples.cultist",
|
||||||
|
ItemTag::Potion => "common.items.tag_examples.placeholder",
|
||||||
|
ItemTag::Food => "common.items.tag_examples.placeholder",
|
||||||
|
ItemTag::BaseMaterial => "common.items.tag_examples.placeholder",
|
||||||
|
ItemTag::CraftingTool => "common.items.tag_examples.placeholder",
|
||||||
|
ItemTag::Utility => "common.items.tag_examples.placeholder",
|
||||||
|
ItemTag::Bag => "common.items.tag_examples.placeholder",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,8 @@ deunicode = "1.0"
|
|||||||
directories-next = "2.0"
|
directories-next = "2.0"
|
||||||
dot_vox = "4.0"
|
dot_vox = "4.0"
|
||||||
enum-iterator = "0.6"
|
enum-iterator = "0.6"
|
||||||
|
strum = "0.20"
|
||||||
|
strum_macros = "0.20"
|
||||||
glsl-include = "0.3.1"
|
glsl-include = "0.3.1"
|
||||||
guillotiere = "0.6"
|
guillotiere = "0.6"
|
||||||
hashbrown = {version = "0.9", features = ["rayon", "serde", "nightly"]}
|
hashbrown = {version = "0.9", features = ["rayon", "serde", "nightly"]}
|
||||||
|
@ -1,17 +1,22 @@
|
|||||||
use super::{
|
use super::{
|
||||||
img_ids::{Imgs, ImgsRot},
|
img_ids::{Imgs, ImgsRot},
|
||||||
item_imgs::{animate_by_pulse, ItemImgs},
|
item_imgs::{animate_by_pulse, ItemImgs},
|
||||||
TEXT_COLOR, TEXT_DULL_RED_COLOR, TEXT_GRAY_COLOR, UI_HIGHLIGHT_0, UI_MAIN,
|
Show, TEXT_COLOR, TEXT_DULL_RED_COLOR, TEXT_GRAY_COLOR, UI_HIGHLIGHT_0, UI_MAIN,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
i18n::Localization,
|
i18n::Localization,
|
||||||
ui::{fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable},
|
ui::{
|
||||||
|
fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable, Tooltip,
|
||||||
|
TooltipManager, Tooltipable,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use client::{self, Client};
|
use client::{self, Client};
|
||||||
use common::{
|
use common::{
|
||||||
assets::AssetExt,
|
assets::AssetExt,
|
||||||
comp::{
|
comp::{
|
||||||
item::{ItemDef, ItemDesc, MaterialStatManifest, Quality, TagExampleInfo},
|
item::{
|
||||||
|
ItemDef, ItemDesc, ItemKind, ItemTag, MaterialStatManifest, Quality, TagExampleInfo,
|
||||||
|
},
|
||||||
Inventory,
|
Inventory,
|
||||||
},
|
},
|
||||||
recipe::RecipeInput,
|
recipe::RecipeInput,
|
||||||
@ -23,6 +28,9 @@ use conrod_core::{
|
|||||||
};
|
};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use strum::IntoEnumIterator;
|
||||||
|
use strum_macros::EnumIter;
|
||||||
|
|
||||||
widget_ids! {
|
widget_ids! {
|
||||||
pub struct Ids {
|
pub struct Ids {
|
||||||
window,
|
window,
|
||||||
@ -48,11 +56,15 @@ widget_ids! {
|
|||||||
output_img_frame,
|
output_img_frame,
|
||||||
output_img,
|
output_img,
|
||||||
output_amount,
|
output_amount,
|
||||||
|
category_bgs[],
|
||||||
|
category_tabs[],
|
||||||
|
category_imgs[],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
CraftRecipe(String),
|
CraftRecipe(String),
|
||||||
|
ChangeCraftingTab(SelectedCraftingTab),
|
||||||
Close,
|
Close,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,6 +82,8 @@ pub struct Crafting<'a> {
|
|||||||
msm: &'a MaterialStatManifest,
|
msm: &'a MaterialStatManifest,
|
||||||
#[conrod(common_builder)]
|
#[conrod(common_builder)]
|
||||||
common: widget::CommonBuilder,
|
common: widget::CommonBuilder,
|
||||||
|
tooltip_manager: &'a mut TooltipManager,
|
||||||
|
show: &'a mut Show,
|
||||||
}
|
}
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
impl<'a> Crafting<'a> {
|
impl<'a> Crafting<'a> {
|
||||||
@ -84,6 +98,8 @@ impl<'a> Crafting<'a> {
|
|||||||
item_imgs: &'a ItemImgs,
|
item_imgs: &'a ItemImgs,
|
||||||
inventory: &'a Inventory,
|
inventory: &'a Inventory,
|
||||||
msm: &'a MaterialStatManifest,
|
msm: &'a MaterialStatManifest,
|
||||||
|
tooltip_manager: &'a mut TooltipManager,
|
||||||
|
show: &'a mut Show,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
client,
|
client,
|
||||||
@ -93,14 +109,29 @@ impl<'a> Crafting<'a> {
|
|||||||
pulse,
|
pulse,
|
||||||
rot_imgs,
|
rot_imgs,
|
||||||
item_tooltip_manager,
|
item_tooltip_manager,
|
||||||
|
tooltip_manager,
|
||||||
item_imgs,
|
item_imgs,
|
||||||
inventory,
|
inventory,
|
||||||
msm,
|
msm,
|
||||||
|
show,
|
||||||
common: widget::CommonBuilder::default(),
|
common: widget::CommonBuilder::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, EnumIter, PartialEq)]
|
||||||
|
pub enum SelectedCraftingTab {
|
||||||
|
Armor,
|
||||||
|
Weapon,
|
||||||
|
Food,
|
||||||
|
Dismantle,
|
||||||
|
Potion,
|
||||||
|
Bag,
|
||||||
|
Tool,
|
||||||
|
Utility,
|
||||||
|
Glider,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct State {
|
pub struct State {
|
||||||
ids: Ids,
|
ids: Ids,
|
||||||
selected_recipe: Option<String>,
|
selected_recipe: Option<String>,
|
||||||
@ -132,7 +163,6 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let ids = &state.ids;
|
|
||||||
|
|
||||||
let mut events = Vec::new();
|
let mut events = Vec::new();
|
||||||
|
|
||||||
@ -162,17 +192,35 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
.desc_font_size(self.fonts.cyri.scale(12))
|
.desc_font_size(self.fonts.cyri.scale(12))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.desc_text_color(TEXT_COLOR);
|
.desc_text_color(TEXT_COLOR);
|
||||||
|
// Tab tooltips
|
||||||
|
let tabs_tooltip = Tooltip::new({
|
||||||
|
// Edge images [t, b, r, l]
|
||||||
|
// Corner images [tr, tl, br, bl]
|
||||||
|
let edge = &self.rot_imgs.tt_side;
|
||||||
|
let corner = &self.rot_imgs.tt_corner;
|
||||||
|
ImageFrame::new(
|
||||||
|
[edge.cw180, edge.none, edge.cw270, edge.cw90],
|
||||||
|
[corner.none, corner.cw270, corner.cw90, corner.cw180],
|
||||||
|
Color::Rgba(0.08, 0.07, 0.04, 1.0),
|
||||||
|
5.0,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.title_font_size(self.fonts.cyri.scale(15))
|
||||||
|
.parent(ui.window)
|
||||||
|
.desc_font_size(self.fonts.cyri.scale(12))
|
||||||
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
|
.desc_text_color(TEXT_COLOR);
|
||||||
|
|
||||||
Image::new(self.imgs.crafting_window)
|
Image::new(self.imgs.crafting_window)
|
||||||
.bottom_right_with_margins_on(ui.window, 308.0, 450.0)
|
.bottom_right_with_margins_on(ui.window, 308.0, 450.0)
|
||||||
.color(Some(UI_MAIN))
|
.color(Some(UI_MAIN))
|
||||||
.w_h(422.0, 460.0)
|
.w_h(422.0, 460.0)
|
||||||
.set(ids.window, ui);
|
.set(state.ids.window, ui);
|
||||||
Image::new(self.imgs.crafting_frame)
|
Image::new(self.imgs.crafting_frame)
|
||||||
.middle_of(ids.window)
|
.middle_of(state.ids.window)
|
||||||
.color(Some(UI_HIGHLIGHT_0))
|
.color(Some(UI_HIGHLIGHT_0))
|
||||||
.w_h(422.0, 460.0)
|
.w_h(422.0, 460.0)
|
||||||
.set(ids.window_frame, ui);
|
.set(state.ids.window_frame, ui);
|
||||||
Image::new(self.imgs.crafting_icon_bordered)
|
Image::new(self.imgs.crafting_icon_bordered)
|
||||||
.w_h(38.0, 38.0)
|
.w_h(38.0, 38.0)
|
||||||
.top_left_with_margins_on(state.ids.window_frame, 4.0, 4.0)
|
.top_left_with_margins_on(state.ids.window_frame, 4.0, 4.0)
|
||||||
@ -182,8 +230,8 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
.w_h(24.0, 25.0)
|
.w_h(24.0, 25.0)
|
||||||
.hover_image(self.imgs.close_button_hover)
|
.hover_image(self.imgs.close_button_hover)
|
||||||
.press_image(self.imgs.close_button_press)
|
.press_image(self.imgs.close_button_press)
|
||||||
.top_right_with_margins_on(ids.window, 0.0, 0.0)
|
.top_right_with_margins_on(state.ids.window, 0.0, 0.0)
|
||||||
.set(ids.close, ui)
|
.set(state.ids.close, ui)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
events.push(Event::Close);
|
events.push(Event::Close);
|
||||||
@ -191,21 +239,119 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
|
|
||||||
// Title
|
// Title
|
||||||
Text::new(&self.localized_strings.get("hud.crafting"))
|
Text::new(&self.localized_strings.get("hud.crafting"))
|
||||||
.mid_top_with_margin_on(ids.window_frame, 9.0)
|
.mid_top_with_margin_on(state.ids.window_frame, 9.0)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(self.fonts.cyri.scale(20))
|
.font_size(self.fonts.cyri.scale(20))
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(ids.title_main, ui);
|
.set(state.ids.title_main, ui);
|
||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
Rectangle::fill_with([136.0, 378.0], color::TRANSPARENT)
|
Rectangle::fill_with([136.0, 378.0], color::TRANSPARENT)
|
||||||
.top_left_with_margins_on(ids.window_frame, 74.0, 5.0)
|
.top_left_with_margins_on(state.ids.window_frame, 74.0, 5.0)
|
||||||
.scroll_kids_vertically()
|
.scroll_kids_vertically()
|
||||||
.set(ids.align_rec, ui);
|
.set(state.ids.align_rec, ui);
|
||||||
Rectangle::fill_with([274.0, 340.0], color::TRANSPARENT)
|
Rectangle::fill_with([274.0, 340.0], color::TRANSPARENT)
|
||||||
.top_right_with_margins_on(ids.window, 74.0, 5.0)
|
.top_right_with_margins_on(state.ids.window, 74.0, 5.0)
|
||||||
.scroll_kids_vertically()
|
.scroll_kids_vertically()
|
||||||
.set(ids.align_ing, ui);
|
.set(state.ids.align_ing, ui);
|
||||||
|
// Category Tabs
|
||||||
|
if state.ids.category_bgs.len() < SelectedCraftingTab::iter().enumerate().len() {
|
||||||
|
state.update(|s| {
|
||||||
|
s.ids.category_bgs.resize(
|
||||||
|
SelectedCraftingTab::iter().enumerate().len(),
|
||||||
|
&mut ui.widget_id_generator(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
};
|
||||||
|
if state.ids.category_tabs.len() < SelectedCraftingTab::iter().enumerate().len() {
|
||||||
|
state.update(|s| {
|
||||||
|
s.ids.category_tabs.resize(
|
||||||
|
SelectedCraftingTab::iter().enumerate().len(),
|
||||||
|
&mut ui.widget_id_generator(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
};
|
||||||
|
if state.ids.category_imgs.len() < SelectedCraftingTab::iter().enumerate().len() {
|
||||||
|
state.update(|s| {
|
||||||
|
s.ids.category_imgs.resize(
|
||||||
|
SelectedCraftingTab::iter().enumerate().len(),
|
||||||
|
&mut ui.widget_id_generator(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
};
|
||||||
|
let sel_crafting_tab = &self.show.crafting_tab;
|
||||||
|
for i in SelectedCraftingTab::iter().enumerate() {
|
||||||
|
// TODO: i18n!
|
||||||
|
let tab_name = match i.1 {
|
||||||
|
SelectedCraftingTab::Armor => "Armor",
|
||||||
|
SelectedCraftingTab::Dismantle => "Dismantle",
|
||||||
|
SelectedCraftingTab::Food => "Food",
|
||||||
|
SelectedCraftingTab::Glider => "Gliders",
|
||||||
|
SelectedCraftingTab::Potion => "Potions",
|
||||||
|
SelectedCraftingTab::Tool => "Tools",
|
||||||
|
SelectedCraftingTab::Utility => "Utility",
|
||||||
|
SelectedCraftingTab::Weapon => "Weapons",
|
||||||
|
SelectedCraftingTab::Bag => "Weapons",
|
||||||
|
};
|
||||||
|
let tab_img = match i.1 {
|
||||||
|
SelectedCraftingTab::Armor => self.imgs.icon_armor,
|
||||||
|
SelectedCraftingTab::Dismantle => self.imgs.icon_dismantle,
|
||||||
|
SelectedCraftingTab::Food => self.imgs.icon_food,
|
||||||
|
SelectedCraftingTab::Glider => self.imgs.icon_glider,
|
||||||
|
SelectedCraftingTab::Potion => self.imgs.icon_potion,
|
||||||
|
SelectedCraftingTab::Tool => self.imgs.icon_tools,
|
||||||
|
SelectedCraftingTab::Utility => self.imgs.icon_utility,
|
||||||
|
SelectedCraftingTab::Weapon => self.imgs.icon_weapon,
|
||||||
|
SelectedCraftingTab::Bag => self.imgs.icon_bag,
|
||||||
|
};
|
||||||
|
// Button Background
|
||||||
|
let mut bg = Image::new(self.imgs.pixel)
|
||||||
|
.w_h(40.0, 30.0)
|
||||||
|
.color(Some(UI_MAIN));
|
||||||
|
if i.0 == 0 {
|
||||||
|
bg = bg.top_left_with_margins_on(state.ids.window_frame, 50.0, -40.0)
|
||||||
|
} else {
|
||||||
|
bg = bg.down_from(state.ids.category_bgs[i.0 - 1], 0.0)
|
||||||
|
};
|
||||||
|
bg.set(state.ids.category_bgs[i.0], ui);
|
||||||
|
// Category Button
|
||||||
|
if Button::image(if i.1 == *sel_crafting_tab {
|
||||||
|
self.imgs.wpn_icon_border_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.wpn_icon_border
|
||||||
|
})
|
||||||
|
.wh_of(state.ids.category_bgs[i.0])
|
||||||
|
.middle_of(state.ids.category_bgs[i.0])
|
||||||
|
.hover_image(if i.1 == *sel_crafting_tab {
|
||||||
|
self.imgs.wpn_icon_border_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.wpn_icon_border_mo
|
||||||
|
})
|
||||||
|
.press_image(if i.1 == *sel_crafting_tab {
|
||||||
|
self.imgs.wpn_icon_border_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.wpn_icon_border_press
|
||||||
|
})
|
||||||
|
.with_tooltip(
|
||||||
|
self.tooltip_manager,
|
||||||
|
tab_name,
|
||||||
|
"",
|
||||||
|
&tabs_tooltip,
|
||||||
|
TEXT_COLOR,
|
||||||
|
)
|
||||||
|
.set(state.ids.category_tabs[i.0], ui)
|
||||||
|
.was_clicked()
|
||||||
|
{
|
||||||
|
events.push(Event::ChangeCraftingTab(i.1))
|
||||||
|
};
|
||||||
|
// Tab images
|
||||||
|
Image::new(tab_img)
|
||||||
|
.middle_of(state.ids.category_tabs[i.0])
|
||||||
|
.w_h(20.0, 20.0)
|
||||||
|
.graphics_for(state.ids.category_tabs[i.0])
|
||||||
|
.set(state.ids.category_imgs[i.0], ui);
|
||||||
|
}
|
||||||
|
|
||||||
let client = &self.client;
|
let client = &self.client;
|
||||||
// First available recipes, then unavailable ones, each alphabetically
|
// First available recipes, then unavailable ones, each alphabetically
|
||||||
// In the triples, "name" is the recipe book key, and "recipe.output.0.name()"
|
// In the triples, "name" is the recipe book key, and "recipe.output.0.name()"
|
||||||
@ -270,9 +416,9 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
.label_font_size(self.fonts.cyri.scale(12))
|
.label_font_size(self.fonts.cyri.scale(12))
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.image_color(can_perform.then_some(TEXT_COLOR).unwrap_or(TEXT_GRAY_COLOR))
|
.image_color(can_perform.then_some(TEXT_COLOR).unwrap_or(TEXT_GRAY_COLOR))
|
||||||
.mid_bottom_with_margin_on(ids.align_ing, -31.0)
|
.mid_bottom_with_margin_on(state.ids.align_ing, -31.0)
|
||||||
.parent(ids.window_frame)
|
.parent(state.ids.window_frame)
|
||||||
.set(ids.btn_craft, ui)
|
.set(state.ids.btn_craft, ui)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
events.push(Event::CraftRecipe(recipe.clone()));
|
events.push(Event::CraftRecipe(recipe.clone()));
|
||||||
@ -299,8 +445,8 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
Image::new(quality_col_img)
|
Image::new(quality_col_img)
|
||||||
.w_h(60.0, 60.0)
|
.w_h(60.0, 60.0)
|
||||||
.top_right_with_margins_on(state.ids.align_ing, 15.0, 10.0)
|
.top_right_with_margins_on(state.ids.align_ing, 15.0, 10.0)
|
||||||
.parent(ids.align_ing)
|
.parent(state.ids.align_ing)
|
||||||
.set(ids.output_img_frame, ui);
|
.set(state.ids.output_img_frame, ui);
|
||||||
|
|
||||||
if let Some(recipe) = state
|
if let Some(recipe) = state
|
||||||
.selected_recipe
|
.selected_recipe
|
||||||
@ -335,7 +481,36 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recipe list
|
// Recipe list
|
||||||
for (i, (name, recipe, quantity)) in ordered_recipes.into_iter().enumerate() {
|
for (i, (name, recipe, quantity)) in ordered_recipes
|
||||||
|
.into_iter()
|
||||||
|
.filter(|(_name, recipe, _quantity)| match &self.show.crafting_tab {
|
||||||
|
SelectedCraftingTab::Food => recipe.output.0.tags().contains(&ItemTag::Food),
|
||||||
|
SelectedCraftingTab::Armor => match recipe.output.0.kind() {
|
||||||
|
ItemKind::Armor(_) => !recipe.output.0.tags().contains(&ItemTag::Bag),
|
||||||
|
_ => false,
|
||||||
|
},
|
||||||
|
SelectedCraftingTab::Glider => {
|
||||||
|
matches!(recipe.output.0.kind(), ItemKind::Glider(_))
|
||||||
|
},
|
||||||
|
SelectedCraftingTab::Potion => recipe.output.0.tags().contains(&ItemTag::Potion),
|
||||||
|
SelectedCraftingTab::Bag => recipe.output.0.tags().contains(&ItemTag::Bag),
|
||||||
|
SelectedCraftingTab::Tool => {
|
||||||
|
recipe.output.0.tags().contains(&ItemTag::CraftingTool)
|
||||||
|
},
|
||||||
|
SelectedCraftingTab::Utility => recipe.output.0.tags().contains(&ItemTag::Utility),
|
||||||
|
SelectedCraftingTab::Weapon => match recipe.output.0.kind() {
|
||||||
|
ItemKind::Tool(_) => !recipe.output.0.tags().contains(&ItemTag::CraftingTool),
|
||||||
|
_ => false,
|
||||||
|
},
|
||||||
|
SelectedCraftingTab::Dismantle => match recipe.output.0.kind() {
|
||||||
|
ItemKind::Ingredient { .. } => {
|
||||||
|
!recipe.output.0.tags().contains(&ItemTag::CraftingTool)
|
||||||
|
},
|
||||||
|
_ => false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.enumerate()
|
||||||
|
{
|
||||||
let button = Button::image(
|
let button = Button::image(
|
||||||
if state
|
if state
|
||||||
.selected_recipe
|
.selected_recipe
|
||||||
@ -550,26 +725,24 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let ids = &state.ids;
|
|
||||||
// Scrollbars
|
// Scrollbars
|
||||||
Scrollbar::y_axis(ids.align_rec)
|
Scrollbar::y_axis(state.ids.align_rec)
|
||||||
.thickness(5.0)
|
.thickness(5.0)
|
||||||
.rgba(0.33, 0.33, 0.33, 1.0)
|
.rgba(0.33, 0.33, 0.33, 1.0)
|
||||||
.set(ids.scrollbar_rec, ui);
|
.set(state.ids.scrollbar_rec, ui);
|
||||||
Scrollbar::y_axis(ids.align_ing)
|
Scrollbar::y_axis(state.ids.align_ing)
|
||||||
.thickness(5.0)
|
.thickness(5.0)
|
||||||
.rgba(0.33, 0.33, 0.33, 1.0)
|
.rgba(0.33, 0.33, 0.33, 1.0)
|
||||||
.set(ids.scrollbar_ing, ui);
|
.set(state.ids.scrollbar_ing, ui);
|
||||||
|
|
||||||
// Title Recipes and Ingredients
|
// Title Recipes and Ingredients
|
||||||
Text::new(&self.localized_strings.get("hud.crafting.recipes"))
|
Text::new(&self.localized_strings.get("hud.crafting.recipes"))
|
||||||
.mid_top_with_margin_on(ids.align_rec, -22.0)
|
.mid_top_with_margin_on(state.ids.align_rec, -22.0)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.parent(ids.window)
|
.parent(state.ids.window)
|
||||||
.set(ids.title_rec, ui);
|
.set(state.ids.title_rec, ui);
|
||||||
|
|
||||||
events
|
events
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ image_ids! {
|
|||||||
diary_frame: "voxygen.element.misc_bg.diary_frame",
|
diary_frame: "voxygen.element.misc_bg.diary_frame",
|
||||||
diary_exp_bg: "voxygen.element.misc_bg.diary_exp_bg",
|
diary_exp_bg: "voxygen.element.misc_bg.diary_exp_bg",
|
||||||
diary_exp_frame: "voxygen.element.misc_bg.diary_exp_frame",
|
diary_exp_frame: "voxygen.element.misc_bg.diary_exp_frame",
|
||||||
|
pixel: "voxygen.element.misc_bg.pixel",
|
||||||
|
|
||||||
// Skill Trees
|
// Skill Trees
|
||||||
slot_skills: "voxygen.element.buttons.slot_skilltree",
|
slot_skills: "voxygen.element.buttons.slot_skilltree",
|
||||||
@ -104,6 +105,15 @@ image_ids! {
|
|||||||
crafting_icon: "voxygen.element.buttons.anvil",
|
crafting_icon: "voxygen.element.buttons.anvil",
|
||||||
crafting_icon_hover: "voxygen.element.buttons.anvil_hover",
|
crafting_icon_hover: "voxygen.element.buttons.anvil_hover",
|
||||||
crafting_icon_press: "voxygen.element.buttons.anvil_press",
|
crafting_icon_press: "voxygen.element.buttons.anvil_press",
|
||||||
|
icon_armor: "voxygen.element.icons.armors",
|
||||||
|
icon_tools: "voxygen.element.icons.crafting_tools",
|
||||||
|
icon_dismantle: "voxygen.element.icons.dismantle",
|
||||||
|
icon_food: "voxygen.element.icons.foods",
|
||||||
|
icon_glider: "voxygen.element.icons.gliders",
|
||||||
|
icon_potion: "voxygen.element.icons.potions",
|
||||||
|
icon_utility: "voxygen.element.icons.utilities",
|
||||||
|
icon_weapon: "voxygen.element.icons.weapons",
|
||||||
|
icon_bag: "voxygen.element.icons.item_bag_leather_large",
|
||||||
|
|
||||||
// Group Window
|
// Group Window
|
||||||
member_frame: "voxygen.element.frames.group_member_frame",
|
member_frame: "voxygen.element.frames.group_member_frame",
|
||||||
|
@ -31,7 +31,7 @@ use buffs::BuffsBar;
|
|||||||
use buttons::Buttons;
|
use buttons::Buttons;
|
||||||
use chat::Chat;
|
use chat::Chat;
|
||||||
use chrono::NaiveTime;
|
use chrono::NaiveTime;
|
||||||
use crafting::Crafting;
|
use crafting::{Crafting, SelectedCraftingTab};
|
||||||
use diary::{Diary, SelectedSkillTree};
|
use diary::{Diary, SelectedSkillTree};
|
||||||
use esc_menu::EscMenu;
|
use esc_menu::EscMenu;
|
||||||
use group::Group;
|
use group::Group;
|
||||||
@ -544,6 +544,7 @@ pub struct Show {
|
|||||||
ingame: bool,
|
ingame: bool,
|
||||||
settings_tab: SettingsTab,
|
settings_tab: SettingsTab,
|
||||||
skilltreetab: SelectedSkillTree,
|
skilltreetab: SelectedSkillTree,
|
||||||
|
crafting_tab: SelectedCraftingTab,
|
||||||
social_tab: SocialTab,
|
social_tab: SocialTab,
|
||||||
want_grab: bool,
|
want_grab: bool,
|
||||||
stats: bool,
|
stats: bool,
|
||||||
@ -726,6 +727,10 @@ impl Show {
|
|||||||
self.skilltreetab = tree_sel;
|
self.skilltreetab = tree_sel;
|
||||||
self.social = false;
|
self.social = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn selected_crafting_tab(&mut self, sel_cat: SelectedCraftingTab) {
|
||||||
|
self.crafting_tab = sel_cat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PromptDialogSettings {
|
pub struct PromptDialogSettings {
|
||||||
@ -865,6 +870,7 @@ impl Hud {
|
|||||||
group_menu: false,
|
group_menu: false,
|
||||||
settings_tab: SettingsTab::Interface,
|
settings_tab: SettingsTab::Interface,
|
||||||
skilltreetab: SelectedSkillTree::General,
|
skilltreetab: SelectedSkillTree::General,
|
||||||
|
crafting_tab: SelectedCraftingTab::Armor,
|
||||||
social_tab: SocialTab::Online,
|
social_tab: SocialTab::Online,
|
||||||
want_grab: true,
|
want_grab: true,
|
||||||
ingame: true,
|
ingame: true,
|
||||||
@ -2431,6 +2437,8 @@ impl Hud {
|
|||||||
&self.item_imgs,
|
&self.item_imgs,
|
||||||
&inventory,
|
&inventory,
|
||||||
&msm,
|
&msm,
|
||||||
|
tooltip_manager,
|
||||||
|
&mut self.show,
|
||||||
)
|
)
|
||||||
.set(self.ids.crafting_window, ui_widgets)
|
.set(self.ids.crafting_window, ui_widgets)
|
||||||
{
|
{
|
||||||
@ -2449,6 +2457,9 @@ impl Hud {
|
|||||||
self.force_ungrab = true
|
self.force_ungrab = true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
crafting::Event::ChangeCraftingTab(sel_cat) => {
|
||||||
|
self.show.selected_crafting_tab(sel_cat);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user