Compare commits
No commits in common. "00eda2aae5566fd993ec07bc5dfd738020967995" and "2525bea67d8f10c37f83ec3ff483456fd1facbc0" have entirely different histories.
00eda2aae5
...
2525bea67d
@ -91,8 +91,6 @@ python early hide:
|
||||
chibi = eval(f"{who}_chibi")
|
||||
except Exception:
|
||||
renpy.error(f"Character chibi not defined: {who}")
|
||||
if not hasattr(chibi, action):
|
||||
renpy.error(f"Chibi action not defined: {who} {action}")
|
||||
|
||||
def predict(self):
|
||||
who, action = self
|
||||
@ -144,23 +142,6 @@ python early hide:
|
||||
|
||||
return {"blocks": blocks}
|
||||
|
||||
def lint(self):
|
||||
any_true = False
|
||||
for block, weight, condition in self["blocks"]:
|
||||
if not isinstance(weight, (int, float)):
|
||||
renpy.error(f"Weight must be a number, not {weight!r}")
|
||||
|
||||
if condition == "True":
|
||||
any_true = True
|
||||
else:
|
||||
try:
|
||||
eval(condition)
|
||||
except Exception:
|
||||
renpy.error(f"Condition could not be evaluated: {condition!r}")
|
||||
|
||||
if not any_true:
|
||||
renpy.error("All blocks have a condition, which will raise an exception if all conditions are False at the same time at runtime")
|
||||
|
||||
def next(self):
|
||||
blocks = [(block, weight) for block, weight, condition in self["blocks"] if eval(condition)]
|
||||
total_weight = sum(weight for _, weight in blocks)
|
||||
|
@ -113,7 +113,7 @@ init -1 python:
|
||||
|
||||
# Use a tuple/list to specify the order of layers in a dict
|
||||
self.layers_order = layers
|
||||
self.layers = dict.fromkeys(layers)
|
||||
self.layers = dict([(k, None) for k in layers])
|
||||
|
||||
self.update_callback = update_callback
|
||||
|
||||
@ -124,7 +124,8 @@ init -1 python:
|
||||
|
||||
if actions:
|
||||
# Override class variable for this instance
|
||||
self.actions = Chibi.actions | actions
|
||||
self.actions = dict(Chibi.actions)
|
||||
self.actions.update(actions)
|
||||
|
||||
self.zorder = zorder
|
||||
self.speed = speed # pixels/sec
|
||||
|
Loading…
Reference in New Issue
Block a user