Advertisement
Hijiri

WtWDR code samples

Dec 31st, 2019
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.79 KB | None | 0 0
  1. screen main_menu():
  2.  
  3.     ## This ensures that any other menu screen is replaced.
  4.     tag menu
  5.  
  6.     style_prefix "main_menu"
  7.  
  8.     if renpy.variant("small"):
  9.         add "gui/phone/mobi_title.jpg"
  10.         imagemap:
  11.             auto "gui/phone/imagemap/title_%s.jpg"
  12.  
  13.             hotspot (440, 339, 400, 61) action Start()
  14.             hotspot (440, 428, 400, 61) action ShowMenu("load")
  15.             hotspot (440, 519, 400, 61) action ShowMenu("preferences")
  16.             hotspot (440, 607, 400, 61) action [ ShowMenu("music_room"), SensitiveIf(persistent.completed_rin) ]
  17.  
  18.  
  19.  
  20.     else:
  21.  
  22.         add gui.main_menu_background
  23.         add "gui/overlay/main_menu.png"
  24.         vbox:
  25.             xpos 0
  26.             yalign 0.5
  27.             spacing 10
  28.  
  29.             textbutton "Start" action Start() style "mm_button"
  30.             textbutton "Load" action ShowMenu("load") style "mm_button"
  31.             #if persistent.kokoroiyashi:
  32.                 #textbutton "Chapter Select" style "mm_button":
  33.                     ##action NullAction()
  34.                     #hovered "gui/chap_tooltip.jpg"
  35.             #else:
  36.                 #textbutton "Chapter Select" style "mm_button":
  37.                     #action NullAction()
  38.                     #hovered ShowTransient("the_img", img="gui/chap_tooltip.jpg", transition=dissolve)
  39.                     #unhovered Hide("the_img", transition=dissolve)
  40.             textbutton "Settings" action ShowMenu("preferences") style "mm_button"
  41.             textbutton "Extras" action ShowMenu("extras") style "mm_button"
  42.             textbutton "Quit" action Quit(confirm=True) style "mm_button"
  43.  
  44. screen the_img(img):
  45.     add img pos (390, 310)
  46.  
  47.  
  48.  
  49. init -2:
  50.     style mm_button is button:
  51.         xminimum 380
  52.         ymaximum 74
  53.         top_padding 25
  54.         right_padding 50
  55.     style mm_button background None
  56.     style mm_button hover_background "mm_hover"
  57.     style mm_button selected_idle_background None
  58.     style mm_button selected_hover_background None
  59.     style mm_button focus_mask "gui/button/mm_hover.png"
  60.     style mm_button hover_sound "audio/sfx/hover.ogg"
  61.     style mm_button_text color "#777777"
  62.     style mm_button_text hover_color "#fff"
  63.     style mm_button_text selected_color "#fff"
  64.     style mm_button_text insensitive_color "#252525"
  65.     style mm_button_text font "fonts/ADAM.otf"
  66.  
  67. screen file_slots:
  68.     viewport:
  69.         scrollbars "vertical"
  70.         xpos 708
  71.         ypos 111
  72.         mousewheel True
  73.         area (710, 111, 525, 504)
  74.         side_yfill True
  75.  
  76.         vbox:
  77.             spacing 30
  78.             for i in range(0, 30):
  79.  
  80.                 $ slot = i + 1
  81.  
  82.                 button:
  83.                     action FileAction(slot)
  84.                     hovered ShowTransient("sl_image", img=FileScreenshot(slot))
  85.                     unhovered Hide("sl_image")
  86.                     style "slott_button"
  87.  
  88.                     has hbox
  89.  
  90.                     spacing 2
  91.  
  92.                     text FileTime(slot, format=_("{#file_time}%b %d —"), empty=_("Empty Slot")):
  93.                         style "slot_time_text"
  94.  
  95.                     text FileSaveName(slot):
  96.                         style "slot_name_text"
  97.  
  98.                     key "save_delete" action FileDelete(slot)
  99.  
  100. screen sl_image(img):
  101.     add img pos (23, 191)
  102.  
  103. style page_label is gui_label
  104. style page_label_text is gui_label_text
  105. style page_button is gui_button
  106. style page_button_text is gui_button_text
  107. style slot_button_text is gui_button_text
  108. style slot_time_text is slot_button_text
  109. style slot_name_text is slot_button_text
  110. init -2:
  111.     style slott_button is button:
  112.         xminimum 500
  113.         ymaximum 60
  114.         left_padding 10
  115.         top_padding 20
  116.     style slott_button background "gui/button/slot_ground_background.png"
  117.     style slott_button idle_background "gui/button/slot_idle_background.png"
  118.     style slott_button hover_background "gui/button/slot_hover_background.png"
  119.     style slott_button focus_mask "gui/button/slot_ground_background.png"
  120.     style slott_button hover_sound "audio/sfx/hover.ogg"
  121.  
  122. screen preferences():
  123.  
  124.     tag menu
  125.  
  126.     add gui.game_menu_background
  127.     add "gui/sett.png":
  128.         xpos 0
  129.         ypos 65
  130.  
  131.     use navigation
  132.  
  133.     if renpy.variant("small"):
  134.  
  135.         vbox:
  136.             xpos 37
  137.             ypos 128
  138.             spacing 30
  139.             style_prefix "radio"
  140.             label _("Skip")
  141.             hbox:
  142.                 textbutton _("READ TEXT") action Preference("skip", "seen")
  143.                 textbutton _("ALL TEXT") action Preference("skip", "all")
  144.                 textbutton _("TRANSITIONS") action InvertSelected(Preference("transitions", "toggle"))
  145.  
  146.             label _("Rollback Side")
  147.             hbox:
  148.                 style_prefix "radio"
  149.                 textbutton _("Disable") action Preference("rollback side", "disable")
  150.                 textbutton _("Left") action Preference("rollback side", "left")
  151.                 textbutton _("Right") action Preference("rollback side", "right")
  152.  
  153.         vbox:
  154.             xpos 640
  155.             ypos 128
  156.             style_prefix "slider"
  157.  
  158.             vbox:
  159.                 spacing 15
  160.  
  161.                 label _("Text Speed")
  162.  
  163.                 bar value Preference("text speed")
  164.  
  165.                 label _("Auto-Forward Time")
  166.  
  167.                 bar value Preference("auto-forward time")
  168.  
  169.                 if config.has_music:
  170.                     label _("Music Volume")
  171.  
  172.                     hbox:
  173.                         bar value Preference("music volume")
  174.  
  175.                 if config.has_sound:
  176.  
  177.                     label _("Sound Volume")
  178.  
  179.                     hbox:
  180.                         bar value Preference("sound volume")
  181.  
  182.                         if config.sample_sound:
  183.                             textbutton _("Test") action Play("sound", config.sample_sound)
  184.  
  185.  
  186.                 if config.has_voice:
  187.                     label _("Ambient Volume")
  188.  
  189.                     hbox:
  190.                         bar value Preference("ambient volume")
  191.  
  192.                         if config.sample_voice:
  193.                             textbutton _("Test") action Play("voice", config.sample_voice)
  194.  
  195.                 if config.has_music or config.has_sound or config.has_voice:
  196.                     null height gui.pref_spacing
  197.  
  198.             textbutton _("Mute All"):
  199.                 action Preference("all mute", "toggle")
  200.                 style "mute_all_button"
  201.  
  202.     else:
  203.         vbox:
  204.             xpos 37
  205.             ypos 128
  206.             spacing 30
  207.             box_wrap True
  208.  
  209.             vbox:
  210.                 style_prefix "radio"
  211.                 label _("Display Type")
  212.                 hbox:
  213.                     textbutton _("WINDOWED") action Preference("display", "any window")
  214.                     textbutton _("FULLSCREEN") action Preference("display", "fullscreen")
  215.  
  216.             vbox:
  217.                 style_prefix "radio"
  218.  
  219.                 label _("Window Size")
  220.                 hbox:
  221.                     textbutton "SMALL" action Preference("display", 0.6)
  222.                     textbutton "MEDIUM" action Preference("display", 0.8)
  223.                     textbutton "LARGE" action Preference("display", 1.0)
  224.  
  225.             vbox:
  226.                 style_prefix "radio"
  227.                 label _("Skip")
  228.                 hbox:
  229.                     textbutton _("READ TEXT") action Preference("skip", "seen")
  230.                     textbutton _("ALL TEXT") action Preference("skip", "all")
  231.                     textbutton _("TRANSITIONS") action InvertSelected(Preference("transitions", "toggle"))
  232.  
  233.             ## Additional vboxes of type "radio_pref" or "check_pref" can be
  234.             ## added here, to add additional creator-defined preferences.
  235.  
  236.             #null width (4 * gui.pref_spacing)
  237.  
  238.         vbox:
  239.             xpos 640
  240.             ypos 128
  241.             style_prefix "slider"
  242.  
  243.             vbox:
  244.                 spacing 15
  245.  
  246.                 label _("Text Speed")
  247.  
  248.                 bar value Preference("text speed")
  249.  
  250.                 label _("Auto-Forward Time")
  251.  
  252.                 bar value Preference("auto-forward time")
  253.  
  254.                 if config.has_music:
  255.                     label _("Music Volume")
  256.  
  257.                     hbox:
  258.                         bar value Preference("music volume")
  259.  
  260.                 if config.has_sound:
  261.  
  262.                     label _("Sound Volume")
  263.  
  264.                     hbox:
  265.                         bar value Preference("sound volume")
  266.  
  267.                         if config.sample_sound:
  268.                             textbutton _("Test") action Play("sound", config.sample_sound)
  269.  
  270.  
  271.                 if config.has_voice:
  272.                     label _("Ambient Volume")
  273.  
  274.                     hbox:
  275.                         bar value Preference("ambient volume")
  276.  
  277.                         if config.sample_voice:
  278.                             textbutton _("Test") action Play("voice", config.sample_voice)
  279.  
  280.                 if config.has_music or config.has_sound or config.has_voice:
  281.                     null height gui.pref_spacing
  282.  
  283.             textbutton _("Mute All"):
  284.                 action Preference("all mute", "toggle")
  285.                 style "mute_all_button"
  286.  
  287. ##And then once you get a handle at customization, you can do stuff like this below
  288. screen chapterselect:
  289.     add "gui/game_menu.jpg"
  290.     add "gui/arcs/title.png":
  291.         xpos 0
  292.         ypos 65
  293.     vbox:
  294.         xpos 552
  295.         ypos 34
  296.         spacing 74
  297.         imagebutton:
  298.             idle "gui/arcs/rin_idle.png"
  299.             hover "gui/arcs/rin_hover.png"
  300.             hovered ShowTransient("arc_image", img="gui/arcs/rin.png", transition=dissolve)
  301.             unhovered Hide("arc_image", transition=dissolve)
  302.             hover_sound "audio/sfx/hover.ogg"
  303.             activate_sound "audio/sfx/route_select.ogg"
  304.             action Jump("rinroute")
  305.         imagebutton:
  306.             insensitive "gui/arcs/locked.png"
  307.             idle "gui/arcs/ken_idle.png"
  308.             hover "gui/arcs/ken_hover.png"
  309.             hovered ShowTransient("arc_image", img="gui/arcs/ken.png", transition=dissolve)
  310.             unhovered Hide("arc_image", transition=dissolve)
  311.             hover_sound "audio/sfx/hover.ogg"
  312.             activate_sound "audio/sfx/route_select.ogg"
  313.             action [ Return("kenroute"), SensitiveIf(persistent.completed_rin) ]
  314.         imagebutton:
  315.             insensitive "gui/arcs/locked.png"
  316.             idle "gui/arcs/dai_idle.png"
  317.             hover "gui/arcs/dai_hover.png"
  318.             hovered ShowTransient("arc_image", img="gui/arcs/dai.png", transition=dissolve)
  319.             unhovered Hide("arc_image", transition=dissolve)
  320.             hover_sound "audio/sfx/hover.ogg"
  321.             activate_sound "audio/sfx/route_select.ogg"
  322.             action [ Return("shinroute"), SensitiveIf(persistent.completed_ken) ]
  323.  
  324.  
  325. screen arc_image(img):
  326.     add img pos (15, 164)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement