Add Mod Support

This commit is contained in:
nutbuster 2021-07-04 16:06:59 +10:00
parent c131ce6328
commit f9edccabd4
7 changed files with 68 additions and 9 deletions

View file

@ -0,0 +1,12 @@
init python:
# Modding Support variables
# All mod rpy files must have title of their mod (this shows up on a button)
# and finally the label that controls the flow of dialogue
mod_menu_access += [["Example Mod", "storyline_ex"]];
image template_sample = Image("mods/template/img/sample.png")
label storyline_ex:
call chapter_2_new

View file

@ -0,0 +1,9 @@
label chapter_2_new:
show template_sample at scenter
"Sample Text"
hide template_sample
show anon neutral flip at aright with dissolve
A "Sample Text"
return

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

View file

@ -185,6 +185,10 @@ init python:
build.classify('**/#**', None) build.classify('**/#**', None)
build.classify('**/thumbs.db', None) build.classify('**/thumbs.db', None)
# Do not include mods as part of the build process
build.classify('game/mods/**', None)
build.classify('game/mods/.**', None)
## To archive files, classify them as 'archive'. ## To archive files, classify them as 'archive'.
# build.classify('game/**.png', 'archive') # build.classify('game/**.png', 'archive')

View file

@ -4,7 +4,6 @@
init offset = -1 init offset = -1
################################################################################ ################################################################################
## Styles ## Styles
################################################################################ ################################################################################
@ -416,12 +415,13 @@ screen main_menu():
else: else:
add "gui/snootgame.png" add "gui/snootgame.png"
vbox: vbox:
spacing 25 spacing 10
xpos 1885 xpos 1885
yalign 0.9 yalign 0.98
use main_menu_buttons("gui/button/menubuttons/template_idle.png", use main_menu_buttons("gui/button/menubuttons/template_idle.png",
[ \ [ \
[ "Start", Start() ], \ [ "Start", Start() ], \
[ "Mods", ShowMenu("mod_menu") ], \
[ "Load", ShowMenu("load") ], \ [ "Load", ShowMenu("load") ], \
[ "Options", ShowMenu("preferences") ], \ [ "Options", ShowMenu("preferences") ], \
[ "Help & About", ShowMenu("extras") ], \ [ "Help & About", ShowMenu("extras") ], \
@ -467,6 +467,34 @@ style main_menu_title:
# properties gui.text_properties("version") # properties gui.text_properties("version")
## Mod Menu screen ############################################################
##
## Handles jumping to the mods scripts
##
screen mod_menu():
tag menu
viewport:
yinitial 0
scrollbars "vertical"
mousewheel True
draggable True
pagekeys True
#side_yfill True
vbox:
spacing 10
xpos 1885
yalign 0.98
for x in mod_menu_access:
use main_menu_button("gui/button/menubuttons/template_idle.png",
x[0], Start(x[1]) )
## Game Menu screen ############################################################ ## Game Menu screen ############################################################
## ##
## This lays out the basic common structure of a game menu screen. It's called ## This lays out the basic common structure of a game menu screen. It's called

View file

@ -13,17 +13,23 @@
#Why yes all my code was formerly in one massive file called "script" thats 28k lines long, how could you tell? #Why yes all my code was formerly in one massive file called "script" thats 28k lines long, how could you tell?
#Licensed under the GNU AGPL v3, for more information check snootgame.xyz or the LICENSE file that should have came with this work. #Licensed under the GNU AGPL v3, for more information check snootgame.xyz or the LICENSE file that should have came with this work.
init -1 python:
# Modding Support variables
# All mod rpy files must run a small init python script
mod_dir = "mods/";
mod_menu_access = [];
init python: init python:
import random import random
import webbrowser import webbrowser
#function for insult layers #function for insult layers
def showCG(): def showCG():
files = ["text0", "text1", "text2", "text3", "text4", "text5", "text6", "text7", "text8", "text9"] files = ["text0", "text1", "text2", "text3", "text4", "text5", "text6", "text7", "text8", "text9"]
length = len(files) length = len(files)
picked = random.randint(0,length - 1) picked = random.randint(0,length - 1)
fileName = files[picked] fileName = files[picked]
renpy.show(fileName, at_list=[randPosition]) renpy.show(fileName, at_list=[randPosition])
if persistent.scroll == True: if persistent.scroll == True:
config.keymap['dismiss'].append('mousedown_4') config.keymap['dismiss'].append('mousedown_4')
transform randPosition: transform randPosition:

View file

@ -58,4 +58,4 @@ label ending:
if tradwife: if tradwife:
scene c10 with fade scene c10 with fade
pause 20 pause 20
return return