Simplify function

This commit is contained in:
Gouvernathor 2023-11-15 21:24:47 +01:00
parent 2ccece1a3d
commit bb2edc9a7b
1 changed files with 5 additions and 6 deletions

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]