Merge branch 'snowram/fix-consumables-desc' into 'master'

Truncates consumables value to the first decimal place

See merge request veloren/veloren!2455
This commit is contained in:
Marcel 2021-06-15 18:13:27 +00:00
commit ee26df5915

View File

@ -116,13 +116,13 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String {
let buff_desc = match buff.kind {
BuffKind::Saturation | BuffKind::Regeneration | BuffKind::Potion => i18n
.get("buff.stat.health")
.replace("{str_total}", &str_total.to_string()),
.replace("{str_total}", &*format!("{:.1}", &str_total)),
BuffKind::IncreaseMaxEnergy => i18n
.get("buff.stat.increase_max_stamina")
.replace("{strength}", &strength.to_string()),
.replace("{strength}", &*format!("{:.1}", &strength)),
BuffKind::IncreaseMaxHealth => i18n
.get("buff.stat.increase_max_health")
.replace("{strength}", &strength.to_string()),
.replace("{strength}", &*format!("{:.1}", &strength)),
BuffKind::Invulnerability => i18n.get("buff.stat.invulnerability").to_string(),
BuffKind::Bleeding
| BuffKind::Burning