(achievements): Reduce bar size.

This commit is contained in:
2022-01-28 18:08:33 +02:00
parent 4fc1494a8f
commit 9cd308d93a

View File

@@ -42,14 +42,14 @@ class Achievement:
self.level_id: int = None self.level_id: int = None
@staticmethod @staticmethod
def progress_bar(value, minimum, maximum, width=15) -> str: def progress_bar(value, minimum, maximum, width=10) -> str:
""" """
Build a text progress bar representing `value` between `minimum` and `maximum`. Build a text progress bar representing `value` between `minimum` and `maximum`.
""" """
emojis = conf.emojis emojis = conf.emojis
proportion = (value - minimum) / (maximum - minimum) proportion = (value - minimum) / (maximum - minimum)
sections = max(int(proportion * width), 0) sections = min(max(int(proportion * width), 0), width)
bar = [] bar = []
# Starting segment # Starting segment