From 33aa277c058970d3fcf7cd24d0a0d29da8049fc2 Mon Sep 17 00:00:00 2001 From: nutbuster Date: Thu, 23 Sep 2021 08:39:56 +1000 Subject: [PATCH 1/4] Extra Chapters Menu --- game/screens.rpy | 3 +- game/script/0._extra_stubs.rpy | 31 +++++++++ game/src/extra_chapters_menu.rpy | 108 +++++++++++++++++++++++++++++++ game/src/mod_menu.rpy | 2 +- game/storyline.rpy | 12 ++++ 5 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 game/script/0._extra_stubs.rpy create mode 100644 game/src/extra_chapters_menu.rpy diff --git a/game/screens.rpy b/game/screens.rpy index c68588b..6e36ecc 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -468,7 +468,7 @@ screen main_menu(): use main_menu_buttons("gui/button/menubuttons/template_idle.png", [ [ "Start", Start() ], - [ "Mods", ShowMenu("mod_menu") ], + [ "Bonus Chapters", ShowMenu("ex_ch_menu") ], [ "Load", ShowMenu("load") ], [ "Options", ShowMenu("preferences") ], [ "Extras", ShowMenu("extras") ], \ @@ -1180,6 +1180,7 @@ screen extrasnavigation(): [ "About", ShowMenu("about") ], [ "Updates", ShowMenu("updates") ], [ "Gallery", ShowMenu("cg_gallery_0") ], + [ "Mods", ShowMenu("mod_menu") ], [ "Return", ShowMenu("main_menu") ] ] ) diff --git a/game/script/0._extra_stubs.rpy b/game/script/0._extra_stubs.rpy new file mode 100644 index 0000000..d0814ca --- /dev/null +++ b/game/script/0._extra_stubs.rpy @@ -0,0 +1,31 @@ + +label chapter_x1: + "1" + return +label chapter_x2: + "2" + return +label chapter_x3: + "3" + return +label chapter_x4: + "4" + return +label chapter_x5: + "5" + return +label chapter_x6: + "6" + return +label chapter_x7: + "7" + return +label chapter_x8: + "8" + return +label chapter_x9: + "9" + return +label chapter_x10: + "10" + return diff --git a/game/src/extra_chapters_menu.rpy b/game/src/extra_chapters_menu.rpy new file mode 100644 index 0000000..420f421 --- /dev/null +++ b/game/src/extra_chapters_menu.rpy @@ -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 ) diff --git a/game/src/mod_menu.rpy b/game/src/mod_menu.rpy index 6085dc6..3180fbc 100644 --- a/game/src/mod_menu.rpy +++ b/game/src/mod_menu.rpy @@ -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(): diff --git a/game/storyline.rpy b/game/storyline.rpy index 846d6ba..f80610d 100644 --- a/game/storyline.rpy +++ b/game/storyline.rpy @@ -1,3 +1,13 @@ +init python: + def ending_image(): + endings = 0b0000 + _e = 0b1 + for i in range(1, 5): + fn = str(i)+"of4" + endings |= (_e * renpy.seen_image(fn)) + _e = _e << 0b1 + persistent.endings = endings + label storyline: call chapter_1 call chapter_2 @@ -31,6 +41,7 @@ label storyline: call chapter_12A call chapter_13A call chapter_14A + $ ending_image() $ renpy.quit() else: #>>ERROR HANDLING OH SWEET BABY JESUS SHIT HIT THE FAN @@ -45,6 +56,7 @@ label storyline: St "Yes, but you have to have something wrong with you to speedrun a visual novel beta" "/dev/non" "well shit. Please do report this bug and all the choices you made that lead to this point. Something fucked up real bad" #just liek maek gaem + $ ending_image() call ending return From f5ec200dc87d9754ee96683ea080ec0bb7131a85 Mon Sep 17 00:00:00 2001 From: nutbuster Date: Thu, 23 Sep 2021 08:57:21 +1000 Subject: [PATCH 2/4] Add ??? buttons for endings not 0b1111 --- game/src/extra_chapters_menu.rpy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/src/extra_chapters_menu.rpy b/game/src/extra_chapters_menu.rpy index 420f421..4701476 100644 --- a/game/src/extra_chapters_menu.rpy +++ b/game/src/extra_chapters_menu.rpy @@ -106,3 +106,5 @@ screen ex_ch_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 ) + for x in range(0, len(ex_chapters) - len(ex_chapters_menu)): + use ex_ch_button("gui/button/menubuttons/template_idle.png", "???", None) From 77dafb05fd2f816ccc06fae3fba5eb2432cd6865 Mon Sep 17 00:00:00 2001 From: nutbuster Date: Thu, 23 Sep 2021 09:03:00 +1000 Subject: [PATCH 3/4] Change Extra Nav Menu spacing --- game/screens.rpy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/screens.rpy b/game/screens.rpy index 6e36ecc..1c95a46 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -1171,9 +1171,9 @@ screen extrasnavigation(): else: add "gui/snootgame.png" vbox: - spacing 25 + spacing 10 xpos 1885 - yalign 0.9 + ypos 1130 use main_menu_buttons("gui/button/menubuttons/template_idle.png", [ [ "Help", ShowMenu("help") ], From ef1293e44adc0ffdd74552a34e4f32ea2d198c16 Mon Sep 17 00:00:00 2001 From: nutbuster Date: Thu, 23 Sep 2021 09:06:37 +1000 Subject: [PATCH 4/4] Use the same ending function --- game/src/extra_chapters_menu.rpy | 10 +--------- game/storyline.rpy | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/game/src/extra_chapters_menu.rpy b/game/src/extra_chapters_menu.rpy index 4701476..55e5529 100644 --- a/game/src/extra_chapters_menu.rpy +++ b/game/src/extra_chapters_menu.rpy @@ -14,16 +14,8 @@ init python: ] 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 + ending_image() pass diff --git a/game/storyline.rpy b/game/storyline.rpy index f80610d..fab4826 100644 --- a/game/storyline.rpy +++ b/game/storyline.rpy @@ -1,5 +1,6 @@ -init python: +init -1 python: def ending_image(): + #0b0000, ABCD, flash the bits with |=, check with & endings = 0b0000 _e = 0b1 for i in range(1, 5):