forked from Cavemanon/SnootGame
Extra Chapters Menu
This commit is contained in:
108
game/src/extra_chapters_menu.rpy
Normal file
108
game/src/extra_chapters_menu.rpy
Normal file
@ -0,0 +1,108 @@
|
||||
|
||||
init python:
|
||||
ex_chapters = [
|
||||
[ "Chicxulub Gutterlanea", "chapter_x1" ],
|
||||
[ "The Mous Pad", "chapter_x2" ],
|
||||
[ "PTA Meeting", "chapter_x3" ],
|
||||
[ "Passion of the Trigga I", "chapter_x4" ],
|
||||
[ "Passion of the Trigga II", "chapter_x5" ],
|
||||
[ "Passion of the Trigga III", "chapter_x6" ],
|
||||
[ "Naomi's Tribulations I", "chapter_x7" ],
|
||||
[ "Naomi's Tribulations II", "chapter_x8" ],
|
||||
[ "Naomi's Tribulations III", "chapter_x9" ],
|
||||
[ "RAYmba's Observations", "chapter_x10" ]
|
||||
]
|
||||
ex_chapters_menu = ex_chapters.copy()
|
||||
|
||||
#0b0000, ABCD, flash the bits with |=, check with &
|
||||
if persistent.endings is None:
|
||||
endings = 0b0000
|
||||
#seen image for legacy saves/playthroughs, ending image
|
||||
_e = 0b1
|
||||
for i in range(1, 5):
|
||||
fn = str(i)+"of4.png"
|
||||
endings |= (_e * renpy.seen_image(fn))
|
||||
_e = _e << 0b1
|
||||
persistent.endings = endings
|
||||
|
||||
pass
|
||||
|
||||
#similar to quick_button funcs
|
||||
screen ex_ch_button(filename, label, function):
|
||||
button:
|
||||
xmaximum 600
|
||||
ymaximum 129
|
||||
action function
|
||||
if 'Back' in label or 'Return' in label or 'Quit' in label or 'Main Menu' in label:
|
||||
activate_sound "audio/ui/uiBack.wav"
|
||||
else:
|
||||
activate_sound "audio/ui/uiClick.wav"
|
||||
fixed:
|
||||
add filename xalign 0.5 yalign 0.5 zoom 0.9
|
||||
text label xalign 0.5 yalign 0.5 xanchor 0.5 size 34
|
||||
|
||||
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
|
||||
# Reuse the same image string and keep things 'neat'.
|
||||
screen ex_ch_buttons(filename, label_functions):
|
||||
for l_f in label_functions:
|
||||
use ex_ch_button(filename, l_f[0], Start(l_f[1]) )
|
||||
|
||||
screen ex_ch_menu():
|
||||
|
||||
python:
|
||||
global ex_chapters_menu
|
||||
ex_chapters_menu = ex_chapters.copy()
|
||||
e = persistent.endings #ending seen
|
||||
if (e ^ 0b0000 == 0):
|
||||
ex_chapters_menu.clear()
|
||||
elif not (e & 0b1111 == 0b1111):
|
||||
w = 4
|
||||
for i in range(0, 4):
|
||||
w -= persistent.endings >> i & 0b1 == 0b1
|
||||
|
||||
#trish
|
||||
for i in range(5, 5-w, -1):
|
||||
ex_chapters_menu.remove(ex_chapters[i])
|
||||
#naomi
|
||||
for i in range(8, 8-w, -1):
|
||||
ex_chapters_menu.remove(ex_chapters[i])
|
||||
ex_chapters_menu.pop()
|
||||
|
||||
tag menu
|
||||
style_prefix "main_menu"
|
||||
add gui.main_menu_background
|
||||
|
||||
frame:
|
||||
xsize 420
|
||||
yfill True
|
||||
background "gui/overlay/main_menu.png"
|
||||
|
||||
#side_yfill True
|
||||
vbox:
|
||||
xpos 1940
|
||||
yalign 0.03
|
||||
if persistent.splashtype == 1:
|
||||
add "gui/sneedgame.png"
|
||||
else:
|
||||
add "gui/snootgame.png"
|
||||
|
||||
viewport:
|
||||
# this could be better but its ok for now
|
||||
xpos 1885-540
|
||||
xmaximum 540
|
||||
ymaximum 0.8
|
||||
ypos 200
|
||||
yinitial 0
|
||||
scrollbars "vertical"
|
||||
mousewheel True
|
||||
draggable True
|
||||
pagekeys True
|
||||
vbox:
|
||||
#xpos 1885
|
||||
spacing 12
|
||||
#yalign 0.98
|
||||
|
||||
use ex_ch_button("gui/button/menubuttons/template_idle.png", "Return", ShowMenu("main_menu"))
|
||||
#use ex_ch_button("gui/button/menubuttons/template_idle.png", str(e), ShowMenu("main_menu"))
|
||||
if len(ex_chapters_menu):
|
||||
use ex_ch_buttons("gui/button/menubuttons/template_idle.png", ex_chapters_menu )
|
@ -25,7 +25,7 @@ screen mod_menu_button(filename, label, function):
|
||||
# Reuse the same image string and keep things 'neat'.
|
||||
screen mod_menu_buttons(filename, arr):
|
||||
for x in arr:
|
||||
use mod_menu_button(filename, x['Name'], Start(x['Label']))
|
||||
use mod_menu_button(filename, x['Name'], Start(x['Label']) )
|
||||
|
||||
screen mod_menu():
|
||||
|
||||
|
Reference in New Issue
Block a user