Initial commit
This commit is contained in:
commit
d0a3798dd2
67 changed files with 4612 additions and 0 deletions
54
game/optional files/adjust_attributes.rpy
Normal file
54
game/optional files/adjust_attributes.rpy
Normal file
|
@ -0,0 +1,54 @@
|
|||
## Adjust Attributes ###########################################################
|
||||
##
|
||||
## This is a special configuration value which can be used to easily create
|
||||
## shorthand for layered images. This code is adapted slightly from Ren'Py Tom's
|
||||
## article on the topic:
|
||||
## https://patreon.renpy.org/dev-2021-04.html#adjust-attribute-example
|
||||
##
|
||||
## You can learn more about config.adjust_attributes here:
|
||||
## https://www.renpy.org/doc/html/config.html#var-config.adjust_attributes
|
||||
##
|
||||
## As per usual, if you do not need it, you may freely remove this file.
|
||||
##
|
||||
|
||||
init -100 python:
|
||||
|
||||
class Aliases(object):
|
||||
"""
|
||||
Expands attributes into other attributes.
|
||||
"""
|
||||
|
||||
def __init__(self, **aliases):
|
||||
|
||||
# A map from an attribute name to a tuple of
|
||||
# attributes it expands to.
|
||||
self.aliases = { }
|
||||
|
||||
for k, v in aliases.items():
|
||||
self.aliases[k] = tuple(v.split())
|
||||
|
||||
def __call__(self, name):
|
||||
|
||||
# The image tag
|
||||
rv = [ name[0] ]
|
||||
|
||||
# The remaining attributes
|
||||
for i in name[1:]:
|
||||
## Also remove the provided attributes, if negated
|
||||
if i.startswith("-"):
|
||||
prefix = "-"
|
||||
i = i[1:]
|
||||
else:
|
||||
prefix = ""
|
||||
|
||||
for attr in self.aliases.get(i, ( i, )):
|
||||
rv.append(prefix + attr)
|
||||
|
||||
# Turn the results back into a tuple
|
||||
return tuple(rv)
|
||||
|
||||
## A possible use case:
|
||||
# define config.adjust_attributes['eileen'] = Aliases(
|
||||
# happy="eyes_happy mouth_happy",
|
||||
# concerned="eyes_concerned mouth_concerned",
|
||||
# )
|
68
game/optional files/afm_indicator.rpy
Normal file
68
game/optional files/afm_indicator.rpy
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
## Auto indicator screen #######################################################
|
||||
##
|
||||
## This screen is used to indicate that auto-forward mode is in progress.
|
||||
## Created by me, Feniks. You may remove this whole file if you don't need
|
||||
## an auto-forward indicator screen.
|
||||
##
|
||||
|
||||
init python:
|
||||
def auto_indicator():
|
||||
"""
|
||||
A function which, when called, determines if the Auto indicator
|
||||
should be shown on-screen or not.
|
||||
"""
|
||||
|
||||
# Auto mode is on
|
||||
if preferences.afm_enable and not renpy.get_screen('auto_indicator'):
|
||||
renpy.show_screen('auto_indicator')
|
||||
# Auto mode is off
|
||||
elif not preferences.afm_enable and renpy.get_screen('auto_indicator'):
|
||||
renpy.hide_screen('auto_indicator')
|
||||
|
||||
return
|
||||
|
||||
# This adds the auto indicator to a list of overlay functions
|
||||
# so that it can automatically show the Auto indicator.
|
||||
if auto_indicator not in config.overlay_functions:
|
||||
config.overlay_functions.append(auto_indicator)
|
||||
|
||||
screen auto_indicator():
|
||||
|
||||
zorder 100
|
||||
style_prefix "auto"
|
||||
|
||||
frame:
|
||||
has hbox
|
||||
|
||||
text _("Auto-Forward")
|
||||
|
||||
text "▸" at auto_blink(1.0) style "skip_triangle"
|
||||
|
||||
## This transform is used to blink the arrows one after another.
|
||||
transform auto_blink(cycle):
|
||||
alpha 0.0
|
||||
linear 0.5 alpha 1.0
|
||||
pause 0.2
|
||||
linear 0.5 alpha 0.0
|
||||
pause (cycle - .4)
|
||||
repeat
|
||||
|
||||
style auto_hbox:
|
||||
spacing 9
|
||||
|
||||
style auto_frame:
|
||||
is empty
|
||||
ypos 15
|
||||
background Frame("#0008", 24, 8, 75, 8, tile=False)
|
||||
padding (24, 8, 75, 8)
|
||||
|
||||
style auto_text:
|
||||
size 24
|
||||
|
||||
style auto_triangle:
|
||||
is auto_text
|
||||
## We have to use a font that has the BLACK RIGHT-POINTING SMALL TRIANGLE
|
||||
## glyph in it.
|
||||
font "DejaVuSans.ttf"
|
||||
|
98
game/optional files/confirm_action.rpy
Normal file
98
game/optional files/confirm_action.rpy
Normal file
|
@ -0,0 +1,98 @@
|
|||
## Custom Confirm Action #######################################################
|
||||
##
|
||||
## This file contains an action similar to the Confirm screen action which
|
||||
## it can be used for information and confirmation prompts.
|
||||
## It can be removed if unneeded. In order to work, it requires that
|
||||
## `no_action=None` on the confirm screen so that a second action is optional
|
||||
## (this is the case by default for this template).
|
||||
## You may remove this file without consequence.
|
||||
## See the original Confirm action here:
|
||||
## https://www.renpy.org/doc/html/screen_actions.html#Confirm
|
||||
##
|
||||
## It has three main use cases:
|
||||
## 1) CConfirm("You haven't unlocked this image yet.")
|
||||
## This shows a prompt to the user with the provided text and a
|
||||
## "Confirm" button to dismiss the prompt. There is no "Cancel" button.
|
||||
## 2) CConfirm("Purchase flower? ($10)", SetVariable('money', money-10))
|
||||
## This shows a prompt with Confirm and Cancel buttons. The Confirm
|
||||
## button dismisses the prompt and executes the action or list of
|
||||
## actions provided after the prompt, and Cancel hides the prompt without
|
||||
## executing any other actions.
|
||||
## 3) CConfirm("Go to the next chapter?", yes=Jump("chapter2"), no=MainMenu())
|
||||
## This shows a prompt with Confirm and Cancel buttons. Clicking either
|
||||
## button will dismiss the prompt in addition to performing the provided
|
||||
## yes/no action.
|
||||
##
|
||||
|
||||
init python:
|
||||
|
||||
class CConfirm(Show):
|
||||
"""
|
||||
A class which makes it easy to show simple confirmation prompts
|
||||
to the player.
|
||||
|
||||
It also sets the default value of confirm_selected to True rather
|
||||
than False.
|
||||
"""
|
||||
def __init__(self, prompt, yes=None, no=None, confirm_selected=True,
|
||||
*args, **kwargs):
|
||||
|
||||
if config.confirm_screen and renpy.has_screen('confirm'):
|
||||
screen = "confirm"
|
||||
elif renpy.has_screen("yesno_prompt"):
|
||||
screen = "yesno_prompt"
|
||||
else:
|
||||
screen = None
|
||||
|
||||
# Just a prompt; this only gets a Confirm button which
|
||||
# dismisses the prompt.
|
||||
if yes is None:
|
||||
yes = Hide(screen, config.exit_yesno_transition)
|
||||
no = None
|
||||
else:
|
||||
# All provided actions should hide the confirm screen
|
||||
# after they are clicked
|
||||
if isinstance(yes, list):
|
||||
yes.insert(0, Hide(screen, config.exit_yesno_transition))
|
||||
elif yes != Hide(screen, config.exit_yesno_transition):
|
||||
yes = [Hide(screen, config.exit_yesno_transition), yes]
|
||||
|
||||
# Has both buttons, but "Cancel" should just hide the prompt
|
||||
if no is None:
|
||||
no = Hide(screen, config.exit_yesno_transition)
|
||||
elif no is not None:
|
||||
if isinstance(no, list):
|
||||
no.insert(0, Hide(screen, config.exit_yesno_transition))
|
||||
elif no != Hide(screen, config.exit_yesno_transition):
|
||||
no = [Hide(screen, config.exit_yesno_transition), no]
|
||||
|
||||
self.prompt = prompt
|
||||
self.yes = yes
|
||||
self.no = no
|
||||
self.confirm_selected = confirm_selected
|
||||
self.screen = screen
|
||||
|
||||
super(CConfirm, self).__init__(screen, config.exit_yesno_transition,
|
||||
*args, message=self.prompt, yes_action=self.yes,
|
||||
no_action=self.no, **kwargs)
|
||||
|
||||
def get_sensitive(self):
|
||||
if self.yes is None:
|
||||
return False
|
||||
|
||||
return renpy.is_sensitive(self.yes)
|
||||
|
||||
def get_selected(self):
|
||||
return renpy.is_selected(self.yes)
|
||||
|
||||
def get_tooltip(self):
|
||||
return renpy.display.behavior.get_tooltip(self.yes)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
if self.screen is None:
|
||||
return Confirm(self.prompt, self.yes, self.no, self.confirm_selected)()
|
||||
elif self.confirm_selected or not self.get_selected():
|
||||
return super(CConfirm, self).__call__()
|
||||
else:
|
||||
return renpy.run(self.yes)
|
76
game/optional files/gallery.rpy
Normal file
76
game/optional files/gallery.rpy
Normal file
|
@ -0,0 +1,76 @@
|
|||
## Gallery #####################################################################
|
||||
##
|
||||
## A basic setup for a gallery screen, using Ren'Py's built-in Gallery
|
||||
## system. More information here:
|
||||
## https://www.renpy.org/doc/html/rooms.html#image-gallery
|
||||
##
|
||||
|
||||
init python:
|
||||
|
||||
## First, some constants to speed up declarations
|
||||
|
||||
## The size of gallery buttons/thumbnails
|
||||
gallery_thumb_size = (400, 225)
|
||||
## For convenience's sake: list off all the gallery image
|
||||
## names we're going to use in this gallery
|
||||
gallery_buttons = [
|
||||
'xia_cg_1', 'ashwin_cg_1', 'zoran_cg_1'
|
||||
]
|
||||
|
||||
## Set up the gallery
|
||||
g = Gallery()
|
||||
g.locked_button = Transform("#333", xysize=gallery_thumb_size)
|
||||
|
||||
## And declare the various gallery images
|
||||
## This file doesn't assume the presence of any GUI files, so I'm
|
||||
## just using basic squares, declared as images below, but you will
|
||||
## replace these with actual images.
|
||||
## These use the names declared in the gallery_buttons list
|
||||
g.button("xia_cg_1")
|
||||
g.unlock_image("cg xia1")
|
||||
|
||||
g.button("ashwin_cg_1")
|
||||
g.unlock_image("cg ashwin1")
|
||||
|
||||
g.button("zoran_cg_1")
|
||||
g.unlock_image("cg zoran1")
|
||||
|
||||
## Declarations for the images used in the gallery. May or may not
|
||||
## be needed if you're using Ren'Py's automatic image names.
|
||||
image cg xia1 = Transform("#bd580a", xysize=(config.screen_width, config.screen_height))
|
||||
image cg ashwin1 = Transform("#127151", xysize=(config.screen_width, config.screen_height))
|
||||
image cg zoran1 = Transform("#8157b9", xysize=(config.screen_width, config.screen_height))
|
||||
|
||||
## This is just the button name + _thumb to make it easier to iterate
|
||||
image xia_cg_1_thumb = Transform("#bd580a", xysize=gallery_thumb_size)
|
||||
image ashwin_cg_1_thumb = Transform("#127151", xysize=gallery_thumb_size)
|
||||
image zoran_cg_1_thumb = Transform("#8157b9", xysize=gallery_thumb_size)
|
||||
|
||||
screen gallery():
|
||||
|
||||
tag menu
|
||||
|
||||
add HBox(Transform("#292835", xsize=350), "#21212db2") # The background; can be whatever
|
||||
|
||||
use game_menu(_("Gallery"))
|
||||
|
||||
|
||||
fixed:
|
||||
style_prefix 'gal'
|
||||
## Organize the gallery images into a grid
|
||||
grid 2 2:
|
||||
for btn in gallery_buttons:
|
||||
add g.make_button(btn, "{}_thumb".format(btn))
|
||||
## If you're not using the loop, this will look instead like:
|
||||
# add g.make_button("button_name", "button_thumbnail.png")
|
||||
|
||||
style gal_fixed:
|
||||
yfill True
|
||||
xsize config.screen_width-420
|
||||
align (1.0, 0.5)
|
||||
|
||||
style gal_grid:
|
||||
align (0.5, 0.5)
|
||||
xsize config.screen_width-420
|
||||
ysize config.screen_height-200
|
||||
spacing 50
|
62
game/optional files/mobile_input.rpy
Normal file
62
game/optional files/mobile_input.rpy
Normal file
|
@ -0,0 +1,62 @@
|
|||
## Mobile Input ################################################################
|
||||
##
|
||||
## This is a custom InputValue which does not begin as selected/ready for
|
||||
## input and requires an action to be enabled. Pressing the Enter button
|
||||
## will disable the input again.
|
||||
##
|
||||
## This makes it a good choice for most custom input screens, particularly
|
||||
## on mobile devices where the keyboard can take up most of the screen space.
|
||||
##
|
||||
## As per usual, this file may be removed without consequence.
|
||||
##
|
||||
## Read more about InputValue here:
|
||||
## https://www.renpy.org/doc/html/screen_python.html#inputvalue
|
||||
##
|
||||
init python:
|
||||
|
||||
class EnterInputValue(FieldInputValue):
|
||||
"""
|
||||
Subclass of InputValue which allows the Enter key to dismiss
|
||||
the input button. Does not begin as selected (so, on mobile the
|
||||
keyboard won't immediately appear).
|
||||
"""
|
||||
|
||||
def __init__(self, object, field, default=False):
|
||||
self.object = object
|
||||
self.field = field
|
||||
|
||||
self.default = default
|
||||
|
||||
def enter(self):
|
||||
"""Disable this input when the user presses Enter."""
|
||||
renpy.run(self.Disable())
|
||||
raise renpy.IgnoreEvent()
|
||||
|
||||
default demo_name = "Feniks"
|
||||
|
||||
## An example screen using EnterInputValue
|
||||
screen name_input_screen():
|
||||
|
||||
## The "object" here is `store` since it's a regular store variable.
|
||||
## If the variable was persistent.name, it would use `persistent` instead.
|
||||
default name_input = EnterInputValue(store, 'demo_name')
|
||||
|
||||
add "#601249bb"
|
||||
|
||||
vbox:
|
||||
align (0.5, 0.5)
|
||||
spacing 25
|
||||
button:
|
||||
background "#000b"
|
||||
hover_background "#0003"
|
||||
# Ensure you can type without needing to hover this button
|
||||
key_events True
|
||||
# Enable the input
|
||||
action name_input.Toggle()
|
||||
has hbox
|
||||
spacing 25
|
||||
text "Name:"
|
||||
# The actual input, which uses the EnterInputValue earlier
|
||||
input value name_input
|
||||
|
||||
textbutton "Done" action Return() xalign 0.5
|
21
game/optional files/special_labels.rpy
Normal file
21
game/optional files/special_labels.rpy
Normal file
|
@ -0,0 +1,21 @@
|
|||
## Special Labels ##############################################################
|
||||
##
|
||||
## These are special labels that Ren'Py automatically recognizes if they
|
||||
## are included with the game. Read more here:
|
||||
## https://www.renpy.org/doc/html/label.html#special-labels
|
||||
##
|
||||
|
||||
## Splash Screen ###############################################################
|
||||
##
|
||||
## Put the splash screen code here. It runs when the game is launched.
|
||||
##
|
||||
label splashscreen():
|
||||
return
|
||||
|
||||
## After Load ##################################################################
|
||||
##
|
||||
## Adjust any variables etc in the after_load label
|
||||
## Also consider: define config.after_load_callbacks = [ ... ]
|
||||
##
|
||||
label after_load():
|
||||
return
|
Loading…
Add table
Add a link
Reference in a new issue