2023-02-21 02:53:16 +00:00
|
|
|
python early:
|
|
|
|
def parse_chibi(lexer):
|
|
|
|
who = lexer.simple_expression()
|
|
|
|
action = lexer.simple_expression()
|
|
|
|
|
|
|
|
return (who, action)
|
|
|
|
|
|
|
|
def execute_chibi(parsed_object):
|
|
|
|
print(f"{parsed_object}")
|
|
|
|
who, action = parsed_object
|
|
|
|
func = eval(f"{who[:3]}_chibi_new.{action}")
|
|
|
|
|
|
|
|
print(f"Execution: {who} {action}")
|
|
|
|
|
|
|
|
def lint_chibi(parsed_object):
|
|
|
|
who, action = parsed_object
|
|
|
|
try:
|
|
|
|
chibi = eval(f"{who[:3]}_chibi_new") # TODO: Update naming once testing is done
|
|
|
|
except Exception:
|
|
|
|
renpy.error(f"Character chibi not defined: {who}")
|
|
|
|
|
|
|
|
def predict_chibi(parsed_object):
|
|
|
|
who, action = parsed_object
|
|
|
|
|
|
|
|
chibi = eval(f"{who[:3]}_chibi_new")
|
|
|
|
doll = eval(f"{who}")
|
|
|
|
|
|
|
|
layers = (
|
2023-02-21 20:33:04 +00:00
|
|
|
l[0] for pose in chibi.poses.keys()
|
2023-02-21 02:53:16 +00:00
|
|
|
for k in doll.states.values() if k[0] and k[2]
|
2023-02-21 20:33:04 +00:00
|
|
|
for l in k[0].get_layers(k[0]._hash, subpath=posixpath.join("chibi", pose)).values()
|
2023-02-21 02:53:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
return layers
|
|
|
|
|
|
|
|
renpy.register_statement(
|
|
|
|
name="chibi",
|
|
|
|
parse=parse_chibi,
|
|
|
|
execute=execute_chibi,
|
|
|
|
lint=lint_chibi,
|
|
|
|
predict=predict_chibi,
|
|
|
|
)
|
|
|
|
|
|
|
|
define config.debug_prediction = True
|