From 50c4764588a7ce4915b854b3e2fcba8eb2a6b871 Mon Sep 17 00:00:00 2001 From: Pfauenauge90 <44173739+Pfauenauge90@users.noreply.github.com> Date: Thu, 29 Aug 2019 02:29:49 +0200 Subject: [PATCH] changed debug wand visuals, added icons for 2h sword main and alt attack --- assets/voxygen/element/icons/2hsword_m1.vox | 4 +-- assets/voxygen/element/icons/2hsword_m2.vox | 4 +-- assets/voxygen/voxel/weapon/debug_wand.vox | 4 +-- voxygen/src/hud/skillbar.rs | 36 +++++++++++++++++---- voxygen/src/scene/figure.rs | 2 +- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/assets/voxygen/element/icons/2hsword_m1.vox b/assets/voxygen/element/icons/2hsword_m1.vox index 047bcff2d6..43d414a471 100644 --- a/assets/voxygen/element/icons/2hsword_m1.vox +++ b/assets/voxygen/element/icons/2hsword_m1.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6132614fe0728ad148f2d59ce8b449f2029d9a3733ab0931553847d9cde8d75b -size 49374 +oid sha256:d3c17bad0e68825da2323d17a63538cc961aa7d4c26fa0d4673b25104eff9947 +size 51425 diff --git a/assets/voxygen/element/icons/2hsword_m2.vox b/assets/voxygen/element/icons/2hsword_m2.vox index 1446107b30..475e7bffdd 100644 --- a/assets/voxygen/element/icons/2hsword_m2.vox +++ b/assets/voxygen/element/icons/2hsword_m2.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc501ea2054ed0e13a7d0a686db0cc3e6a047ebd22d9b31d218e98eea643f074 -size 50430 +oid sha256:dbff81874b08d00743ec3cbf807429b05f6a0a9ee071b02d479bbc6bdcb45b69 +size 51766 diff --git a/assets/voxygen/voxel/weapon/debug_wand.vox b/assets/voxygen/voxel/weapon/debug_wand.vox index 23509f0c96..205ee34d8e 100644 --- a/assets/voxygen/voxel/weapon/debug_wand.vox +++ b/assets/voxygen/voxel/weapon/debug_wand.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ffbd004390e91c7054cf4262e5ca538ba998f61cdf2fb692f54ab18e04c40d0 -size 29771 +oid sha256:ac49a07298e92bb37e01a981efaa8d822b4e3fbd6131b564dca3366f5bccd995 +size 45980 diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 88906fe71a..2535564ed2 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -3,7 +3,7 @@ use super::{ /*FOCUS_COLOR, RAGE_COLOR,*/ HP_COLOR, LOW_HP_COLOR, MANA_COLOR, TEXT_COLOR, XP_COLOR, }; use crate::GlobalState; -use common::comp::Stats; +use common::comp::{Stats,item::Tool}; use conrod_core::{ color, widget::{self, Button, Image, Rectangle, Text}, @@ -92,7 +92,8 @@ pub struct Skillbar<'a> { stats: &'a Stats, #[conrod(common_builder)] common: widget::CommonBuilder, - current_resource: ResourceType, + current_resource: ResourceType, + pub character_tool: Option, } impl<'a> Skillbar<'a> { @@ -102,13 +103,14 @@ impl<'a> Skillbar<'a> { fonts: &'a Fonts, stats: &'a Stats, ) -> Self { - Self { + Self { imgs, _fonts: fonts, stats, global_state, - current_resource: ResourceType::Mana, + current_resource: ResourceType::Mana, common: widget::CommonBuilder::default(), + character_tool: Some(Tool::Sword), // TODO: Pass the actual equipped weapon } } } @@ -155,7 +157,7 @@ impl<'a> Widget for Skillbar<'a> { let energy_percentage = self.stats.energy.current() as f64 / self.stats.energy.maximum() as f64 * 100.0; - let scale = 2.0; + let scale = 2.0; let bar_values = self.global_state.settings.gameplay.bar_numbers; let shortcuts = self.global_state.settings.gameplay.shortcut_numbers; @@ -351,7 +353,17 @@ impl<'a> Widget for Skillbar<'a> { .color(Some(BG_COLOR)) .middle_of(state.ids.m1_slot) .set(state.ids.m1_slot_bg, ui); - Button::image(self.imgs.twohhammer_m1) // Insert Icon here + Button::image( + match self.character_tool { + Some(Tool::Sword) => {self.imgs.twohsword_m1} + Some(Tool::Axe) => {self.imgs.twohhammer_m1} + Some(Tool::Hammer) => {self.imgs.twohhammer_m1} + Some(Tool::Bow) => {self.imgs.twohhammer_m1} + Some(Tool::Daggers) => {self.imgs.twohhammer_m1} + Some(Tool::Staff) => {self.imgs.twohhammer_m1} + _ => {self.imgs.twohhammer_m1} + } + ) // Insert Icon here .w_h(38.0 * scale, 38.0 * scale) .middle_of(state.ids.m1_slot_bg) .set(state.ids.m1_content, ui); @@ -365,7 +377,17 @@ impl<'a> Widget for Skillbar<'a> { .color(Some(BG_COLOR)) .middle_of(state.ids.m2_slot) .set(state.ids.m2_slot_bg, ui); - Button::image(self.imgs.twohhammer_m2) // Insert Icon here + Button::image( + match self.character_tool { + Some(Tool::Sword) => {self.imgs.twohsword_m2} + Some(Tool::Axe) => {self.imgs.twohhammer_m2} + Some(Tool::Hammer) => {self.imgs.twohhammer_m2} + Some(Tool::Bow) => {self.imgs.twohhammer_m2} + Some(Tool::Daggers) => {self.imgs.twohhammer_m2} + Some(Tool::Staff) => {self.imgs.twohhammer_m2} + _ => {self.imgs.twohhammer_m2} + } + ) // Insert Icon here .w_h(38.0 * scale, 38.0 * scale) .middle_of(state.ids.m2_slot_bg) .set(state.ids.m2_content, ui); diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 11c27e5a8d..7f5651e73e 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -321,7 +321,7 @@ impl FigureModelCache { Tool::Bow => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)), Tool::Staff => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)), }, - Item::Debug(_) => ("weapon.debug_wand", Vec3::new(-2.5, -6.5, -2.0)), + Item::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)), _ => ("figure.empty", Vec3::default()), }; Self::load_mesh(name, offset)