From 60b8102f865ee5561fd7ed0b8bb8a01e5ed97eb7 Mon Sep 17 00:00:00 2001 From: Pfauenauge90 <44173739+Pfauenauge90@users.noreply.github.com> Date: Mon, 6 Apr 2020 23:16:24 +0200 Subject: [PATCH] slot kinds --- voxygen/src/hud/bag.rs | 28 ++++++++++++++-------------- voxygen/src/hud/img_ids.rs | 4 ++-- voxygen/src/hud/slot_kinds.rs | 11 +++++++++-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 60a74ac19f..e166c8a166 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -67,8 +67,8 @@ widget_ids! { hands_slot, legs_slot, belt_slot, - ring_r_slot, - ring_l_slot, + lantern_slot, + ring_slot, feet_slot, back_slot, tabard_slot, @@ -404,27 +404,27 @@ impl<'a> Widget for Bag<'a> { .with_icon(self.imgs.legs_bg, Vec2::new(48.0, 70.0), Some(UI_MAIN)) .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.legs_slot, ui); - // Ring-L - let (title, desc) = ("Left Ring", ""); + // Lantern + let (title, desc) = ("Lantern", ""); slot_maker - .fabricate(ArmorSlot::LeftRing, [45.0; 2]) + .fabricate(ArmorSlot::Lantern, [45.0; 2]) .bottom_right_with_margins_on(state.ids.shoulders_slot, -55.0, 0.0) - .with_icon(self.imgs.ring_l_bg, Vec2::new(36.0, 40.0), Some(UI_MAIN)) + .with_icon(self.imgs.lantern_bg, Vec2::new(24.0, 38.0), Some(UI_MAIN)) .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) - .set(state.ids.ring_l_slot, ui); - // Ring-R - let (title, desc) = ("Right Ring", ""); + .set(state.ids.lantern_slot, ui); + // Ring + let (title, desc) = ("Ring", ""); slot_maker - .fabricate(ArmorSlot::RightRing, [45.0; 2]) + .fabricate(ArmorSlot::Ring, [45.0; 2]) .bottom_left_with_margins_on(state.ids.hands_slot, -55.0, 0.0) - .with_icon(self.imgs.ring_r_bg, Vec2::new(36.0, 40.0), Some(UI_MAIN)) + .with_icon(self.imgs.ring_bg, Vec2::new(36.0, 40.0), Some(UI_MAIN)) .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) - .set(state.ids.ring_r_slot, ui); + .set(state.ids.ring_slot, ui); // Back let (title, desc) = ("Back", ""); slot_maker .fabricate(ArmorSlot::Back, [45.0; 2]) - .down_from(state.ids.ring_l_slot, 10.0) + .down_from(state.ids.lantern_slot, 10.0) .with_icon(self.imgs.back_bg, Vec2::new(33.0, 40.0), Some(UI_MAIN)) .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.back_slot, ui); @@ -435,7 +435,7 @@ impl<'a> Widget for Bag<'a> { .map_or(("Feet", ""), |item| (item.name(), item.description())); slot_maker .fabricate(ArmorSlot::Feet, [45.0; 2]) - .down_from(state.ids.ring_r_slot, 10.0) + .down_from(state.ids.ring_slot, 10.0) .with_icon(self.imgs.feet_bg, Vec2::new(32.0, 40.0), Some(UI_MAIN)) .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.feet_slot, ui); diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index a49e22e810..719018b21d 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -238,11 +238,11 @@ image_ids! { belt_bg: "voxygen.element.icons.belt", legs_bg: "voxygen.element.icons.legs", feet_bg: "voxygen.element.icons.feet", - ring_r_bg: "voxygen.element.icons.ring", - ring_l_bg: "voxygen.element.icons.ring", + ring_bg: "voxygen.element.icons.ring", tabard_bg: "voxygen.element.icons.tabard", chest_bg: "voxygen.element.icons.chest", back_bg: "voxygen.element.icons.back", + lantern_bg: "voxygen.element.icons.lantern", necklace_bg: "voxygen.element.icons.necklace", mainhand_bg: "voxygen.element.icons.mainhand", offhand_bg: "voxygen.element.icons.offhand", diff --git a/voxygen/src/hud/slot_kinds.rs b/voxygen/src/hud/slot_kinds.rs index 017c31c3df..6dcf3d260d 100644 --- a/voxygen/src/hud/slot_kinds.rs +++ b/voxygen/src/hud/slot_kinds.rs @@ -8,6 +8,7 @@ pub enum HudSlotKinds { Inventory(InventorySlot), Armor(ArmorSlot), Hotbar(HotbarSlot), + //Spellbook(SpellbookSlot), TODO } pub type HudSlotManager = SlotManager; @@ -22,8 +23,8 @@ pub enum ArmorSlot { Shoulders, Chest, Hands, - LeftRing, - RightRing, + Ring, + Lantern, Back, Belt, Legs, @@ -86,6 +87,12 @@ impl ContentKey for ArmorSlot { ArmorSlot::Hands => source.hand.as_ref(), ArmorSlot::Legs => source.pants.as_ref(), ArmorSlot::Feet => source.foot.as_ref(), + ArmorSlot::Back => source.back.as_ref(), + ArmorSlot::Ring => source.ring.as_ref(), + ArmorSlot::Neck => source.neck.as_ref(), + ArmorSlot::Head => source.head.as_ref(), + ArmorSlot::Lantern => source.lantern.as_ref(), + ArmorSlot::Tabard => source.tabard.as_ref(), ArmorSlot::Mainhand => source.active_item.as_ref().map(|i| &i.item), ArmorSlot::Offhand => source.second_item.as_ref().map(|i| &i.item), _ => None,