Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 38.28 KB | None | 0 0
  1. ################################################################################
  2. ## Инициализация
  3. ################################################################################
  4.  
  5. init offset = -1
  6.  
  7.  
  8. ################################################################################
  9. ## Стили
  10. ################################################################################
  11.  
  12. style default:
  13.     properties gui.text_properties()
  14.     language gui.language
  15.  
  16. style input:
  17.     properties gui.text_properties("input", accent=True)
  18.     adjust_spacing False
  19.  
  20. style hyperlink_text:
  21.     properties gui.text_properties("hyperlink", accent=True)
  22.     hover_underline True
  23.  
  24. style gui_text:
  25.     properties gui.text_properties("interface")
  26.  
  27.  
  28. style button:
  29.     properties gui.button_properties("button")
  30.  
  31. style button_text is gui_text:
  32.     properties gui.text_properties("button")
  33.     yalign 0.5
  34.  
  35.  
  36. style label_text is gui_text:
  37.     properties gui.text_properties("label", accent=True)
  38.  
  39. style prompt_text is gui_text:
  40.     properties gui.text_properties("prompt")
  41.  
  42.  
  43. style bar:
  44.     ysize gui.bar_size
  45.     left_bar Frame("gui/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
  46.     right_bar Frame("gui/bar/right.png", gui.bar_borders, tile=gui.bar_tile)
  47.  
  48. style vbar:
  49.     xsize gui.bar_size
  50.     top_bar Frame("gui/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
  51.     bottom_bar Frame("gui/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)
  52.  
  53. style scrollbar:
  54.     ysize gui.scrollbar_size
  55.     base_bar Frame("gui/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
  56.     thumb Frame("gui/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
  57.  
  58. style vscrollbar:
  59.     xsize gui.scrollbar_size
  60.     base_bar Frame("gui/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
  61.     thumb Frame("gui/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
  62.  
  63. style slider:
  64.     ysize gui.slider_size
  65.     base_bar Frame("gui/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
  66.     thumb "gui/slider/horizontal_[prefix_]thumb.png"
  67.  
  68. style vslider:
  69.     xsize gui.slider_size
  70.     base_bar Frame("gui/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
  71.     thumb "gui/slider/vertical_[prefix_]thumb.png"
  72.  
  73.  
  74. style frame:
  75.     padding gui.frame_borders.padding
  76.     background Frame("gui/aboutbg.png", gui.frame_borders, tile=gui.frame_tile)
  77.  
  78.  
  79.  
  80. ################################################################################
  81. ## Внутриигровые экраны
  82. ################################################################################
  83.  
  84.  
  85. ## Экран разговора #############################################################
  86. ##
  87. ## Экран разговора используется для показа диалога игроку. Он использует два
  88. ## параметра — who и what — что, соответственно, имя говорящего персонажа и
  89. ## показываемый текст. (Параметр who может быть None, если имя не задано.)
  90. ##
  91. ## Этот экран должен создать текст с id "what", чтобы Ren'Py могла показать
  92. ## текст. Здесь также можно создать наложения с id "who" и id "window", чтобы
  93. ## применить к ним настройки стиля.
  94. ##
  95. ## https://www.renpy.org/doc/html/screen_special.html#say
  96.  
  97. screen say(who, what):
  98.     style_prefix "say"
  99.  
  100.     window:
  101.         id "window"
  102.  
  103.         if who is not None:
  104.  
  105.             window:
  106.                 id "namebox"
  107.                 style "namebox"
  108.                 text who id "who"
  109.  
  110.         text what id "what"
  111.  
  112.  
  113.     ## Если есть боковое изображение ("голова"), показывает её поверх текста.
  114.     ## По стандарту не показывается на варианте для мобильных устройств — мало
  115.     ## места.
  116.     if not renpy.variant("small"):
  117.         add SideImage() xalign 0.0 yalign 1.0
  118.  
  119.  
  120. ## Делает namebox доступным для стилизации через объект Character.
  121. init python:
  122.     config.character_id_prefixes.append('namebox')
  123.  
  124. style window is default
  125. style say_label is default
  126. style say_dialogue is default
  127. style say_thought is say_dialogue
  128.  
  129. style namebox is default
  130. style namebox_label is say_label
  131.  
  132.  
  133. style window:
  134.     xalign 0.5
  135.     xfill True
  136.     yalign gui.textbox_yalign
  137.     ysize gui.textbox_height
  138.  
  139.     background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
  140.  
  141. style namebox:
  142.     xpos gui.name_xpos
  143.     xanchor gui.name_xalign
  144.     xsize gui.namebox_width
  145.     ypos gui.name_ypos
  146.     ysize gui.namebox_height
  147.  
  148.     background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
  149.     padding gui.namebox_borders.padding
  150.  
  151. style say_label:
  152.     properties gui.text_properties("name", accent=True)
  153.     xalign gui.name_xalign
  154.     yalign 0.5
  155.  
  156. style say_dialogue:
  157.     properties gui.text_properties("dialogue")
  158.  
  159.     xpos gui.dialogue_xpos
  160.     xsize gui.dialogue_width
  161.     ypos gui.dialogue_ypos
  162. ####################Интро##################################
  163. #image splash = "splash.png"
  164.  
  165. #label splashscreen:
  166. #    scene black
  167. #   with Pause(1)
  168.    
  169. #    play sound "ping.ogg"
  170.  
  171. #    show splash with dissolve
  172. #    with Pause(2)
  173.    
  174. #    scene black with dissolve
  175. #    with Pause(1)
  176.  
  177. #    return
  178.  
  179. ## Экран ввода #################################################################
  180. ##
  181. ## Этот экран используется, чтобы показывать renpy.input. Это параметр запроса,
  182. ## используемый для того, чтобы дать игроку ввести в него текст.
  183. ##
  184. ## Этот экран должен создать наложение ввода с id "input", чтобы принять
  185. ## различные вводимые параметры.
  186. ##
  187. ## https://www.renpy.org/doc/html/screen_special.html#input
  188.  
  189. screen input(prompt):
  190.     style_prefix "input"
  191.  
  192.     window:
  193.  
  194.         vbox:
  195.             xalign gui.dialogue_text_xalign
  196.             xpos gui.dialogue_xpos
  197.             xsize gui.dialogue_width
  198.             ypos gui.dialogue_ypos
  199.  
  200.             text prompt style "input_prompt"
  201.             input id "input"
  202.  
  203. style input_prompt is default
  204.  
  205. style input_prompt:
  206.     xalign gui.dialogue_text_xalign
  207.     properties gui.text_properties("input_prompt")
  208.  
  209. style input:
  210.     xalign gui.dialogue_text_xalign
  211.     xmaximum gui.dialogue_width
  212.  
  213.  
  214. ## Экран выбора ################################################################
  215. ##
  216. ## Этот экран используется, чтобы показывать внутриигровые выборы,
  217. ## представленные оператором menu. Один параметр, вложения, список объектов,
  218. ## каждый с заголовком и полями действия.
  219. ##
  220. ## https://www.renpy.org/doc/html/screen_special.html#choice
  221.  
  222. screen choice(items):
  223.     style_prefix "choice"
  224.  
  225.     vbox:
  226.         for i in items:
  227.             textbutton i.caption action i.action
  228.  
  229.  
  230. ## Когда этот параметр True, заголовки меню будут проговариваться рассказчиком.
  231. ## Когда False, заголовки меню будут показаны как пустые кнопки.
  232. define config.narrator_menu = True
  233.  
  234.  
  235. style choice_vbox is vbox
  236. style choice_button is button
  237. style choice_button_text is button_text
  238.  
  239. style choice_vbox:
  240.     xalign 0.5
  241.     ypos 405
  242.     yanchor 0.5
  243.  
  244.     spacing gui.choice_spacing
  245.  
  246. style choice_button is default:
  247.     properties gui.button_properties("choice_button")
  248.  
  249. style choice_button_text is default:
  250.     properties gui.button_text_properties("choice_button")
  251.  
  252.  
  253. ## Экран быстрого меню #########################################################
  254. ##
  255. ## Быстрое меню показывается внутри игры, чтобы обеспечить лёгкий доступ к
  256. ## внеигровым меню.
  257.  
  258. screen quick_menu:
  259.     tag menu
  260.    
  261.     vbox:
  262.         pos (1760, 950)
  263.         textbutton _("Назад") action Rollback()
  264.         imagebutton auto "gui/pause/pause_arrow_%s.png" action ShowMenu("pause_menu")
  265. ## Данный код гарантирует, что экран быстрого меню будет показан в игре в любое
  266. ## время, если только игрок не скроет интерфейс.
  267. init python:
  268.     config.overlay_screens.append("quick_menu")
  269.  
  270. default quick_menu = True
  271.  
  272. style quick_button is default
  273. style quick_button_text is button_text
  274.  
  275. style quick_button:
  276.     properties gui.button_properties("quick_button")
  277.  
  278. style quick_button_text:
  279.     properties gui.button_text_properties("quick_button")
  280.  
  281.  
  282. ################################################################################
  283. ## Экраны Главного и Игрового меню
  284. ################################################################################
  285.  
  286. ## Экран навигации #############################################################
  287. ##
  288. ## Этот экран включает в себя главное и игровое меню, и обеспечивает навигацию к
  289. ## другим меню и к началу игры.
  290.  
  291. screen navigation():
  292.  
  293.     vbox:
  294.         style_prefix "navigation"
  295.  
  296.         xpos gui.navigation_xpos
  297.         yalign 0.5
  298.  
  299.         spacing gui.navigation_spacing
  300.  
  301.             textbutton _("История") action ShowMenu("history")
  302.  
  303.             textbutton _("Сохранить") action ShowMenu("save")
  304.  
  305.         textbutton _("Загрузить") action ShowMenu("load")
  306.  
  307.         textbutton _("Настройки") action ShowMenu("preferences")
  308.  
  309.         if _in_replay:
  310.  
  311.             textbutton _("Завершить повтор") action EndReplay(confirm=True)
  312.  
  313.         elif not main_menu:
  314.  
  315.             textbutton _("Главное меню") action MainMenu()
  316.  
  317.         textbutton _("Об игре") action ShowMenu("about")
  318.  
  319.         if renpy.variant("pc"):
  320.  
  321.             ## Помощь не необходима и не относится к мобильным устройствам.
  322.             textbutton _("Помощь") action ShowMenu("help")
  323.  
  324.  
  325. style navigation_button is gui_button
  326. style navigation_button_text is gui_button_text
  327.  
  328. style navigation_button:
  329.     size_group "navigation"
  330.     properties gui.button_properties("navigation_button")
  331.  
  332. style navigation_button_text:
  333.     properties gui.button_text_properties("navigation_button")
  334.  
  335. ## Экран главного меню #########################################################
  336. ##
  337. ## Используется, чтобы показать главное меню после запуска игры.
  338. ##
  339. screen main_menu:
  340. # This ensures that any other menu screen is replaced.
  341.     tag menu
  342.     imagemap:
  343.             ground "gui/main_menu.png"  
  344.             hover "gui/hover_menu.png"
  345.             alpha True
  346.             hotspot (714, 432, 484, 93) action Start()
  347.             hotspot (713, 530, 493, 56) action ShowMenu("load")
  348.             hotspot (712, 672, 507, 68) action ShowMenu("about")
  349.             hotspot (713, 591, 501, 77) action ShowMenu("preferences")
  350.             hotspot (712, 744, 515, 70) action Help()
  351.             hotspot (715, 818, 497, 82) action Quit(confirm=True)
  352. ################################################################################
  353. screen pause_menu:
  354.     tag menu
  355.     imagemap:
  356.             ground "gui/pause/pause_ground.png"
  357.             hover "gui/pause/pause_ground.png"
  358.             alpha True
  359.             hotspot (1, 1, 1, 1) action ShowMenu('history')
  360.             hotspot (1, 1, 1, 1) action Skip() alternate Skip(fast=True, confirm=True)
  361.             hotspot (1, 1, 1, 1) action Preference("auto-forward", "toggle")
  362.             hotspot (1, 1, 1, 1) action ShowMenu('save')
  363.             hotspot (1, 1, 1, 1) action ShowMenu('preferences')
  364.             hotspot (1, 1, 1, 1) action MainMenu()
  365.             hotspot (1, 1, 1, 1) action HideInterface()
  366. ## Экран игрового меню #########################################################
  367. ##
  368. ## Всё это показывает основную, обобщённую структуру экрана игрового меню. Он
  369. ## вызывается с экраном заголовка и показывает фон, заголовок и навигацию.
  370. ##
  371. ## Параметр scroll может быть None, или "viewport", или "vpgrid", когда этот
  372. ## экран предназначается для использования с более чем одним дочерним экраном,
  373. ## включённым в него.
  374.  
  375. screen game_menu(title, scroll=None, yinitial=0.0):
  376.  
  377.     style_prefix "game_menu"
  378.  
  379.     if main_menu:
  380.         add gui.main_menu_background
  381.     else:
  382.         add gui.game_menu_background
  383.  
  384.     frame:
  385.         style "game_menu_outer_frame"
  386.  
  387.         hbox:
  388.  
  389.             ## Резервирует пространство для навигации.
  390.             frame:
  391.                 style "game_menu_navigation_frame"
  392.  
  393.             frame:
  394.                 style "game_menu_content_frame"
  395.  
  396.                 if scroll == "viewport":
  397.  
  398.                     viewport:
  399.                         yinitial yinitial
  400.                         scrollbars "vertical"
  401.                         mousewheel True
  402.                         draggable True
  403.                         pagekeys True
  404.  
  405.                         side_yfill True
  406.  
  407.                         vbox:
  408.                             transclude
  409.  
  410.                 elif scroll == "vpgrid":
  411.  
  412.                     vpgrid:
  413.                         cols 1
  414.                         yinitial yinitial
  415.  
  416.                         scrollbars "vertical"
  417.                         mousewheel True
  418.                         draggable True
  419.                         pagekeys True
  420.  
  421.                         side_yfill True
  422.  
  423.                         transclude
  424.  
  425.                 else:
  426.  
  427.                     transclude
  428.  
  429.     use navigation
  430.  
  431.     textbutton _("Вернуться"):
  432.         style "return_button"
  433.  
  434.         action Return()
  435.  
  436.     label title
  437.  
  438.     if main_menu:
  439.         key "game_menu" action ShowMenu("main_menu")
  440.  
  441.  
  442. style game_menu_outer_frame is empty
  443. style game_menu_navigation_frame is empty
  444. style game_menu_content_frame is empty
  445. style game_menu_viewport is gui_viewport
  446. style game_menu_side is gui_side
  447. style game_menu_scrollbar is gui_vscrollbar
  448.  
  449. style game_menu_label is gui_label
  450. style game_menu_label_text is gui_label_text
  451.  
  452. style return_button is navigation_button
  453. style return_button_text is navigation_button_text
  454.  
  455. style game_menu_outer_frame:
  456.     bottom_padding 45
  457.     top_padding 180
  458.  
  459.     background "gui/overlay/game_menu.png"
  460.  
  461. style game_menu_navigation_frame:
  462.     xsize 420
  463.     yfill True
  464.  
  465. style game_menu_content_frame:
  466.     left_margin 60
  467.     right_margin 30
  468.     top_margin 15
  469.  
  470. style game_menu_viewport:
  471.     xsize 1380
  472.  
  473. style game_menu_vscrollbar:
  474.     unscrollable gui.unscrollable
  475.  
  476. style game_menu_side:
  477.     spacing 15
  478.  
  479. style game_menu_label:
  480.     xpos 75
  481.     ysize 180
  482.  
  483. style game_menu_label_text:
  484.     size gui.title_text_size
  485.     color gui.accent_color
  486.     yalign 0.5
  487.  
  488. style return_button:
  489.     xpos gui.navigation_xpos
  490.     yalign 1.0
  491.     yoffset -45
  492.  
  493.  
  494. ## Экран Об игре ###############################################################
  495. ##
  496. ## Этот экран показывает авторскую информацию об игре и Ren'Py.
  497. ##
  498. ## В этом экране нет ничего особенного, и он служит только примером того, каким
  499. ## можно сделать свой экран.
  500.  
  501. screen about():
  502. # This ensures that any other menu screen is replaced.
  503.     tag menu
  504.     imagemap:
  505.             ground "gui/aboutbg.png"  
  506.             hover "gui/about_hover.png"
  507.             alpha True
  508.             hotspot (72, 956, 247, 93) action Return()
  509.             text _("{size=+12}{p}{p}{p}{p}{p}                           Senior Lead Developer:  {a=http://vk.com/olegvalge} OlegValge{/a} {p}{p}                           This Terrible Design: {a=http://vk.com/maslenok_1337} Maslenok{/a} {p}{p}                           Plot Author: Sielin{/size}")
  510.  
  511. ## Save, Load
  512. ## Screens that allow the user to save and load the game.
  513.  
  514. ##Save screen starts here
  515. screen load_save_slot:
  516.     #shows information in the save slot about the saved game file
  517.  
  518.     #shows a screenshot of the saved game in the save slot
  519.     add FileScreenshot(1) xpos 125 ypos 200
  520.     add FileScreenshot(2) xpos 750 ypos 200
  521.     add FileScreenshot(3) xpos 1400 ypos 200
  522.     add FileScreenshot(4) xpos 100 ypos 600
  523.     add FileScreenshot(5) xpos 750 ypos 600
  524.     add FileScreenshot(6) xpos 1400 ypos 600
  525.    
  526. ####key "save_delete" action FileDelete(number)####### не работает#########################
  527.    
  528. screen file_picker:
  529.  
  530.     imagebutton:
  531.         idle "gui/SaveLoad/slot_idle.png"
  532.         hover "gui/SaveLoad/slot_hover.png"
  533.         xpos 100
  534.         ypos 200
  535.         action FileAction(1)
  536.     use load_save_slot(number=1)
  537.    
  538.     imagebutton:
  539.         idle "gui/SaveLoad/slot_idle.png"
  540.         hover "gui/SaveLoad/slot_hover.png"
  541.         xpos 750
  542.         ypos 200
  543.         action FileAction(2)
  544.     use load_save_slot(number=2)
  545.    
  546.     imagebutton:
  547.         idle "gui/SaveLoad/slot_idle.png"
  548.         hover "gui/SaveLoad/slot_hover.png"
  549.         xpos 1400
  550.         ypos 200
  551.         action FileAction(3)
  552.     use load_save_slot(number=3)
  553.    
  554.     imagebutton:
  555.         idle "gui/SaveLoad/slot_idle.png"
  556.         hover "gui/SaveLoad/slot_hover.png"
  557.         xpos 100
  558.         ypos 600
  559.         action FileAction(4)
  560.     use load_save_slot(number=4)
  561.    
  562.     imagebutton:
  563.         idle "gui/SaveLoad/slot_idle.png"
  564.         hover "gui/SaveLoad/slot_hover.png"
  565.         xpos 750
  566.         ypos 600
  567.         action FileAction(5)
  568.     use load_save_slot(number=5)
  569.  
  570.     imagebutton:
  571.         idle "gui/SaveLoad/slot_idle.png"
  572.         hover "gui/SaveLoad/slot_hover.png"
  573.         xpos 1400
  574.         ypos 600
  575.         action FileAction(6)
  576.     use load_save_slot(number=6)
  577.    
  578.  
  579.  
  580. ##############  SAVE SCREEN
  581. screen save:
  582.     tag menu
  583.    
  584.     add "gui/aboutbg.png"
  585.     use file_picker
  586.  
  587.     imagebutton:
  588.         idle "gui/SaveLoad/close_idle.png"
  589.         hover "gui/SaveLoad/close_hover.png"
  590.         xpos 100
  591.         ypos 980
  592.         action Return()
  593.  
  594.     imagebutton:
  595.         idle "gui/SaveLoad/arrow_left_idle.png"
  596.         hover "gui/SaveLoad/arrow_left_hover.png"
  597.         xpos 500
  598.         ypos 950
  599.         action FilePagePrevious()
  600.        
  601.     imagebutton:
  602.         idle "gui/SaveLoad/arrow_right_idle.png"
  603.         hover "gui/SaveLoad/arrow_right_hover.png"
  604.         xpos 1370
  605.         ypos 950
  606.         action FilePageNext(max=9)
  607.    
  608.     imagebutton:
  609.         idle "gui/SaveLoad/1_idle.png"
  610.         hover "gui/SaveLoad/1_hover.png"
  611.         selected_idle "gui/SaveLoad/1_hover.png"
  612.         xpos 630
  613.         ypos 960
  614.         clicked FilePage(1)
  615.  
  616.     imagebutton:
  617.         idle "gui/SaveLoad/2_idle.png"
  618.         hover "gui/SaveLoad/2_hover.png"
  619.         selected_idle "gui/SaveLoad/2_hover.png"
  620.         xpos 680
  621.         ypos 960
  622.         clicked FilePage(2)
  623.  
  624.     imagebutton:
  625.         idle "gui/SaveLoad/3_idle.png"
  626.         hover "gui/SaveLoad/3_hover.png"
  627.         selected_idle "gui/SaveLoad/3_hover.png"
  628.         xpos 760
  629.         ypos 960
  630.         clicked FilePage(3)
  631.  
  632.     imagebutton:
  633.         idle "gui/SaveLoad/4_idle.png"
  634.         hover "gui/SaveLoad/4_hover.png"
  635.         selected_idle "gui/SaveLoad/4_hover.png"
  636.         xpos 840
  637.         ypos 960
  638.         clicked FilePage(4)
  639.  
  640.     imagebutton:
  641.         idle "gui/SaveLoad/5_idle.png"
  642.         hover "gui/SaveLoad/5_hover.png"
  643.         selected_idle "gui/SaveLoad/5_hover.png"
  644.         xpos 920
  645.         ypos 960
  646.         clicked FilePage(5)
  647.  
  648.     imagebutton:
  649.         idle "gui/SaveLoad/6_idle.png"
  650.         hover "gui/SaveLoad/6_hover.png"
  651.         selected_idle "gui/SaveLoad/6_hover.png"
  652.         xpos 1000
  653.         ypos 960
  654.         clicked FilePage(6)
  655.  
  656.     imagebutton:
  657.         idle "gui/SaveLoad/7_idle.png"
  658.         hover "gui/SaveLoad/7_hover.png"
  659.         selected_idle "gui/SaveLoad/8_hover.png"
  660.         xpos 1080
  661.         ypos 960
  662.         clicked FilePage(7)
  663.  
  664.     imagebutton:
  665.         idle "gui/SaveLoad/8_idle.png"
  666.         hover "gui/SaveLoad/8_hover.png"
  667.         selected_idle "gui/SaveLoad/8_hover.png"
  668.         xpos 1160
  669.         ypos 960
  670.         clicked FilePage(8)
  671.  
  672.     imagebutton:
  673.         idle "gui/SaveLoad/9_idle.png"
  674.         hover "gui/SaveLoad/9_hover.png"
  675.         selected_idle "gui/SaveLoad/9_hover.png"
  676.         xpos 1240
  677.         ypos 960
  678.         clicked FilePage(9)
  679.        
  680. #############   LOAD SCREEN
  681. screen load:
  682.     tag menu
  683.  
  684.     add "gui/aboutbg.png"
  685.     use file_picker
  686.    
  687.     imagebutton:
  688.         idle "gui/SaveLoad/close_idle.png"
  689.         hover "gui/SaveLoad/close_hover.png"
  690.         xpos 100
  691.         ypos 980
  692.         action Return()
  693.  
  694.     imagebutton:
  695.         idle "gui/SaveLoad/arrow_left_idle.png"
  696.         hover "gui/SaveLoad/arrow_left_hover.png"
  697.         xpos 500
  698.         ypos 950
  699.         action FilePagePrevious()
  700.        
  701.     imagebutton:
  702.         idle "gui/SaveLoad/arrow_right_idle.png"
  703.         hover "gui/SaveLoad/arrow_right_hover.png"
  704.         xpos 1370
  705.         ypos 950
  706.         action FilePageNext(max=9)
  707.    
  708.     imagebutton:
  709.         idle "gui/SaveLoad/1_idle.png"
  710.         hover "gui/SaveLoad/1_hover.png"
  711.         selected_idle "gui/SaveLoad/1_hover.png"
  712.         xpos 630
  713.         ypos 960
  714.         clicked FilePage(1)
  715.  
  716.     imagebutton:
  717.         idle "gui/SaveLoad/2_idle.png"
  718.         hover "gui/SaveLoad/2_hover.png"
  719.         selected_idle "gui/SaveLoad/2_hover.png"
  720.         xpos 680
  721.         ypos 960
  722.         clicked FilePage(2)
  723.  
  724.     imagebutton:
  725.         idle "gui/SaveLoad/3_idle.png"
  726.         hover "gui/SaveLoad/3_hover.png"
  727.         selected_idle "gui/SaveLoad/3_hover.png"
  728.         xpos 760
  729.         ypos 960
  730.         clicked FilePage(3)
  731.  
  732.     imagebutton:
  733.         idle "gui/SaveLoad/4_idle.png"
  734.         hover "gui/SaveLoad/4_hover.png"
  735.         selected_idle "gui/SaveLoad/4_hover.png"
  736.         xpos 840
  737.         ypos 960
  738.         clicked FilePage(4)
  739.  
  740.     imagebutton:
  741.         idle "gui/SaveLoad/5_idle.png"
  742.         hover "gui/SaveLoad/5_hover.png"
  743.         selected_idle "gui/SaveLoad/5_hover.png"
  744.         xpos 920
  745.         ypos 960
  746.         clicked FilePage(5)
  747.  
  748.     imagebutton:
  749.         idle "gui/SaveLoad/6_idle.png"
  750.         hover "gui/SaveLoad/6_hover.png"
  751.         selected_idle "gui/SaveLoad/6_hover.png"
  752.         xpos 1000
  753.         ypos 960
  754.         clicked FilePage(6)
  755.  
  756.     imagebutton:
  757.         idle "gui/SaveLoad/7_idle.png"
  758.         hover "gui/SaveLoad/7_hover.png"
  759.         selected_idle "gui/SaveLoad/8_hover.png"
  760.         xpos 1080
  761.         ypos 960
  762.         clicked FilePage(7)
  763.  
  764.     imagebutton:
  765.         idle "gui/SaveLoad/8_idle.png"
  766.         hover "gui/SaveLoad/8_hover.png"
  767.         selected_idle "gui/SaveLoad/8_hover.png"
  768.         xpos 1160
  769.         ypos 960
  770.         clicked FilePage(8)
  771.  
  772.     imagebutton:
  773.         idle "gui/SaveLoad/9_idle.png"
  774.         hover "gui/SaveLoad/9_hover.png"
  775.         selected_idle "gui/SaveLoad/9_hover.png"
  776.         xpos 1240
  777.         ypos 960
  778.         clicked FilePage(9)
  779. ## Экран настроек ##############################################################
  780. ##
  781. ## Экран настроек позволяет игроку настраивать игру под себя.
  782. ##
  783. ## https://www.renpy.org/doc/html/screen_special.html#preferences
  784.  
  785. screen preferences():
  786.  
  787.     tag menu
  788.  
  789.     imagemap:  
  790.         ground "gui/prefbg.png"
  791.         idle "gui/prefbutton_idle.png"
  792.         hover "gui/prefbg_hover.png"
  793.         selected_idle "gui/prefbutton_selected.png"
  794.         selected_hover "gui/prefbutton_selected.png"
  795.         alpha False
  796.        
  797.         hotspot (178, 381, 488, 104) action Preference("display", "fullscreen")
  798.         hotspot (178, 278, 488, 104) action Preference("display", "window")
  799.         hotspot (178, 617, 488, 185) action Preference("skip", "seen")
  800.         hotspot (178, 801, 488, 164) action Preference("skip", "all")
  801.         hotspot (72, 956, 247, 93) action Return()
  802. ########################        hotspot (1, 1, 1, 1) action Preference("mute")
  803.        
  804.         bar pos (1100, 860) value Preference("text speed") style "pref_slider"
  805.         text str(int(_preferences.text_cps / 200.00*100))+"%" align (0.96, 0.84) size (55)
  806.         bar pos (1100, 500) value Preference("sound volume") style "pref_slider"
  807.         text str(int(_preferences.volumes["sfx"]*100))+"%"  align (0.96, 0.48) size (55)
  808.         bar pos (1100, 300) value Preference("music volume") style "pref_slider"
  809.         text str(int(_preferences.volumes["music"]*100))+"%"  align (0.96, 0.29) size (55)
  810.         bar pos (1100, 680) value Preference("auto-forward time") style "pref_slider"
  811.         text str(int(_preferences.afm_time / 30.00*100))+"%" align (0.96, 0.66) size (55)
  812.  
  813. init -2 python:
  814.     style.pref_slider.left_bar = "gui/prefbar_full.png"
  815.     style.pref_slider.right_bar = "gui/prefbar_empty.png"
  816.  
  817.     style.pref_slider.xmaximum = 621
  818.     style.pref_slider.ymaximum = 44
  819.     style.pref_slider.thumb = "gui/prefthumb.png"
  820.     style.pref_slider.thumb_offset = 4
  821.     style.pref_slider.thumb_shadow = None
  822.  
  823.  
  824. ## Экран истории ###############################################################
  825. ##
  826. ## Этот экран показывает игроку историю диалогов. Хотя в этом экране нет ничего
  827. ## особенного, он имеет доступ к истории диалогов, хранимом в _history_list.
  828. ##
  829. ## https://www.renpy.org/doc/html/history.html
  830.  
  831. screen history():
  832.  
  833.     tag menu
  834.  
  835.     ## Избегайте предсказывания этого экрана, так как он может быть очень
  836.     ## массивным.
  837.     predict False
  838.  
  839.     use game_menu(_("История"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
  840.  
  841.         style_prefix "history"
  842.  
  843.         for h in _history_list:
  844.  
  845.             window:
  846.  
  847.                 ## Это всё правильно уравняет, если history_height будет
  848.                 ## установлен на None.
  849.                 has fixed:
  850.                     yfit True
  851.  
  852.                 if h.who:
  853.  
  854.                     label h.who:
  855.                         style "history_name"
  856.                         substitute False
  857.  
  858.                         ## Берёт цвет из who параметра персонажа, если он
  859.                         ## установлен.
  860.                         if "color" in h.who_args:
  861.                             text_color h.who_args["color"]
  862.  
  863.                 $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
  864.                 text what:
  865.                     substitute False
  866.  
  867.         if not _history_list:
  868.             label _("История диалогов пуста.")
  869.  
  870.  
  871. ## Это определяет, какие теги могут отображаться на экране истории.
  872.  
  873. define gui.history_allow_tags = set()
  874.  
  875.  
  876. style history_window is empty
  877.  
  878. style history_name is gui_label
  879. style history_name_text is gui_label_text
  880. style history_text is gui_text
  881.  
  882. style history_text is gui_text
  883.  
  884. style history_label is gui_label
  885. style history_label_text is gui_label_text
  886.  
  887. style history_window:
  888.     xfill True
  889.     ysize gui.history_height
  890.  
  891. style history_name:
  892.     xpos gui.history_name_xpos
  893.     xanchor gui.history_name_xalign
  894.     ypos gui.history_name_ypos
  895.     xsize gui.history_name_width
  896.  
  897. style history_name_text:
  898.     min_width gui.history_name_width
  899.     text_align gui.history_name_xalign
  900.  
  901. style history_text:
  902.     xpos gui.history_text_xpos
  903.     ypos gui.history_text_ypos
  904.     xanchor gui.history_text_xalign
  905.     xsize gui.history_text_width
  906.     min_width gui.history_text_width
  907.     text_align gui.history_text_xalign
  908.     layout ("subtitle" if gui.history_text_xalign else "tex")
  909.  
  910. style history_label:
  911.     xfill True
  912.  
  913. style history_label_text:
  914.     xalign 0.5
  915.  
  916.  
  917. ## Экран помощи ################################################################
  918. ##
  919. ## Экран, дающий информацию о клавишах управления. Он использует другие экраны
  920. ## (keyboard_help, mouse_help, и gamepad_help), чтобы показывать актуальную
  921. ## помощь.
  922.  
  923. screen help():
  924. # This ensures that any other menu screen is replaced.
  925.     tag menu
  926.     imagemap:
  927.             ground "gui/helpbg.png"  
  928.             hover "gui/about_hover.png"
  929.             alpha True
  930.             hotspot (72, 956, 247, 93) action Return()
  931. ################################################################################
  932. ## Дополнительные экраны
  933. ################################################################################
  934.  
  935.  
  936. ## Экран подтверждения #########################################################
  937. ##
  938. ## Экран подтверждения вызывается, когда Ren'Py хочет спросить у игрока вопрос
  939. ## Да или Нет.
  940. ##
  941. ## https://www.renpy.org/doc/html/screen_special.html#confirm
  942.  
  943.  
  944. ## Экран уведомлений ###########################################################
  945. ##
  946. ## Экран уведомлений используется, чтобы показать игроку оповещение. (Например,
  947. ## когда игра автосохранилась, или был сделан скриншот)
  948. ##
  949. ## https://www.renpy.org/doc/html/screen_special.html#notify-screen
  950.  
  951. screen notify(message):
  952.  
  953.     zorder 100
  954.     style_prefix "notify"
  955.  
  956.     frame at notify_appear:
  957.         text "[message!tq]"
  958.  
  959.     timer 3.25 action Hide('notify')
  960.  
  961.  
  962. transform notify_appear:
  963.     on show:
  964.         alpha 0
  965.         linear .25 alpha 1.0
  966.     on hide:
  967.         linear .5 alpha 0.0
  968.  
  969.  
  970. style notify_frame is empty
  971. style notify_text is gui_text
  972.  
  973. style notify_frame:
  974.     ypos gui.notify_ypos
  975.  
  976.     background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)
  977.     padding gui.notify_frame_borders.padding
  978.  
  979. style notify_text:
  980.     properties gui.text_properties("notify")
  981.  
  982.  
  983. ## Экран NVL ###################################################################
  984. ##
  985. ## Этот экран используется в диалогах и меню режима NVL.
  986. ##
  987. ## https://www.renpy.org/doc/html/screen_special.html#nvl
  988.  
  989.  
  990. screen nvl(dialogue, items=None):
  991.  
  992.     window:
  993.         style "nvl_window"
  994.  
  995.         has vbox:
  996.             spacing gui.nvl_spacing
  997.  
  998.         ## Показывает диалог или в vpgrid, или в vbox.
  999.         if gui.nvl_height:
  1000.  
  1001.             vpgrid:
  1002.                 cols 1
  1003.                 yinitial 1.0
  1004.  
  1005.                 use nvl_dialogue(dialogue)
  1006.  
  1007.         else:
  1008.  
  1009.             use nvl_dialogue(dialogue)
  1010.  
  1011.         ## Показывает меню, если есть. Меню может показываться некорректно, если
  1012.         ## config.narrator_menu установлено на True.
  1013.         for i in items:
  1014.  
  1015.             textbutton i.caption:
  1016.                 action i.action
  1017.                 style "nvl_button"
  1018.  
  1019.     add SideImage() xalign 0.0 yalign 1.0
  1020.  
  1021.  
  1022. screen nvl_dialogue(dialogue):
  1023.  
  1024.     for d in dialogue:
  1025.  
  1026.         window:
  1027.             id d.window_id
  1028.  
  1029.             fixed:
  1030.                 yfit gui.nvl_height is None
  1031.  
  1032.                 if d.who is not None:
  1033.  
  1034.                     text d.who:
  1035.                         id d.who_id
  1036.  
  1037.                 text d.what:
  1038.                     id d.what_id
  1039.  
  1040.  
  1041. ## Это контролирует максимальное число строк NVL, могущих показываться за раз.
  1042. define config.nvl_list_length = gui.nvl_list_length
  1043.  
  1044. style nvl_window is default
  1045. style nvl_entry is default
  1046.  
  1047. style nvl_label is say_label
  1048. style nvl_dialogue is say_dialogue
  1049.  
  1050. style nvl_button is button
  1051. style nvl_button_text is button_text
  1052.  
  1053. style nvl_window:
  1054.     xfill True
  1055.     yfill True
  1056.  
  1057.     background "gui/nvl.png"
  1058.     padding gui.nvl_borders.padding
  1059.  
  1060. style nvl_entry:
  1061.     xfill True
  1062.     ysize gui.nvl_height
  1063.  
  1064. style nvl_label:
  1065.     xpos gui.nvl_name_xpos
  1066.     xanchor gui.nvl_name_xalign
  1067.     ypos gui.nvl_name_ypos
  1068.     yanchor 0.0
  1069.     xsize gui.nvl_name_width
  1070.     min_width gui.nvl_name_width
  1071.     text_align gui.nvl_name_xalign
  1072.  
  1073. style nvl_dialogue:
  1074.     xpos gui.nvl_text_xpos
  1075.     xanchor gui.nvl_text_xalign
  1076.     ypos gui.nvl_text_ypos
  1077.     xsize gui.nvl_text_width
  1078.     min_width gui.nvl_text_width
  1079.     text_align gui.nvl_text_xalign
  1080.     layout ("subtitle" if gui.nvl_text_xalign else "tex")
  1081.  
  1082. style nvl_thought:
  1083.     xpos gui.nvl_thought_xpos
  1084.     xanchor gui.nvl_thought_xalign
  1085.     ypos gui.nvl_thought_ypos
  1086.     xsize gui.nvl_thought_width
  1087.     min_width gui.nvl_thought_width
  1088.     text_align gui.nvl_thought_xalign
  1089.     layout ("subtitle" if gui.nvl_text_xalign else "tex")
  1090.  
  1091. style nvl_button:
  1092.     properties gui.button_properties("nvl_button")
  1093.     xpos gui.nvl_button_xpos
  1094.     xanchor gui.nvl_button_xalign
  1095.  
  1096. style nvl_button_text:
  1097.     properties gui.button_text_properties("nvl_button")
  1098.  
  1099.  
  1100.  
  1101. ################################################################################
  1102. ## Мобильные варианты
  1103. ################################################################################
  1104.  
  1105. style pref_vbox:
  1106.     variant "medium"
  1107.     xsize 675
  1108.  
  1109. ## Раз мышь может не использоваться, мы заменили быстрое меню версией,
  1110. ## использующей меньше кнопок, но больших по размеру, чтобы их было легче
  1111. ## касаться.
  1112. screen quick_menu():
  1113.  
  1114.     ## Гарантирует, что оно появляется поверх других экранов.
  1115.     zorder 100
  1116.  
  1117.     if quick_menu:
  1118.  
  1119.         hbox:
  1120.             style_prefix "quick"
  1121.  
  1122.             xalign 0.5
  1123.             yalign 1.0
  1124.  
  1125.             textbutton _("Назад") action Rollback()
  1126.             textbutton _("История") action ShowMenu('history')
  1127.             textbutton _("Пропуск") action Skip() alternate Skip(fast=True, confirm=True)
  1128.             textbutton _("Авто") action Preference("auto-forward", "toggle")
  1129.             textbutton _("Сохранить") action ShowMenu('save')
  1130.             textbutton _("Опции") action ShowMenu('preferences')
  1131.             textbutton _("Глав.Меню") action MainMenu()
  1132.             textbutton _("Скрыть текст") action HideInterface()
  1133.  
  1134.  
  1135. style window:
  1136.     variant "small"
  1137.     background "gui/phone/textbox.png"
  1138.  
  1139. style radio_button:
  1140.     variant "small"
  1141.     foreground "gui/phone/button/check_[prefix_]foreground.png"
  1142.  
  1143. style check_button:
  1144.     variant "small"
  1145.     foreground "gui/phone/button/check_[prefix_]foreground.png"
  1146.  
  1147. style nvl_window:
  1148.     variant "small"
  1149.     background "gui/phone/nvl.png"
  1150.  
  1151. style main_menu_frame:
  1152.     variant "small"
  1153.     background "gui/phone/overlay/main_menu.png"
  1154.  
  1155. style game_menu_outer_frame:
  1156.     variant "small"
  1157.     background "gui/phone/overlay/game_menu.png"
  1158.  
  1159. style game_menu_navigation_frame:
  1160.     variant "small"
  1161.     xsize 510
  1162.  
  1163. style game_menu_content_frame:
  1164.     variant "small"
  1165.     top_margin 0
  1166.  
  1167. style pref_vbox:
  1168.     variant "small"
  1169.     xsize 600
  1170.  
  1171. style bar:
  1172.     variant "small"
  1173.     ysize gui.bar_size
  1174.     left_bar Frame("gui/phone/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
  1175.     right_bar Frame("gui/phone/bar/right.png", gui.bar_borders, tile=gui.bar_tile)
  1176.  
  1177. style vbar:
  1178.     variant "small"
  1179.     xsize gui.bar_size
  1180.     top_bar Frame("gui/phone/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
  1181.     bottom_bar Frame("gui/phone/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)
  1182.  
  1183. style scrollbar:
  1184.     variant "small"
  1185.     ysize gui.scrollbar_size
  1186.     base_bar Frame("gui/phone/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
  1187.     thumb Frame("gui/phone/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
  1188.  
  1189. style vscrollbar:
  1190.     variant "small"
  1191.     xsize gui.scrollbar_size
  1192.     base_bar Frame("gui/phone/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
  1193.     thumb Frame("gui/phone/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
  1194.  
  1195. style slider:
  1196.     variant "small"
  1197.     ysize gui.slider_size
  1198.     base_bar Frame("gui/phone/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
  1199.     thumb "gui/phone/slider/horizontal_[prefix_]thumb.png"
  1200.  
  1201. style vslider:
  1202.     variant "small"
  1203.     xsize gui.slider_size
  1204.     base_bar Frame("gui/phone/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
  1205.     thumb "gui/phone/slider/vertical_[prefix_]thumb.png"
  1206.  
  1207. style slider_pref_vbox:
  1208.     variant "small"
  1209.     xsize None
  1210.  
  1211. style slider_pref_slider:
  1212.     variant "small"
  1213.     xsize 900
  1214. ####################################################
  1215.  
  1216. screen yesno_prompt:
  1217.  
  1218.     modal True
  1219.    
  1220.     imagemap:
  1221.         ground 'gui/confirm/ground.png'
  1222.         idle 'gui/confirm/idle.png'
  1223.         hover 'gui/confirm/hover.png'
  1224.        
  1225.         hotspot (580, 559, 268, 135) action yes_action
  1226.         hotspot (1045, 564, 276, 126) action no_action
  1227.    
  1228.     if message == layout.ARE_YOU_SURE:
  1229.         add "gui/confirm/are_you_sure.png"
  1230.  
  1231.     elif message == layout.DELETE_SAVE:
  1232.         add "gui/confirm/delete_save.png"
  1233.        
  1234.     elif message == layout.OVERWRITE_SAVE:
  1235.         add "gui/confirm/overwrite_save.png"
  1236.        
  1237.     elif message == layout.LOADING:
  1238.         add "gui/confirm/loading.png"
  1239.        
  1240.     elif message == layout.QUIT:
  1241.         add "gui/confirm/quit.png"
  1242.        
  1243.     elif message == layout.MAIN_MENU:
  1244.         add "gui/confirm/main_menu.png"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement