Simplify and quicken summon list iteration
(cherry picked from commit 110847e9e6
)
This commit is contained in:
parent
d1345a051d
commit
7beb1e4c1d
@ -3,7 +3,6 @@
|
|||||||
####################################
|
####################################
|
||||||
|
|
||||||
default summon_show_busy = True
|
default summon_show_busy = True
|
||||||
define summon_categories_sorted = ("Snape", "Tonks", "Hermione", "Cho", "Luna", "Astoria", "Susan") #"Ginny", "Daphne", "Padma", "Patil", "Myrtle", "Mafkin"
|
|
||||||
|
|
||||||
label summon:
|
label summon:
|
||||||
$ gui.in_context("summon_menu")
|
$ gui.in_context("summon_menu")
|
||||||
@ -71,6 +70,7 @@ label summon_menu(xx=723, yy=90):
|
|||||||
|
|
||||||
# Door dictionary
|
# Door dictionary
|
||||||
summon_dict = {
|
summon_dict = {
|
||||||
|
# the order will be the one in the menu
|
||||||
"Snape": {"ico": "snape", "flag": states.sna.unlocked, "busy": states.sna.busy, "loc": "randomsnape"},
|
"Snape": {"ico": "snape", "flag": states.sna.unlocked, "busy": states.sna.busy, "loc": "randomsnape"},
|
||||||
"Tonks": {"ico": "tonks", "flag": states.ton.unlocked, "busy": states.ton.busy, "loc": "randomtonks"},
|
"Tonks": {"ico": "tonks", "flag": states.ton.unlocked, "busy": states.ton.busy, "loc": "randomtonks"},
|
||||||
"Hermione": {"ico": "hermione", "flag": states.her.unlocked, "busy": states.her.busy, "loc": states.her.map_location },
|
"Hermione": {"ico": "hermione", "flag": states.her.unlocked, "busy": states.her.busy, "loc": states.her.map_location },
|
||||||
@ -78,6 +78,7 @@ label summon_menu(xx=723, yy=90):
|
|||||||
"Luna": {"ico": "luna", "flag": states.lun.unlocked, "busy": states.lun.busy, "loc": states.lun.map_location},
|
"Luna": {"ico": "luna", "flag": states.lun.unlocked, "busy": states.lun.busy, "loc": states.lun.map_location},
|
||||||
"Astoria": {"ico": "astoria", "flag": states.ast.unlocked, "busy": states.ast.busy, "loc": states.ast.map_location },
|
"Astoria": {"ico": "astoria", "flag": states.ast.unlocked, "busy": states.ast.busy, "loc": states.ast.map_location },
|
||||||
"Susan": {"ico": "susan", "flag": states.sus.unlocked, "busy": states.sus.busy, "loc": states.sus.map_location}
|
"Susan": {"ico": "susan", "flag": states.sus.unlocked, "busy": states.sus.busy, "loc": states.sus.map_location}
|
||||||
|
#"Ginny", "Daphne", "Padma", "Patil", "Myrtle", "Mafkin"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -147,9 +148,9 @@ screen summon_menu():
|
|||||||
vbox:
|
vbox:
|
||||||
pos (6, 6)
|
pos (6, 6)
|
||||||
$ allbusy = True
|
$ allbusy = True
|
||||||
for char in summon_categories_sorted:
|
for char, char_dict in summon_dict.items():
|
||||||
if summon_dict[char]["flag"]:
|
if char_dict["flag"]:
|
||||||
if summon_show_busy or not summon_dict[char]["busy"]:
|
if summon_show_busy or not char_dict["busy"]:
|
||||||
$ allbusy = False
|
$ allbusy = False
|
||||||
frame:
|
frame:
|
||||||
style "empty"
|
style "empty"
|
||||||
@ -163,7 +164,7 @@ screen summon_menu():
|
|||||||
text_xalign 0.6 text_yalign 0.5
|
text_xalign 0.6 text_yalign 0.5
|
||||||
text_xanchor 0.5
|
text_xanchor 0.5
|
||||||
text_size 20
|
text_size 20
|
||||||
if not summon_dict[char]["busy"]:
|
if not char_dict["busy"]:
|
||||||
action Call("summon_menu.summon", char, from_current=True)
|
action Call("summon_menu.summon", char, from_current=True)
|
||||||
else:
|
else:
|
||||||
text_color "#8C8C70"
|
text_color "#8C8C70"
|
||||||
@ -176,9 +177,9 @@ screen summon_menu():
|
|||||||
background gui.format("interface/achievements/{}/iconbox.webp")
|
background gui.format("interface/achievements/{}/iconbox.webp")
|
||||||
foreground "interface/achievements/glass_iconbox.webp"
|
foreground "interface/achievements/glass_iconbox.webp"
|
||||||
xysize (48, 48)
|
xysize (48, 48)
|
||||||
add crop_image_zoom("interface/icons/head/"+summon_dict[char]["ico"]+".webp", 42, 42, summon_dict[char]["busy"]) align (0.5, 0.5)
|
add crop_image_zoom("interface/icons/head/"+char_dict["ico"]+".webp", 42, 42, char_dict["busy"]) align (0.5, 0.5)
|
||||||
|
|
||||||
text map_transcript_loc[summon_dict[char]["loc"]] size 10 xalign 0.625 yalign 0.9 xanchor 0.5
|
text map_transcript_loc[char_dict["loc"]] size 10 xalign 0.625 yalign 0.9 xanchor 0.5
|
||||||
|
|
||||||
if not states.sna.unlocked:
|
if not states.sna.unlocked:
|
||||||
text "You don't know anyone" size 12 at truecenter
|
text "You don't know anyone" size 12 at truecenter
|
||||||
|
Loading…
Reference in New Issue
Block a user