-
Notifications
You must be signed in to change notification settings - Fork 21
/
screens.rpy
725 lines (542 loc) · 23.2 KB
/
screens.rpy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# This file is in the public domain. Feel free to modify it as a basis
# for your own screens.
init -1 python hide:
## Used when exiting the game menu to the game.
config.exit_transition = dissolve
## Used between screens of the game menu.
config.intra_transition = dissolve
## Used when entering the game menu from the main menu.
config.main_game_transition = dissolve
## Used when returning to the main menu from the game.
config.game_main_transition = dissolve
## Used when entering the main menu from the splashscreen.
config.end_splash_transition = dissolve
## Used when entering the main menu after the game has ended.
config.end_game_transition = dissolve
## Used when a game is loaded.
config.after_load_transition = dissolve
## Used when the window is shown.
config.window_show_transition = dissolve
## Used when the window is hidden.
config.window_hide_transition = dissolve
config.thumbnail_width = 124
config.thumbnail_height = 70
config.game_menu_action = [ FileTakeScreenshot(), Show("save") ]
##############################################################################
# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say:
if 'mouseup_3' not in config.keymap['game_menu']:
key 'mouseup_3' action Show('save')
key 'h' action Hide('say')
# Defaults for side_image and two_window
default side_image = None
default two_window = False
zorder 100
# Decide if we want to use the one-window or two-window varaint.
if not two_window:
# The one window variant.
window:
id "window"
has vbox:
style "say_vbox"
ysize 380
ypos 0.1
if who:
text who:
id "who"
size 35
outlines [ (2, "#0a0a0a", 0, 0) ]
text what:
id "what"
xmaximum 1080 #change this to increase the max length of the text. (anything longer gets wrapped)
ypos 0.8 #vertical position
text_align 0.5 #centers the text inside the displayable
xalign 0.5 #sets the text displayable itself in the center of the screen
size 25
outlines [ (2, "#0a0a0a", 0, 0) ]
#textbutton "Dev Con" xpos 1800 ypos 0 action Show("devconsole", transition=None)
# Use the quick menu.
use quick_menu
screen devconsole:
textbutton "Tweak stats" xpos 0.85 ypos 0.05 action None
textbutton "quit" xpos 0.85 ypos 0.08 action Jump('quit')
textbutton "Back" xpos 0.85 ypos 0.11 action Hide("devconsole", transition=None)
##############################################################################
# Choice
#
# Screen that's used to display in-game menus.
# http://www.renpy.org/doc/html/screen_special.html#choice
screen choice:
vbox:
ypos 0.65
spacing 5
# Create one textbutton per label, action pair.
for label, action, chosen in items:
imagebutton:
action action
xmargin 140
xfill True
idle "Menu/choice.png"
hover "Menu/choice_hover.png"
vbox:
ypos 0.655
xalign 0.5
spacing 28
for label, action, chosen in items:
text label:
size 25
outlines [ (2, "#000", 0, 0) ]
text_align 0.5
xalign 0.5
yalign 0.5
init -2 python:
config.narrator_menu = True
style.menu_window.set_parent(style.default)
style.menu_choice.set_parent(style.button_text)
style.menu_choice.clear()
style.menu_choice_button.set_parent(style.button)
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
##############################################################################
# Input
#
# Screen that's used to display renpy.input()
# http://www.renpy.org/doc/html/screen_special.html#input
screen input:
window:
has vbox
text prompt
input id "input"
use quick_menu
##############################################################################
# Nvl
#
# Screen used for nvl-mode dialogue and menus.
# http://www.renpy.org/doc/html/screen_special.html#nvl
screen nvl:
window:
style "nvl_window"
has vbox:
style "nvl_vbox"
# Display dialogue.
for who, what, who_id, what_id, window_id in dialogue:
window:
id window_id
has hbox:
spacing 10
if who is not None:
text who id who_id
text what id what_id
# Display a menu, if given.
if items:
vbox:
id "menu"
for caption, action, chosen in items:
if action:
button:
style "nvl_menu_choice_button"
action action
text caption style "nvl_menu_choice"
else:
text caption style "nvl_dialogue"
add SideImage() xalign 0.0 yalign 1.0
use quick_menu
##############################################################################
# Main Menu
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu:
$store.BM = Battle()
$store.MasterBM = store.BM
$store.BM.phase = 'Player'
imagemap:
ground "Menu/menu_default.jpg"
idle "Menu/menu_default.jpg"
insensitive "Menu/menu_inactive.jpg"
hover "Menu/menu_hover.jpg"
hotspot (160, 405, 133, 50) action Show('campaigns', transition=dissolve)
hotspot (80, 472, 208, 50) action FileLoad("1", page="auto", confirm=False)
hotspot (171, 537, 118, 50) action ShowMenu('load')
hotspot (92, 598, 200, 50) action ShowMenu('preferences')
hotspot (138, 666, 151, 50) action ShowMenu('bonus')
hotspot (186, 730, 108, 50) action Quit()
text '[config.version]' xpos 0.01 ypos 0.98 size 12
if CENSOR == False:
text ' RESTORATION PATCH DETECTED' xpos 0.01 ypos 0.958 size 15
if CENSOR == True:
text ' VANILLA EDITION' xpos 0.01 ypos 0.958 size 15
screen campaigns:
imagemap:
ground "Menu/mainmenu_campaign.png"
idle "Menu/mainmenu_campaign.png"
insensitive "Menu/mainmenu_campaign.png"
hover "Menu/mainmenu_campaign_hover.png"
alpha False
hotspot (300, 385, 230, 40) action Start()
hotspot (300, 425, 350, 40) action Start("skiptomaskofarcadius")
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
##############################################################################
# Navigation
#
# Screen that's included in other screens to display the game menu
# navigation and background.
# http://www.renpy.org/doc/html/screen_special.html#navigation
screen navigation:
# The background of the game menu.
window:
style "gm_root"
# The various buttons.
frame:
style_group "gm_nav"
xalign .98
yalign .98
has vbox
textbutton _("Return") action Return()
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Save Game") action ShowMenu("save")
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Main Menu") action MainMenu()
textbutton _("Help") action Help()
textbutton _("Quit") action Quit()
init -2 python:
style.gm_nav_button.size_group = "gm_nav"
deletedScenes = BonusItem("Background/renpytomback.jpg", " Deleted Scenes", "deleted_scenes", 0.09)
# chapterSelect = BonusItem("CG/cera.jpg", " Chapter Select", "chapter_select", 0.09)
modScenes = BonusItem("CG/mochi1.jpg", " Addon Scene Select", "mod_scenes", 0.09)
bonus_features = [deletedScenes, modScenes] #, chapterSelect]
screen bonus:
modal True
zorder 200
imagemap:
ground "Menu/bonus_base.png"
hover "Menu/bonus_hover.png"
hotspot (726, 59, 137, 44) action [ Hide('bonus'), Show('save', transition=dissolve) ]
hotspot (948, 926, 107, 23) action Hide('bonus', transition=dissolve)
hotspot (864, 59, 137, 44) action [ Hide('bonus'), Show('load', transition=dissolve) ]
hotspot (1002, 59, 137, 44) action [ Hide('bonus'), Show('preferences', transition=dissolve) ]
hotspot (1140, 59, 137, 44) action Hide('bonus', transition=dissolve)
$ columns = 1
$ rows = 5
# Display a grid of file slots.
grid columns rows:
transpose True
xfill True
xpos 753
ypos 216
if hasattr(store,'BM'):
$BM.phase = 'Player' # This is done to make sure that we can open the menu while in a bonus
# Display five file slots, numbered 1 - 5.
for i in range(1, columns * rows + 1):
button:
xminimum 460
yminimum 130
background None #Solid(0,0,0,255)
has hbox
# Add the image and text.
if i - 1 < len(bonus_features):
$ bonusimage = 0
imagebutton:
idle (bonus_features[i - 1].image)
hover hoverglow(bonus_features[i - 1].image)
at zoom_button(bonus_features[i - 1].zoom)
action [ResetBonusPage(),Hide('bonus'),ShowMenu(bonus_features[i - 1].jumpLoc)]
text bonus_features[i - 1].text
else:
text str(i) + ". Unused Bonus"
##############################################################################
# Save, Load
#
# Screens that allow the user to save and load the game.
# http://www.renpy.org/doc/html/screen_special.html#save
# http://www.renpy.org/doc/html/screen_special.html#load
# Since saving and loading are so similar, we combine them into
# a single screen, file_picker. We then use the file_picker screen
# from simple load and save screens.
screen load:
modal True
zorder 200
key "mousedown_3" action Hide('load', transition=dissolve)
key 'mousedown_4' action NullAction() #should fix a bug where you can rollback in battle when the menu is open.
if not hasattr(store,'BM'):
$ BM = Battle()
$ MasterBM = BM
if (BM.phase == 'PACT' or BM.phase == 'Pirate'):
text 'WARNING! \n You can not load during the enemy \n turn.':
xalign 0.5
yalign 0.5
size 35
color 'fff'
outlines [(2,'f00',0,0)]
timer 2 action Hide('load')
else:
imagemap:
ground "Menu/load_base.png"
hover "Menu/load_hover.png"
hotspot (752, 215, 137, 28) action FilePage(1)
hotspot (913, 215, 137, 28) action FilePage("auto")
hotspot (1075, 215, 137, 28) action FilePage("quick")
hotspot (1221, 250, 30, 146) action FilePagePrevious()
hotspot (1221, 724, 30, 146) action FilePageNext()
hotspot (948, 926, 107, 23) action Hide('load', transition=dissolve)
hotspot (726, 59, 137, 44) action [ Hide('load'), Show('save', transition=dissolve) ]
hotspot (1002, 59, 137, 44) action [ Hide('load'), Show('preferences', transition=dissolve) ]
hotspot (1140, 59, 137, 44) action MainMenu()
style "file_picker_frame"
$ columns = 1
$ rows = 8
# Display a grid of file slots.
grid columns rows:
transpose True
xfill True
style_group "file_picker"
xpos 753
ypos 251
# Display eight file slots, numbered 1 - 8.
for i in range(1, columns * rows + 1):
# Each file slot is an hbox containing two buttons.
hbox:
button:
xminimum 424
yminimum 77
action FileAction(i)
has hbox
# Add the screenshot.
add FileScreenshot(i)
# Format the description, and add it as text.
$ description = "% 2s. %s\n%s" % (
FileSlotName(i, columns * rows),
FileTime(i, empty=_("Empty Slot.")),
FileSaveName(i))
text description
key "save_delete" action FileDelete(i)
button:
yminimum 77
action FileDelete(i)
text "X" # Or this could be an image or something.
screen save:
modal True
zorder 200
key "mousedown_3" action Hide('save', transition=dissolve)
key 'mousedown_4' action NullAction() #should fix a bug where you can rollback in battle when the menu is open.
if not hasattr(store,"BM"):
$ BM = Battle()
#No need to update the MasterBM if there is no battle manager to begin with. Besides, the MasterBM and the BM might not be the same
if (BM.phase == 'PACT' or BM.phase == 'Pirate'):
text 'WARNING! \n You can not save during the enemy \n turn.':
xalign 0.5
yalign 0.5
size 35
color 'fff'
outlines [(2,'f00',0,0)]
timer 2 action Hide('save')
else:
imagemap:
ground "Menu/save_base.png"
hover "Menu/save_hover.png"
hotspot (752, 215, 137, 28) action FilePage(1)
hotspot (913, 215, 137, 28) action FilePage("auto")
hotspot (1075, 215, 137, 28) action FilePage("quick")
hotspot (1221, 250, 30, 146) action FilePagePrevious()
hotspot (1221, 724, 30, 146) action FilePageNext()
hotspot (948, 926, 107, 23) action Hide('save', transition=dissolve)
hotspot (864, 59, 137, 44) action [ Hide('save'), Show('load', transition=dissolve) ]
hotspot (1002, 59, 137, 44) action [ Hide('save'), Show('preferences', transition=dissolve) ]
hotspot (1140, 59, 137, 44) action MainMenu()
style "file_picker_frame"
$ columns = 1
$ rows = 8
# Display a grid of file slots.
grid columns rows:
transpose True
xfill True
style_group "file_picker"
xpos 753
ypos 251
# Display eight file slots, numbered 1 - 8.
for i in range(1, columns * rows + 1):
# Each file slot is an hbox containing two buttons.
hbox:
button:
xminimum 424
yminimum 77
action FileAction(i)
has hbox
# Add the screenshot.
add FileScreenshot(i)
# Format the description, and add it as text.
$ description = "% 2s. %s\n%s" % (
FileSlotName(i, columns * rows),
FileTime(i, empty=_("Empty Slot.")),
FileSaveName(i))
text description
key "save_delete" action FileDelete(i)
button:
yminimum 77
action FileDelete(i)
text "X" # Or this could be an image or something.
init -2 python:
style.file_picker_frame = Style(style.menu_frame)
style.file_picker_nav_button = Style(style.small_button)
style.file_picker_nav_button_text = Style(style.small_button_text)
style.file_picker_button = Style(style.large_button)
style.file_picker_text = Style(style.large_button_text)
style.large_button.idle_color = "#2E2E2E"
style.large_button.hover_color = "#ccc"
##############################################################################
# Preferences
#
# Screen that allows the user to change the preferences.
# http://www.renpy.org/doc/html/screen_special.html#prefereces
screen preferences:
zorder 200
modal True
key "mousedown_3" action Hide('preferences', transition=dissolve)
key 'mousedown_4' action NullAction() #should fix a bug where you can rollback in battle when the menu is open.
imagemap:
ground "Menu/preferences_base.png"
hover "Menu/preferences_hover.png"
selected_idle "Menu/preferences_active.png"
selected_hover "Menu/preferences_active.png"
hotspot (864, 59, 137, 44) action [ Hide('preferences'), Show('load', transition=dissolve) ]
hotspot (726, 59, 137, 44) action [ Hide('preferences'), Show('save', transition=dissolve) ]
hotspot (1070, 130, 160, 50) action [ Hide('preferences'), Show('gameprefs', transition=dissolve) ]
hotspot (1140, 59, 137, 44) action MainMenu()
hotspot (820, 235, 100, 25) action Preference("display", "window")
hotspot (1035, 235, 180, 25) action Preference("display", "fullscreen")
hotspot (820, 340, 200, 25) action Preference("skip", "seen")
hotspot (1040, 340, 180, 25) action Preference("skip", "all")
hotspot (820, 410, 190, 25) action Preference("after choices", "skip")
hotspot (1040, 410, 220, 25) action Preference("after choices", "stop")
hotspot (822, 470, 146, 15) action Skip(fast=True)
hotspot (948, 926, 107, 23) action Hide('preferences', transition=dissolve)
bar:
xpos 780
ypos 570
xmaximum 250
value Preference("music volume")
bar:
xpos 780
ypos 650
xmaximum 250
value Preference("sound volume")
bar:
xpos 780
ypos 800
xmaximum 250
value Preference("text speed")
bar:
xpos 780
ypos 725
xmaximum 250
value Preference("voice volume")
textbutton "Test":
xpos 1100
ypos 650
action Play("sound", "Sound/explosion1.ogg")
style "soundtest_button"
bar:
xpos 780
ypos 880
xmaximum 250
value Preference("auto-forward time")
screen gameprefs:
zorder 200
modal True
key "mousedown_3" action Hide('gameprefs', transition=dissolve)
key 'mousedown_4' action NullAction() #should fix a bug where you can rollback in battle when the menu is open.
imagemap:
ground "Menu/preferences_gameplay_base.png"
hover "Menu/preferences_gameplay_hover.png"
selected_idle "Menu/preferences_gameplay_active.png"
selected_hover "Menu/preferences_gameplay_active.png"
hotspot (864, 59, 137, 44) action [ Hide('gameprefs'), Show('load', transition=dissolve) ]
hotspot (726, 59, 137, 44) action [ Hide('gameprefs'), Show('save', transition=dissolve) ]
hotspot (750, 130, 160, 50) action [ Hide('gameprefs'), Show('preferences', transition=dissolve) ]
hotspot (750, 260, 250, 30) action SetVariable("Difficulty", 0)
hotspot (750, 340, 250, 30) action SetVariable("Difficulty", 1)
hotspot (750, 400, 250, 30) action SetVariable("Difficulty", 2)
hotspot (750, 460, 250, 30) action SetVariable("Difficulty", 3)
hotspot (750, 540, 250, 30) action SetVariable("Difficulty", 4)
hotspot (750, 600, 250, 30) action SetVariable("Difficulty", 5)
hotspot (785, 707, 50, 30) action SetField(BM, 'show_tooltips', True)
hotspot (1000, 707, 80, 30) action SetField(BM, 'show_tooltips', False)
hotspot (785, 780, 50, 30) action SetField(BM, 'edgescroll', (100,800))
hotspot (1000, 780, 80, 30) action SetField(BM, 'edgescroll', (0,0))
hotspot (785, 850, 50, 30) action SetField(BM, 'show_battle_log', True)
hotspot (1000, 850, 80, 30) action SetField(BM, 'show_battle_log', False)
hotspot (948, 926, 107, 23) action Hide('gameprefs', transition=dissolve)
init -2 python:
style.bar.hover_color = "#ccc"
style.pref_frame.xfill = True
style.pref_frame.xmargin = 5
style.pref_frame.top_margin = 5
style.pref_vbox.xfill = True
style.pref_button.size_group = "pref"
style.pref_button.xalign = 1.0
style.pref_slider.xmaximum = 192
style.pref_slider.xalign = 1.0
style.soundtest_button.xalign = 1.0
##############################################################################
# Yes/No Prompt
#
# Screen that asks the user a yes or no question.
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt
screen yesno_prompt:
zorder 200
modal True
imagemap:
ground "Menu/yesno_menu.png"
textbutton _("Yes"):
xalign 0.48
yalign 0.57
action yes_action
textbutton _("No"):
xalign 0.58
yalign 0.57
action no_action
label _(message):
xalign 0.53
yalign 0.48
init -2 python:
style.yesno_button.size_group = "yesno"
style.yesno_label_text.text_align = 0.5
##############################################################################
# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu:
# Add an in-game quick menu.
hbox:
style_group "quick"
xalign 0.99
yalign 0.99
textbutton _("Q.Save") action QuickSave()
textbutton _("Q.Load") action QuickLoad()
textbutton _("Save") action [ FileTakeScreenshot(), Show('save',transition=dissolve) ]
textbutton _("Load") action [ FileTakeScreenshot(), Show('load',transition=dissolve) ]
textbutton _("Skip") action Skip()
textbutton _("Auto") action Preference("auto-forward", "toggle")
textbutton _("Prefs") action [ FileTakeScreenshot(), Show('preferences',transition=dissolve) ]
textbutton _("M.Menu") action MainMenu()
init -2 python:
style.quick_button.set_parent('default')
style.quick_button.background = None
style.quick_button.xpadding = 5
style.quick_button_text.set_parent('default')
style.quick_button_text.size = 20
style.quick_button_text.idle_color = "#8888"
style.quick_button_text.hover_color = "#ccc"
style.quick_button_text.selected_idle_color = "#cc08"
style.quick_button_text.selected_hover_color = "#cc0"
style.quick_button_text.insensitive_color = "#4448"
# Set a default value for the auto-forward time, and note that AFM is
# turned off by default.
config.default_afm_time = 1
config.default_afm_enable = False