From cdd0959c4caa5f6f6e451a9bc8ab63944b14b3cc Mon Sep 17 00:00:00 2001 From: hodasemi Date: Fri, 30 Aug 2024 06:59:23 +0200 Subject: [PATCH] Improve stats on items --- rpg_components/src/items/item.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rpg_components/src/items/item.rs b/rpg_components/src/items/item.rs index 46760f6..bb09bb8 100644 --- a/rpg_components/src/items/item.rs +++ b/rpg_components/src/items/item.rs @@ -261,16 +261,21 @@ impl Item { agility_field.set_text(&format!("{}", self.attributes.agility().raw()))?; intelligence_field.set_text(&format!("{}", self.attributes.intelligence().raw()))?; + let too_low_stat_background = FillTypeInfo::Element( + ElementDescriptor::new(Color::try_from("#AB7474")?, Color::try_from("#824040")?, 2), + DisplayableFillType::Expand, + ); + if attributes.strength().raw() < self.attributes.strength().raw() { - strength_field.set_background(Color::try_from("#AB7474")?)?; + strength_field.set_background(too_low_stat_background.clone())?; } if attributes.agility().raw() < self.attributes.agility().raw() { - agility_field.set_background(Color::try_from("#AB7474")?)?; + agility_field.set_background(too_low_stat_background.clone())?; } if attributes.intelligence().raw() < self.attributes.intelligence().raw() { - intelligence_field.set_background(Color::try_from("#AB7474")?)?; + intelligence_field.set_background(too_low_stat_background)?; } let mut index = Self::INSPECTOR_OFFSET;