mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 16:58:55 +00:00
Add combo into ranks
This commit is contained in:
parent
6bf2779d61
commit
a728119fbe
1 changed files with 19 additions and 3 deletions
|
@ -362,15 +362,26 @@ async fn show_leaderboard(ctx: &Context, m: &Message, bm: BeatmapWithMode) -> Co
|
||||||
.max()
|
.max()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.max(4);
|
.max(4);
|
||||||
|
let combos = scores
|
||||||
|
.iter()
|
||||||
|
.map(|(_, _, v)| format!("{}x", v.max_combo))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let cw = combos
|
||||||
|
.iter()
|
||||||
|
.map(|v| v.len())
|
||||||
|
.max()
|
||||||
|
.unwrap()
|
||||||
|
.max(5);
|
||||||
let mut content = MessageBuilder::new();
|
let mut content = MessageBuilder::new();
|
||||||
content
|
content
|
||||||
.push_line("```")
|
.push_line("```")
|
||||||
.push_line(format!(
|
.push_line(format!(
|
||||||
"rank | {:>pw$} | {:mdw$} | {:rw$} | {:>aw$} | {:mw$} | {:uw$}",
|
"rank | {:>pw$} | {:mdw$} | {:rw$} | {:>aw$} | {:>cw$} | {:mw$} | {:uw$}",
|
||||||
"pp",
|
"pp",
|
||||||
"mods",
|
"mods",
|
||||||
"rank",
|
"rank",
|
||||||
"acc",
|
"acc",
|
||||||
|
"combo",
|
||||||
"miss",
|
"miss",
|
||||||
"user",
|
"user",
|
||||||
pw = pw,
|
pw = pw,
|
||||||
|
@ -379,9 +390,11 @@ async fn show_leaderboard(ctx: &Context, m: &Message, bm: BeatmapWithMode) -> Co
|
||||||
aw = aw,
|
aw = aw,
|
||||||
mw = mw,
|
mw = mw,
|
||||||
uw = uw,
|
uw = uw,
|
||||||
|
cw = cw,
|
||||||
))
|
))
|
||||||
.push_line(format!(
|
.push_line(format!(
|
||||||
"-------{:-<pw$}---{:-<mdw$}---{:-<rw$}---{:-<aw$}---{:-<mw$}---{:-<uw$}",
|
"-------{:-<pw$}---{:-<mdw$}---{:-<rw$}---{:-<aw$}---{:-<cw$}---{:-<mw$}---{:-<uw$}",
|
||||||
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -394,21 +407,24 @@ async fn show_leaderboard(ctx: &Context, m: &Message, bm: BeatmapWithMode) -> Co
|
||||||
aw = aw,
|
aw = aw,
|
||||||
mw = mw,
|
mw = mw,
|
||||||
uw = uw,
|
uw = uw,
|
||||||
|
cw = cw,
|
||||||
));
|
));
|
||||||
for (id, (_, member, p)) in scores.iter().enumerate() {
|
for (id, (_, member, p)) in scores.iter().enumerate() {
|
||||||
content.push_line_safe(format!(
|
content.push_line_safe(format!(
|
||||||
"{:>4} | {:>pw$} | {:>mdw$} | {:>rw$} | {:>aw$} | {:>mw$} | {:uw$}",
|
"{:>4} | {:>pw$} | {:>mdw$} | {:>rw$} | {:>aw$} | {:>cw$} | {:>mw$} | {:uw$}",
|
||||||
format!("#{}", 1 + id + start),
|
format!("#{}", 1 + id + start),
|
||||||
pp[id],
|
pp[id],
|
||||||
p.mods.to_string(),
|
p.mods.to_string(),
|
||||||
ranks[id],
|
ranks[id],
|
||||||
accuracies[id],
|
accuracies[id],
|
||||||
|
combos[id],
|
||||||
misses[id],
|
misses[id],
|
||||||
member,
|
member,
|
||||||
pw = pw,
|
pw = pw,
|
||||||
mdw = mdw,
|
mdw = mdw,
|
||||||
rw = rw,
|
rw = rw,
|
||||||
aw = aw,
|
aw = aw,
|
||||||
|
cw = cw,
|
||||||
mw = mw,
|
mw = mw,
|
||||||
uw = uw,
|
uw = uw,
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Reference in a new issue