-
-
Save videlais/c7d96406505e52791e83ef80cd3834c6 to your computer and use it in GitHub Desktop.
Custom Statements
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
python early: | |
def parse_smartline(lex): | |
who = lex.simple_expression() | |
what = lex.rest() | |
return (who, what) | |
def execute_smartline(o): | |
who, what = o | |
renpy.say(eval(who), what) | |
def lint_smartline(o): | |
who, what = o | |
try: | |
eval(who) | |
except: | |
renpy.error("Character not defined: %s" % who) | |
tte = renpy.check_text_tags(what) | |
if tte: | |
renpy.error(tte) | |
renpy.register_statement("line", parse=parse_smartline, execute=execute_smartline, lint=lint_smartline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment