I18n move stats

This commit is contained in:
evgenkot 2024-02-13 01:13:18 +05:00 committed by evgenkot
parent eb4911f60d
commit f4ce05a657
2 changed files with 7 additions and 13 deletions

View File

@ -1092,7 +1092,6 @@ fn announce_loot_to_group(
item.duplicate(ability_map, msm), item.duplicate(ability_map, msm),
*uid, *uid,
)); ));
Some(())
}); });
}); });
} }

View File

@ -297,6 +297,8 @@ impl<'a> Widget for LootScroller<'a> {
.set(state.ids.scrollbar, ui); .set(state.ids.scrollbar, ui);
} }
let stats = self.client.state().read_storage::<common::comp::Stats>();
while let Some(list_message) = list_messages.next(ui) { while let Some(list_message) = list_messages.next(ui) {
let i = list_message.i; let i = list_message.i;
@ -365,11 +367,7 @@ impl<'a> Widget for LootScroller<'a> {
.state() .state()
.ecs() .ecs()
.entity_from_uid(*taken_by) .entity_from_uid(*taken_by)
.and_then(|entity| { .and_then(|entity| stats.get(entity).map(|e| e.name.clone()))
let stats =
self.client.state().read_storage::<common::comp::Stats>();
stats.get(entity).map(|e| e.name.clone())
})
}, },
|info| Some(info.player_alias.clone()), |info| Some(info.player_alias.clone()),
) )
@ -390,9 +388,8 @@ impl<'a> Widget for LootScroller<'a> {
None => ("??".to_string(), false), None => ("??".to_string(), false),
}; };
let label = match is_you { let label = if is_you {
true => { self.localized_strings.get_msg_ctx(
self.localized_strings.get_msg_ctx(
"hud-loot-pickup-msg-you", "hud-loot-pickup-msg-you",
&i18n::fluent_args! { &i18n::fluent_args! {
"gender" => user_gender, "gender" => user_gender,
@ -404,9 +401,8 @@ impl<'a> Widget for LootScroller<'a> {
}, },
}, },
) )
} } else {
false => { self.localized_strings.get_msg_ctx(
self.localized_strings.get_msg_ctx(
"hud-loot-pickup-msg", "hud-loot-pickup-msg",
&i18n::fluent_args! { &i18n::fluent_args! {
"gender" => user_gender, "gender" => user_gender,
@ -419,7 +415,6 @@ impl<'a> Widget for LootScroller<'a> {
}, },
}, },
) )
}
}; };
let label_font_size = 20; let label_font_size = 20;