Simplify function

(cherry picked from commit bb2edc9a7b)
This commit is contained in:
Gouvernathor 2023-11-15 21:24:47 +01:00 committed by LoafyLemon
parent 0e9dae05bd
commit 993b5c845a

View File

@ -24,13 +24,12 @@ label update_ui_points:
$ hufflepuff_points = text_points(hufflepuff)
#Check who's in the lead
$ housepoints = [slytherin, gryffindor, ravenclaw, hufflepuff]
$ housepoints_sorted = sorted(housepoints, reverse=True)
$ housepoints_sorted = sorted((slytherin, gryffindor, ravenclaw, hufflepuff), reverse=True)
$ slytherin_place = housepoints_sorted.index(housepoints[0])+1
$ gryffindor_place = housepoints_sorted.index(housepoints[1])+1
$ ravenclaw_place = housepoints_sorted.index(housepoints[2])+1
$ hufflepuff_place = housepoints_sorted.index(housepoints[3])+1
$ slytherin_place = housepoints_sorted.index(slytherin)+1
$ gryffindor_place = housepoints_sorted.index(gryffindor)+1
$ ravenclaw_place = housepoints_sorted.index(ravenclaw)+1
$ hufflepuff_place = housepoints_sorted.index(hufflepuff)+1
# Set banners yanchor depending on the placement (ascending)
$ housepoints_y = [None, 0.0, 0.25, 0.5, 0.75]