Skip to content

Commit 4578623

Browse files
committed
feat(tag): improve upgrade items
1 parent 1ad208c commit 4578623

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

crates/hyperion-rank-tree/src/inventory.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub const MAIN_SLOT: u16 = 0;
2222
pub const PICKAXE_SLOT: u16 = 1;
2323
pub const BLOCK_SLOT: u16 = 2;
2424
pub const UPGRADE_START_SLOT: u16 = 3;
25-
pub const GUI_SLOT: u16 = 7;
25+
pub const UPGRADE_CLASS_SLOT: u16 = 7;
2626
pub const HELP_SLOT: u16 = 8;
2727

2828
impl Class {
@@ -84,10 +84,10 @@ impl Class {
8484
});
8585

8686
let upgrade_available = [
87-
ItemKind::BlueDye, // Speed
88-
ItemKind::RedDye, // Health
89-
ItemKind::YellowDye, // Armor
90-
ItemKind::GreenDye, // Damage
87+
ItemKind::Feather, // Speed
88+
ItemKind::Apple, // Health
89+
ItemKind::Shield, // Armor
90+
ItemKind::Cactus, // Damage
9191
];
9292

9393
world.get::<&Handles>(|handles| {
@@ -197,10 +197,13 @@ impl Class {
197197
}
198198
}
199199

200-
let upgrade_item = ItemBuilder::new(ItemKind::FireworkStar)
201-
.name("Upgrades")
202-
.build();
200+
let mut upgrade_item = ItemBuilder::new(ItemKind::FireworkStar).name("Upgrades");
201+
202+
if extra_levels > 0 {
203+
upgrade_item = upgrade_item.kind(ItemKind::NetherStar).glowing();
204+
}
203205

204-
inventory.set_hotbar(GUI_SLOT, upgrade_item);
206+
let upgrade_item = upgrade_item.build();
207+
inventory.set_hotbar(UPGRADE_CLASS_SLOT, upgrade_item);
205208
}
206209
}

0 commit comments

Comments
 (0)