Переключение языка в главном меню
This commit is contained in:
BIN
game/images/main_interface/flags/None.png
Normal file
BIN
game/images/main_interface/flags/None.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
game/images/main_interface/flags/Russian.png
Normal file
BIN
game/images/main_interface/flags/Russian.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 B |
@ -529,6 +529,67 @@ screen main_menu():
|
||||
hover 'main_interface/down_buttons/sounds_off_1.png'
|
||||
action Preference("all mute", "toggle")
|
||||
|
||||
|
||||
default show_list_lang = False
|
||||
|
||||
default langs = {'None':'English'}
|
||||
|
||||
for lang in renpy.known_languages():
|
||||
if lang == 'russian':
|
||||
$ langs.update({'russian':'Русский'})
|
||||
|
||||
if len(langs) > 1:
|
||||
|
||||
viewport:
|
||||
xpos 540
|
||||
ypos 1042 - If(show_list_lang, true = (len(langs) - 0) * 58, false = 58)
|
||||
ymaximum If(show_list_lang, true = (len(langs) - 0) * 58, false = 58)
|
||||
xmaximum 216
|
||||
add '#0000'
|
||||
viewport:
|
||||
yalign 1.0
|
||||
yoffset -58
|
||||
add '#D6D7FF' alpha .7
|
||||
vbox:
|
||||
yalign 1.0
|
||||
yoffset -4
|
||||
xoffset 6
|
||||
spacing 2
|
||||
for key, lng in langs.items():
|
||||
if key != str(_preferences.language):
|
||||
viewport:
|
||||
xsize 205
|
||||
ysize 53
|
||||
add '#0000'
|
||||
hbox:
|
||||
yalign .5
|
||||
xalign 0
|
||||
spacing 8
|
||||
add Transform('images/main_interface/flags/'+ key.title() + '.png', zoom = 1.4) yalign .5 xoffset 2
|
||||
add Text(lng, color = '#33264F', size = 18, font = 'fonts/h_font.ttf') yalign .5
|
||||
imagebutton:
|
||||
xmaximum 216
|
||||
idle '#0000'
|
||||
hover '#0002'
|
||||
action ToggleScreenVariable('show_list_lang',True,False), If(key == 'None', true = Language(None), false = Language(key))
|
||||
viewport:
|
||||
yalign 1.0
|
||||
add Transform('main_interface/' + If(show_list_lang, true = 'list_up.png', false = 'list_down.png'), zoom = 1.4) yalign 1.0
|
||||
hbox:
|
||||
yalign 1.0
|
||||
yoffset -6
|
||||
xoffset 8
|
||||
spacing 8
|
||||
add Transform('images/main_interface/flags/'+ str(If(_preferences.language is None, true = 'english', false = _preferences.language)).title() + '.png', zoom = 1.4) yalign .5
|
||||
add Text(langs[str(_preferences.language)], color = '#33264F', size = 18, font = 'fonts/h_font.ttf') yalign .5
|
||||
imagebutton:
|
||||
xsize 216
|
||||
ysize 56
|
||||
yalign 1.0
|
||||
idle '#0000'
|
||||
hover '#0002'
|
||||
action ToggleScreenVariable('show_list_lang',True,False)
|
||||
|
||||
style main_menu_frame is empty
|
||||
style main_menu_vbox is vbox
|
||||
style main_menu_text is gui_text
|
||||
|
||||
Reference in New Issue
Block a user