Improve stats on items

This commit is contained in:
hodasemi 2024-08-30 06:59:23 +02:00
parent c39e18f631
commit cdd0959c4c

View file

@ -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;