refined chatbox

This commit is contained in:
yuni 2024-03-21 06:04:06 +01:00
parent 4d82ebb038
commit 50d8d1faee

View file

@ -273,7 +273,7 @@ fn setup(
TextStyle { TextStyle {
font: asset_server.load(FONT), font: asset_server.load(FONT),
font_size: settings.font_size_hud, font_size: settings.font_size_hud,
color: Color::GRAY, color: Color::rgb(0.7, 0.7, 0.7),
..default() ..default()
} }
), ),
@ -287,7 +287,7 @@ fn setup(
} }
), ),
TextSection::new( TextSection::new(
"<Choices>", "\n\n\n",
TextStyle { TextStyle {
font: asset_server.load(FONT), font: asset_server.load(FONT),
font_size: settings.font_size_hud, font_size: settings.font_size_hud,
@ -384,7 +384,12 @@ fn update(
choices.push(format!("{press_this} {reply}")); choices.push(format!("{press_this} {reply}"));
count += 1; count += 1;
} }
chat.sections[2].value = choices.join("\n"); if count < 4 {
for _padding in 0..(4-count) {
choices.push(" ".to_string());
}
chat.sections[2].value = choices.join("\n");
}
// Chat Log and System Log // Chat Log and System Log
let logfilter = if settings.hud_active { let logfilter = if settings.hud_active {
@ -393,7 +398,8 @@ fn update(
|msg: &&Message| { match msg.level { |msg: &&Message| { match msg.level {
LogLevel::Chat => true, LogLevel::Chat => true,
LogLevel::Warning => true, LogLevel::Warning => true,
_ => false LogLevel::Info => true,
//_ => false
}} }}
}; };
let logs_vec: Vec<String> = log.logs.iter() let logs_vec: Vec<String> = log.logs.iter()