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 {
font: asset_server.load(FONT),
font_size: settings.font_size_hud,
color: Color::GRAY,
color: Color::rgb(0.7, 0.7, 0.7),
..default()
}
),
@ -287,7 +287,7 @@ fn setup(
}
),
TextSection::new(
"<Choices>",
"\n\n\n",
TextStyle {
font: asset_server.load(FONT),
font_size: settings.font_size_hud,
@ -384,7 +384,12 @@ fn update(
choices.push(format!("{press_this} {reply}"));
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
let logfilter = if settings.hud_active {
@ -393,7 +398,8 @@ fn update(
|msg: &&Message| { match msg.level {
LogLevel::Chat => true,
LogLevel::Warning => true,
_ => false
LogLevel::Info => true,
//_ => false
}}
};
let logs_vec: Vec<String> = log.logs.iter()