fix #562 Confusing chat alias

This commit is contained in:
scott-c 2020-05-19 19:46:06 +08:00
parent c4cd2f5283
commit 288c7cdbfa
2 changed files with 15 additions and 8 deletions

View File

@ -408,10 +408,12 @@ impl<'a> System<'a> for Sys {
let _ = speech_bubbles.insert(entity, bubble);
match players.get(entity) {
Some(player) => {
let stat =
stats.get(entity).expect("Expected stat.name for player");
if admins.get(entity).is_some() {
format!("[ADMIN][{}] {}", &player.alias, message)
format!("[ADMIN][{}] {}", &stat.name, message)
} else {
format!("[{}] {}", &player.alias, message)
format!("[{}] {}", &stat.name, message)
}
},
None => format!("[<Unknown>] {}", message),

View File

@ -193,12 +193,17 @@ impl<'a> Widget for Social<'a> {
.color(TEXT_COLOR)
.set(ids.online_title, ui);
for (i, (_, player_alias)) in self.client.player_list.iter().enumerate() {
Text::new(player_alias)
.down(3.0)
.font_size(self.fonts.cyri.scale(15))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(ids.player_names[i], ui);
Text::new(&format!(
"({}) {} Lvl {}",
player_alias,
self.client.character_list.characters[i].character.alias,
self.client.character_list.characters[i].level
))
.down(3.0)
.font_size(self.fonts.cyri.scale(15))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(ids.player_names[i], ui);
}
}