Fixed an error where '{amount} Exp' floater was displayed only in English despite localizations being available

This commit is contained in:
Anton Katsuba 2022-04-19 18:28:15 +03:00
parent c3d4f9972d
commit d37db03270
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix a bug causing NPCs to jitter on interaction and randomly run away.
- Harvester boss arenas should be more accessible and easier to exit
- Fix agents not idling
- Fixed an error where '{amount} Exp' floater did not use existing localizations
## [0.12.0] - 2022-02-19

View File

@ -1522,7 +1522,10 @@ impl Hud {
if floater.exp_change > 0 {
let xp_pool = &floater.xp_pools;
// Don't show 0 Exp
Text::new(&format!("{} Exp", floater.exp_change.max(1)))
let exp_string = &i18n
.get("hud.sct.experience")
.replace("{amount}", &floater.exp_change.max(1).to_string());
Text::new(exp_string)
.font_size(font_size_xp)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
@ -1532,7 +1535,7 @@ impl Hud {
- 3.0,
)
.set(player_sct_bg_id, ui_widgets);
Text::new(&format!("{} Exp", floater.exp_change.max(1)))
Text::new(exp_string)
.font_size(font_size_xp)
.font_id(self.fonts.cyri.conrod_id)
.color(