Better variables management in top_bar
This commit is contained in:
parent
88b2373832
commit
294cb2c5ee
@ -5,6 +5,20 @@ init python:
|
|||||||
else:
|
else:
|
||||||
return str(round(points/1000.0, 1))+"{size=-2}k{/size}"
|
return str(round(points/1000.0, 1))+"{size=-2}k{/size}"
|
||||||
|
|
||||||
|
# Set banners yanchor depending on the placement (ascending)
|
||||||
|
define housepoints_y = [None, 0.0, 0.25, 0.5, 0.75]
|
||||||
|
|
||||||
|
default slytherin_points = ""
|
||||||
|
default gryffindor_points = ""
|
||||||
|
default ravenclaw_points = ""
|
||||||
|
default hufflepuff_points = ""
|
||||||
|
default slytherin_place = 1
|
||||||
|
default gryffindor_place = 1
|
||||||
|
default ravenclaw_place = 1
|
||||||
|
default hufflepuff_place = 1
|
||||||
|
|
||||||
|
default persistent.toggle_points = False
|
||||||
|
|
||||||
label update_ui_points:
|
label update_ui_points:
|
||||||
# Debug
|
# Debug
|
||||||
|
|
||||||
@ -16,16 +30,13 @@ 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_sorted = sorted((slytherin, gryffindor, ravenclaw, hufflepuff), reverse=True)
|
$ renpy.dynamic(housepoints_sorted = sorted((slytherin, gryffindor, ravenclaw, hufflepuff), reverse=True))
|
||||||
|
|
||||||
$ slytherin_place = housepoints_sorted.index(slytherin)+1
|
$ slytherin_place = housepoints_sorted.index(slytherin)+1
|
||||||
$ gryffindor_place = housepoints_sorted.index(gryffindor)+1
|
$ gryffindor_place = housepoints_sorted.index(gryffindor)+1
|
||||||
$ ravenclaw_place = housepoints_sorted.index(ravenclaw)+1
|
$ ravenclaw_place = housepoints_sorted.index(ravenclaw)+1
|
||||||
$ hufflepuff_place = housepoints_sorted.index(hufflepuff)+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]
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
screen ui_top_bar():
|
screen ui_top_bar():
|
||||||
@ -147,7 +158,7 @@ screen ui_points():
|
|||||||
tooltip "House Points\n{size=-2}Click to toggle style display{/size}"
|
tooltip "House Points\n{size=-2}Click to toggle style display{/size}"
|
||||||
hovered SetLocalVariable("toggle_points", True)
|
hovered SetLocalVariable("toggle_points", True)
|
||||||
unhovered SetLocalVariable("toggle_points", False)
|
unhovered SetLocalVariable("toggle_points", False)
|
||||||
action ToggleVariable("persistent.toggle_points", True, False)
|
action ToggleField(persistent, "toggle_points", True, False)
|
||||||
|
|
||||||
style housepoints:
|
style housepoints:
|
||||||
outlines [(1, "#000", 0, 0)]
|
outlines [(1, "#000", 0, 0)]
|
||||||
|
Loading…
Reference in New Issue
Block a user