This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init python: | |
class Event: | |
def __init__(self, id, name=None, categories=()): | |
self.id = id | |
self.name = name if name is not None else id | |
self.categories = categories | |
define events_list = (Event("intro", _("Arrival in Hogwarts"), {_("General")}), | |
Event("office_prez"), # technical events used as flags | |
Event("first_sleep"), # not displayed in the journal since no category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* variables */ | |
uniform float u_shader_time; | |
uniform vec2 u_wave_period; | |
uniform vec2 u_wave_amp; | |
uniform vec2 u_wave_speed; | |
uniform float u_direction; | |
uniform vec2 u_damp; | |
uniform float u_double; | |
uniform vec3 u_double_params_x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def formatter(s): | |
def replacement(match): | |
pre, bangs, suf = match.group(1, 2, 3) | |
# pre : the part before the first bang | |
# bangs : the bang (if any) and the characters going with it | |
# suf : the colon (if any) and the characters going with it | |
if not bangs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ UNREACHABLE | |
"mmh... yep" | |
init python in reach: | |
start_points = (renpy.ast.EarlyPython, | |
renpy.ast.Init, | |
renpy.ast.Label, | |
renpy.ast.TranslateBlock, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init python hide: | |
renpy.register_shader( | |
"chroma_crt", # https://www.shadertoy.com/view/4dX3zN | |
fragment_functions=""" | |
vec2 uuv(float wp, vec2 tex_coord) | |
{ | |
// squared distance from center | |
vec2 uvv = tex_coord; | |
vec2 dc = 0.5-uvv; | |
dc *= dc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict as OD | |
from operator import itemgetter | |
class OrderedDict(OD): | |
def sort_A(self, *args, **kwargs): | |
""" | |
Sorts the items using sorted(), then calls .update on self with the result. | |
(Problem : doesn't support passing a key function) | |
""" | |
st= sorted(self.items(), key=itemgetter(0), *args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import renpy # type: ignore | |
"""renpy | |
python early: | |
""" | |
import inspect | |
__register_params = frozenset(inspect.signature(renpy.register_statement).parameters) - {"name", "parse", "execute"} | |
global register_decorator | |
def register_decorator(cls): | |
"""A class decorator which registers a new Creator-defined statement. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import renpy # type: ignore | |
from store import register_decorator # type: ignore | |
python_object = object | |
"""renpy | |
python early: | |
""" | |
@register_decorator | |
class RegisterShader(python_object): | |
name = "register shader" | |
init = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import renpy # type: ignore | |
"""renpy | |
init python: | |
""" | |
from timeit import Timer | |
# import parameterinfo # type: ignore | |
# parameterinfo.renpy = renpy |