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('**/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'.
# build.classify('game/**.png', 'archive')

View File

@ -4,7 +4,6 @@
init offset = -1
################################################################################
## Styles
################################################################################
@ -416,12 +415,13 @@ screen main_menu():
else:
add "gui/snootgame.png"
vbox:
spacing 25
spacing 10
xpos 1885
yalign 0.9
yalign 0.98
use main_menu_buttons("gui/button/menubuttons/template_idle.png",
[ \
[ "Start", Start() ], \
[ "Mods", ShowMenu("mod_menu") ], \
[ "Load", ShowMenu("load") ], \
[ "Options", ShowMenu("preferences") ], \
[ "Help & About", ShowMenu("extras") ], \
@ -467,6 +467,34 @@ style main_menu_title:
# 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 ############################################################
##
## 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?
#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:
import random
import webbrowser
#function for insult layers
def showCG():
import random
import webbrowser
#function for insult layers
def showCG():
files = ["text0", "text1", "text2", "text3", "text4", "text5", "text6", "text7", "text8", "text9"]
length = len(files)
picked = random.randint(0,length - 1)
fileName = files[picked]
renpy.show(fileName, at_list=[randPosition])
if persistent.scroll == True:
if persistent.scroll == True:
config.keymap['dismiss'].append('mousedown_4')
transform randPosition:

View File

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