From 9a7e251ca941e626d1f6c1fa0c6cfabfe84acc42 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Apr 2022 21:25:32 -0300 Subject: Full support for cutscenes --- game/client.rpy | 7 +++++-- game/core.rpy | 1 + game/renpy.rpy | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/game/client.rpy b/game/client.rpy index 16bda5b..585452d 100644 --- a/game/client.rpy +++ b/game/client.rpy @@ -22,7 +22,7 @@ init 2 python: return f def launch_game(idx): - global progress, responsive, statusmsg, MLP_DEST + global progress, responsive, statusmsg, MLP_DEST, SCR_CUTIN ######################################################################## ## Setup RPCUpdate(persistent.serverlist[idx]["Name"], persistent.serverlist[idx]["Back"]) @@ -79,7 +79,7 @@ init 2 python: ## If it is a new world, show a cutscene try: if auth2["new"]: - renpy.call_in_new_context("intro_"+persistent.serverlist[idx]["Name"].lower().replace(" ", "").replace('"','').replace("'","").replace(':','_')) + SCR_CUTIN=str("intro_"+persistent.serverlist[idx]["Name"].lower().replace(" ", "").replace('"','').replace("'","").replace(':','_')) except: traceback.print_exc() pass @@ -87,6 +87,9 @@ init 2 python: ######################################################################## ## Loop statusmsg="" + # If cutscene, wait + while SCR_CUTIN != "": + sdelay(0.2) try: ## Minimize to tray if set if not renpy.mobile and persistent.iconify: diff --git a/game/core.rpy b/game/core.rpy index 43dfc0a..1e53304 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -239,6 +239,7 @@ default responsive = True default has_steam = False default SCR_PROMPT = None default SCR_RESULT = None +default SCR_CUTIN = "" default MLP_DEST = None default running = False default mySoul = None diff --git a/game/renpy.rpy b/game/renpy.rpy index d90aa48..4ea7a78 100644 --- a/game/renpy.rpy +++ b/game/renpy.rpy @@ -161,6 +161,10 @@ label load_world: progress = 0 # Block the main thread until the socket connection is done while progress < 100: + # Do we get a cutscene? + if SCR_CUTIN: + renpy.call_in_new_context(SCR_CUTIN) + SCR_CUTIN="" if responsive: sdelay() else: -- cgit v1.2.3-70-g09d2