(achievements): Reduce bar size.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user