SnootGame/game/src/translation.rpy

113 lines
3.5 KiB
Plaintext

init offset = -1
screen OkPrompt(message, ok_action):
modal True
zorder 200
style_prefix "confirm"
add "gui/overlay/confirm.png"
frame:
vbox:
xalign .5
yalign .5
spacing 30
label _(message):
style "confirm_prompt"
xalign 0.5
hbox:
xalign 0.5
spacing 100
textbutton _("OK") activate_sound "audio/ui/uiClick.wav" action Hide()
default persistent.seenWarning = []
init python:
from math import ceil
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'}
]
#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.
maxItems = len(languages)
maxRows = ceil(maxItems/4)
if maxItems > 4:
maxItems = 4*maxRows
init:
transform renpysdumb: # Needed to scale down the imagebuttons.
zoom 0.5
transform icon: #For the preferences screen
truecenter
zoom 0.1
transform glowie(img):
img
easeout_cubic 0.30 matrixcolor TintMatrix(Color((255, 255, 255)))
transform darkie(img):
img
easeout_cubic 0.30 matrixcolor TintMatrix(Color((255/2, 255/2, 255/2)))
screen lang_sel:
tag menu
frame:
background Transform(gui.main_menu_background, matrixcolor=TintMatrix('#222'))
padding (120, 40)
vbox:
style_prefix "navigation"
vbox:
label _("Choose Your Language") text_size 80
add Null(0, 40)
vpgrid:
if maxItems <= 4:
cols maxItems
rows 1
else:
cols 4
rows maxRows
#spacing 30
draggable True
mousewheel True
if maxRows > 3:
scrollbars "vertical"
for i in range(maxItems):
fixed:
xsize 400
ysize 250
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)],
false = [Show(screen="OkPrompt", message=notice, ok_action=Hide()), AddToSet(set=persistent.seenWarning, value=languages[i]["value"])]
)
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)