Add the call_screen_in_new_context utility function/label
This commit is contained in:
parent
82018cfdad
commit
a9bf2a637e
@ -219,3 +219,10 @@ init python early:
|
|||||||
if match:
|
if match:
|
||||||
return int(match.group(1))
|
return int(match.group(1))
|
||||||
return float('inf') # Return a large number for non-numeric keys
|
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)
|
||||||
|
@ -152,3 +152,8 @@ label end_of_content():
|
|||||||
nar "All stats have been maxed out. You can now use all of the wardrobe options."
|
nar "All stats have been maxed out. You can now use all of the wardrobe options."
|
||||||
|
|
||||||
return
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user