prettier reply formatting
This commit is contained in:
parent
538ad92e3a
commit
e3e8278d03
14
src/hud.rs
14
src/hud.rs
|
@ -12,6 +12,8 @@ pub const LOG_MAX_TIME_S: u64 = 20;
|
|||
pub const CHOICE_NONE: &str = "";
|
||||
pub const AMBIENT_LIGHT: f32 = 0.0; // Space is DARK
|
||||
pub const AMBIENT_LIGHT_AR: f32 = 20.0;
|
||||
//pub const REPLY_NUMBERS: [char; 10] = ['❶', '❷', '❸', '❹', '❺', '❻', '❼', '❽', '❾', '⓿'];
|
||||
pub const REPLY_NUMBERS: [char; 10] = ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩'];
|
||||
|
||||
pub struct HudPlugin;
|
||||
impl Plugin for HudPlugin {
|
||||
|
@ -370,10 +372,16 @@ fn update(
|
|||
if let Ok(mut chat) = query_chat.get_single_mut() {
|
||||
// Choices
|
||||
let mut choices: Vec<String> = Vec::new();
|
||||
let mut count = 1;
|
||||
let mut count = 0;
|
||||
for choice in &q_choices {
|
||||
choices.push(format!("({}) <{}> {}",
|
||||
count, choice.recipient, choice.text));
|
||||
if count > 9 {
|
||||
break;
|
||||
}
|
||||
let press_this = REPLY_NUMBERS[count];
|
||||
let reply = &choice.text;
|
||||
//let recipient = &choice.recipient;
|
||||
// TODO: indicate recipients if there's more than one
|
||||
choices.push(format!("{press_this} {reply}"));
|
||||
count += 1;
|
||||
}
|
||||
chat.sections[2].value = choices.join("\n");
|
||||
|
|
Loading…
Reference in a new issue