Simplify function
This commit is contained in:
parent
2ccece1a3d
commit
bb2edc9a7b
@ -24,13 +24,12 @@ label update_ui_points:
|
|||||||
$ hufflepuff_points = text_points(hufflepuff)
|
$ hufflepuff_points = text_points(hufflepuff)
|
||||||
|
|
||||||
#Check who's in the lead
|
#Check who's in the lead
|
||||||
$ housepoints = [slytherin, gryffindor, ravenclaw, hufflepuff]
|
$ housepoints_sorted = sorted((slytherin, gryffindor, ravenclaw, hufflepuff), reverse=True)
|
||||||
$ housepoints_sorted = sorted(housepoints, reverse=True)
|
|
||||||
|
|
||||||
$ slytherin_place = housepoints_sorted.index(housepoints[0])+1
|
$ slytherin_place = housepoints_sorted.index(slytherin)+1
|
||||||
$ gryffindor_place = housepoints_sorted.index(housepoints[1])+1
|
$ gryffindor_place = housepoints_sorted.index(gryffindor)+1
|
||||||
$ ravenclaw_place = housepoints_sorted.index(housepoints[2])+1
|
$ ravenclaw_place = housepoints_sorted.index(ravenclaw)+1
|
||||||
$ hufflepuff_place = housepoints_sorted.index(housepoints[3])+1
|
$ hufflepuff_place = housepoints_sorted.index(hufflepuff)+1
|
||||||
|
|
||||||
# Set banners yanchor depending on the placement (ascending)
|
# Set banners yanchor depending on the placement (ascending)
|
||||||
$ housepoints_y = [None, 0.0, 0.25, 0.5, 0.75]
|
$ housepoints_y = [None, 0.0, 0.25, 0.5, 0.75]
|
||||||
|
Loading…
Reference in New Issue
Block a user