SnootGame/game/src/translation.rpy

129 lines
4.3 KiB
Plaintext
Raw Normal View History

2022-10-21 09:51:52 +00:00
init offset = -1
screen OkPrompt(message, go_menu):
2022-11-27 21:40:38 +00:00
2022-11-28 09:52:18 +00:00
modal True
2022-11-27 21:40:38 +00:00
2022-11-28 09:52:18 +00:00
zorder 200
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
style_prefix "confirm"
2022-11-28 09:52:18 +00:00
add "gui/overlay/confirm.png"
2022-11-28 09:52:18 +00:00
frame:
2022-11-28 09:52:18 +00:00
vbox:
xalign .5
yalign .5
spacing 30
2022-11-28 09:52:18 +00:00
label _(message):
style "confirm_prompt"
xalign 0.5
2022-11-28 09:52:18 +00:00
hbox:
xalign 0.5
spacing 100
2022-10-21 09:51:52 +00:00
textbutton _("OK") activate_sound "audio/ui/uiClick.wav" action If(go_menu, true=MainMenu(False,False), false=Hide())
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
default persistent.seenWarning = []
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
init python:
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
from math import ceil
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
notice = _("NOTICE: Please keep in mind this is a fan translation, and as such it may not be completely accurate to the original intent of any written lines.")
languages = [
{'image': 'gui/flag/USofA.png', 'name': 'English', 'value': None },
{'image': 'gui/flag/Mexico.png', 'name': 'Español', 'value': 'es'}
]
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
#This was done so it would work with whatever amount of languages you wanted, I tried it with up to 200 and it worked nicely.
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
maxItems = len(languages)
maxRows = ceil(maxItems/4)
if maxItems > 4:
maxItems = 4*maxRows
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
init:
transform renpysdumb: # Needed to scale down the imagebuttons.
zoom 0.5
transform icon: #For the preferences screen
truecenter
zoom 0.1
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
transform glowie(img):
img
easein_cubic 0.30 matrixcolor TintMatrix(Color((255, 255, 255)))
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
transform darkie(img):
img
easeout_cubic 0.30 matrixcolor TintMatrix(Color((255/2, 255/2, 255/2)))
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
screen lang_sel:
2022-10-21 09:51:52 +00:00
tag menu
frame:
2022-11-28 09:52:18 +00:00
background Transform(gui.main_menu_background, matrixcolor=TintMatrix('#222'))
2022-10-21 09:51:52 +00:00
padding (120, 40)
2022-11-28 09:52:18 +00:00
2022-10-21 09:51:52 +00:00
vbox:
style_prefix "navigation"
2022-11-28 09:52:18 +00:00
vbox:
label _("Choose Your Language") text_size 80
2022-11-28 09:52:18 +00:00
add Null(0, 40)
2022-10-21 09:51:52 +00:00
2022-11-28 09:52:18 +00:00
vpgrid:
if maxItems <= 4:
cols maxItems
rows 1
else:
cols 4
rows maxRows
2022-11-28 10:32:07 +00:00
#spacing 30
2022-11-28 09:52:18 +00:00
draggable True
mousewheel True
if maxRows > 3:
scrollbars "vertical"
for i in range(maxItems):
2022-11-28 10:32:07 +00:00
fixed:
xsize 400
ysize 300
2022-11-28 10:32:07 +00:00
vbox:
if i<len(languages):
text languages[i]["name"] at top
add Null(0,10)
imagebutton:
idle darkie(languages[i]["image"])
hover glowie(languages[i]["image"])
action If(languages[i]["value"] in persistent.seenWarning or languages[i]["value"] == None,
true = [Language(languages[i]["value"]), MainMenu(False,False)],
# Important to change the language before calling notice. Otherwise it will be in english.
false = [Language(languages[i]["value"]), AddToSet(set=persistent.seenWarning, value=languages[i]["value"]), Show(screen="OkPrompt", message=notice, go_menu=True)]
2022-11-28 10:32:07 +00:00
)
at renpysdumb # Scales the imagebutton down. No, you can't just specify the zoom here. It has to be a defined transform.
else:
# Renpy seethes if a vpgrid doesn't have the exact maximum amount of items for some reason.
add Null(0,0)
at truecenter
screen lang_button(lang):
2022-11-28 22:59:17 +00:00
hbox:
spacing 15
textbutton lang["name"]:
activate_sound "audio/ui/uiRollover.wav"
action If(lang["value"] in persistent.seenWarning or lang["value"] == None,
true = [Language(lang["value"])],
false = [Language(lang["value"]), AddToSet(set=persistent.seenWarning, value=lang["value"]), Show(screen="OkPrompt", message=notice, go_menu=False)]
)
if _preferences.language == lang["value"]:
add glowie(lang["image"]) at icon
else:
add darkie(lang["image"]) at icon