Skip to content

Commit

Permalink
Revert "Remove duplicate say-related functions from 00library."
Browse files Browse the repository at this point in the history
This reverts commit 122dbf2.

Fixes #5409.
  • Loading branch information
renpytom committed Mar 10, 2024
1 parent 32a372a commit 83aecea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions renpy/common/00library.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,24 @@ init -1700 python:
config.expensive_predict_callbacks.append(_predict_screens)


##########################################################################
# Name-only say statements.

# This character is copied when a name-only say statement is called.
name_only = adv

def predict_say(who, what):
who = Character(who, kind=name_only)
try:
who.predict(what)
except Exception:
pass

def say(who, what, interact=True, *args, **kwargs):
who = Character(who, kind=name_only)
who(what, interact=interact, *args, **kwargs)


##########################################################################
# Misc.

Expand Down
6 changes: 4 additions & 2 deletions renpy/defaultstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ def At(d, *args):

kind=False)

# This character is copied when a name-only say statement is called.
name_only = adv
# predict_say and who are defined in 00library.rpy, but we add default
# versions here in case there is a problem with initialization. (And
# for pickling purposes.)


def predict_say(who, what):
Expand All @@ -418,6 +419,7 @@ def say(who, what, interact=True, *args, **kwargs):
who = Character(who, kind=adv)
who(what, *args, interact=interact, **kwargs)


# Used by renpy.reshow_say and extend.
_last_say_who = None
_last_say_what = None
Expand Down

0 comments on commit 83aecea

Please sign in to comment.