From 674ea945883c723dc15521ffe58b930288fae6c7 Mon Sep 17 00:00:00 2001 From: alwayscompiling Date: Wed, 20 Jul 2022 22:24:50 -0400 Subject: [PATCH] Pad username out to max length. --- utilities/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utilities/utils.py b/utilities/utils.py index 8162a3a..639eeb2 100644 --- a/utilities/utils.py +++ b/utilities/utils.py @@ -30,8 +30,10 @@ def format_highscore_message(boss_name: str): for i in range(highscore_size): for key, value in boss_data["categories"].items(): if len(value) > i: - score = value[i] - ret_string += f"{i+1}: {score[0]} - {score[1]}".ljust(25, " ") + score_pair = value[i] + username = score_pair[0].ljust(highscores_data["username_length"], " ") + score = score_pair[1] + ret_string += f"{i+1}: {username} - {score}".ljust(25, " ") else: ret_string += f"{i+1}: submit your score".ljust(25, " ") ret_string += "\n"