Change tuple to list. Its stored as a list anyways.
This commit is contained in:
@@ -66,15 +66,15 @@ class HighscoresData:
|
|||||||
minutes = score.split(":")[0]
|
minutes = score.split(":")[0]
|
||||||
seconds = score.split(":")[1]
|
seconds = score.split(":")[1]
|
||||||
score_seconds = int(minutes) * 60 + float(seconds)
|
score_seconds = int(minutes) * 60 + float(seconds)
|
||||||
score_tuple = (score, score_seconds)
|
score_list = [score, score_seconds]
|
||||||
sort_index = 1
|
sort_index = 1
|
||||||
else:
|
else:
|
||||||
score_tuple = int(score)
|
score_list = [int(score)]
|
||||||
sort_index = 0
|
sort_index = 0
|
||||||
|
|
||||||
# Will not ensure new score is better than old one. Allows for correcting mistakes.
|
# Will not ensure new score is better than old one. Allows for correcting mistakes.
|
||||||
|
|
||||||
scores[user] = score_tuple
|
scores[user] = score_list
|
||||||
|
|
||||||
scores = dict(sorted(scores.items(), key=lambda x: x[1][sort_index], reverse=not ascending))
|
scores = dict(sorted(scores.items(), key=lambda x: x[1][sort_index], reverse=not ascending))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user