WTS/game/scripts/interface/door.rpy
LoafyLemon 5c952fe7da Translation support - Part 1
* Added language switch option (WIP)
* Fixed translation generation cache cleanup
* Fixed python strings being untranslatable (partially)
2022-10-31 20:35:00 +00:00

158 lines
6.6 KiB
Plaintext

####################################
############# Menu #################
####################################
default summon_show_busy = True
label summon:
$ gui.in_context("summon_menu")
jump main_room_menu
label summon_menu(xx=723, yy=90):
call update_stats
$ map_transcript_loc = {
"library": _("Library"),
"room_g": _("Gryffindor Dormitory"),
"room_s": _("Slytherin Dormitory"),
"room_r": _("Ravenclaw Dormitory"),
"room_h": _("Hufflepuff Dormitory"),
"great_hall": _("Great Hall"),
"courtyard": _("Courtyard"),
"forest": _("Forest"),
"greenhouse": _("Greenhouse"),
"defense": _("D.A.D.A Classroom"),
"training_grounds": _("Training Grounds"),
"Lake": _("Lake"),
"randomstudent": renpy.random.choice([_("Classroom"), _("Bathroom"), _("Hagrid's Hut"), _("Weasley's Store"), _("Mafkin's Store"), _("Broom Cupboard"), _("Attic")]),
"randomsnape": renpy.random.choice([_("Classroom"), _("Boathouse"), _("Bathroom"), _("Snape's Office"), _("Hall"), _("Slytherin Dormitory"), _("Library"), _("Attic"), _("Forest"), _("Lake"), _("Dungeons"), _("Quidditch Cave"), _("Staircase"), _("Behind your door"), _("Room of Doom")]),
"randomtonks": renpy.random.choice([_("Classroom"), _("Bathroom"), _("Hall"), _("Gryffindor Dormitory"), _("Slytherin Dormitory"), _("Hufflepuff Dormitory"), _("Ravenclaw Dormitory"), _("Training Grounds"), _("Tonks' Room"), _("Quidditch Pitch"), _("Infirmary"), _("Sex Dungeon"), _("Hospital Wing"), _("Forest"), _("Lake"), _("Greenhouse"), _("Mafkin's Store")])}
# Door dictionary
$ summon_dict = {
_("Snape"): {"ico": "snape", "flag": snape_unlocked, "busy": snape_busy, "loc": "randomsnape"},
_("Tonks"): {"ico": "tonks", "flag": tonks_unlocked, "busy": tonks_busy, "loc": "randomtonks"},
_("Hermione"): {"ico": "hermione", "flag": hermione_unlocked, "busy": hermione_busy, "loc": her_map_location},
_("Cho"): {"ico": "cho", "flag": cho_unlocked, "busy": cho_busy, "loc": cho_map_location},
_("Luna"): {"ico": "luna", "flag": luna_unlocked, "busy": luna_busy, "loc": lun_map_location},
_("Astoria"): {"ico": "astoria", "flag": astoria_unlocked, "busy": astoria_busy, "loc": ast_map_location},
_("Susan"): {"ico": "susan", "flag": susan_unlocked, "busy": susan_busy, "loc": sus_map_location}
}
$ summon_categories_sorted = [_("Snape"), _("Tonks"), _("Hermione"), _("Cho"), _("Luna"), _("Astoria"), _("Susan")] #"Ginny", "Daphne", "Padma", "Patil", "Myrtle", "Mafkin"
$ summon_categories_sorted_length = len(summon_categories_sorted)
$ current_sorting = summon_show_busy
label .after_init:
show screen summon(xx, yy)
$ _choice = ui.interact()
if _choice[0] == "summon":
hide screen summon
if not _choice[2]:
$ enable_game_menu()
$ renpy.jump_out_of_context("summon_"+_choice[1].lower())
else:
if game.daytime or _choice[1] in ["Tonks", "Snape"]:
call nar(">"+_choice[1]+" is currently busy. Try again later.")
else:
call nar(">"+_choice[1]+" is currently asleep. Try again tomorrow.")
else:
hide screen summon
return
jump .after_init
screen summon(xx, yy):
tag summon
zorder 15
modal True
add "gui_fade"
if renpy.mobile:
use close_button_background
use close_button(key=["summon", "game_menu"])
fixed:
if settings.get("animations"):
at gui_animation
use summon_menu(xx, yy)
screen summon_menu(xx, yy):
tag summon_menu
modal True
zorder 15
window:
style "empty"
pos (xx, yy)
xysize (207, 454)
use invisible_button()
add gui.format("interface/achievements/{}/panel_left.webp")
vbox:
pos (6, 384)
spacing 32
null
frame:
style "empty"
textbutton _("Show Busy:"):
style gui.theme("overlay_button")
xsize 195 ysize 32
text_align (0.4, 0.5)
text_size 12
action ToggleVariable("summon_show_busy", True, False)
add gui.theme("check_{}").format(str(summon_show_busy).lower()) xalign 0.7 ypos 4
vbox:
pos (6, 6)
$ tmp_x = 0
for char in summon_categories_sorted:
if summon_dict[char]["flag"]:
if summon_show_busy or not summon_dict[char]["busy"]:
$ tmp_x += 1
frame:
style "empty"
xsize 195
ysize 50
vbox:
textbutton char:
style "empty"
xsize 195 ysize 46
hover_background gui.format("interface/achievements/{}/highlight_left_b.webp")
text_xalign 0.6 text_yalign 0.5
text_xanchor 0.5
text_size 20
if not summon_dict[char]["busy"]:
action Return(["summon", char, False])
else:
text_color "#8C8C70"
action Return(["summon", char, True])
add gui.format("interface/achievements/{}/spacer_left.webp")
$ image_zoom = crop_image_zoom("interface/icons/head/"+summon_dict[char]["ico"]+".webp", 42, 42, summon_dict[char]["busy"])
button:
style gui.theme("overlay_button")
background gui.format("interface/achievements/{}/iconbox.webp")
foreground "interface/achievements/glass_iconbox.webp"
xysize (48, 48)
add image_zoom align (0.5, 0.5)
text map_transcript_loc[summon_dict[char]["loc"]] size 10 xalign 0.625 yalign 0.9 xanchor 0.5
if not snape_unlocked:
text _("You don't know anyone") size 12 at truecenter
else:
if tmp_x <= 0:
text _("All characters are busy") size 12 at truecenter