From bb2edc9a7bca99da2286b402aadad8b64a610335 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:24:47 +0100 Subject: [PATCH] Simplify function --- game/scripts/interface/topbar.rpy | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/game/scripts/interface/topbar.rpy b/game/scripts/interface/topbar.rpy index 484b06e4..24212909 100644 --- a/game/scripts/interface/topbar.rpy +++ b/game/scripts/interface/topbar.rpy @@ -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]