This commit is contained in:
Pfauenauge90 2019-08-29 02:32:19 +02:00 committed by timokoesters
parent 50c4764588
commit 9a391332a6
No known key found for this signature in database
GPG Key ID: CD80BE9AAEE78097

View File

@ -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,item::Tool};
use common::comp::{item::Tool, Stats};
use conrod_core::{
color,
widget::{self, Button, Image, Rectangle, Text},
@ -353,20 +353,18 @@ 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(
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);
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);
// M2 Slot
Image::new(self.imgs.skillbar_slot_big)
.w_h(40.0 * scale, 40.0 * scale)
@ -377,20 +375,18 @@ 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(
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);
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);
//Slot 5
Image::new(self.imgs.skillbar_slot)
.w_h(20.0 * scale, 20.0 * scale)