diff --git a/game/scripts/utility/common_functions.rpy b/game/scripts/utility/common_functions.rpy index 53e55a2d..6e64d6f5 100644 --- a/game/scripts/utility/common_functions.rpy +++ b/game/scripts/utility/common_functions.rpy @@ -219,3 +219,10 @@ init python early: if match: return int(match.group(1)) return float('inf') # Return a large number for non-numeric keys + + def call_screen_in_new_context(sc_name, *args, **kwargs): + """ + Calls the `sc_name` screen in a new context, passing it *args and **kwargs. + Returns the value returned by the screen, if any. + """ + return renpy.call_in_new_context("call_screen", sc_name, *args, **kwargs) diff --git a/game/scripts/utility/common_labels.rpy b/game/scripts/utility/common_labels.rpy index ca15a815..7bd991cb 100644 --- a/game/scripts/utility/common_labels.rpy +++ b/game/scripts/utility/common_labels.rpy @@ -152,3 +152,8 @@ label end_of_content(): nar "All stats have been maxed out. You can now use all of the wardrobe options." return + +label call_screen(sc_name, *args, **kwargs): + # call call_screen("name", *args, **kwargs) <=> call screen name(*args, **kwargs) + call screen expression sc_name pass (*args, **kwargs) + return _return