From 9ca52755356a90b43679545d6e2423a054cd5ccd Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 17 Dec 2020 23:57:42 -0300 Subject: Remove comments and make server notices survive a whole minute by default. --- game/04_init.rpy | 15 ++++----------- game/screens.rpy | 4 ++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/game/04_init.rpy b/game/04_init.rpy index 482f85e..5593b60 100644 --- a/game/04_init.rpy +++ b/game/04_init.rpy @@ -20,27 +20,19 @@ init python: # FIXME: Drop dead if session_id mismatches (new "token") - # Same as ondata? - # FIXME: onmsg() runs within the thread, not the main app - # This means + # REMINDER: onmsg() runs within the thread, not the main app! def onmsg(self, message): global tr_load, tr_val, tr_busy stdout("Server : " + str(message)) # Wait wait, it might have been a SERVNOTICE! + # TODO: Validate the ServNotice with token or something try: if (message.split(':')[0] == "NOTICE"): - # FIXME - #renpy.notify(str(":".join(message.split(':')[1:]))) display_msgbox(str(":".join(message.split(':')[1:]))) - #raise NotImplemented("You cannot call screens from threads!") - #renpy.call_screen("msgbox", - #renpy.call_in_new_context("msgbox_label", - # "{b}SERVER NOTICE{b}\n\n%s" % str(":".join(message.split(':')[1:]))) return except: - raise - stdout("Error displaying SERVNOTICE") + stdout("Error displaying SERVNOTICE!!") return # Inform whatever is waiting for us that a reply was obtained @@ -93,6 +85,7 @@ init python: # I wonder if I can/should run this in a non-daemon thread? # But I sense the problem is not here but a level above # FIXME: renpy.quit() throws an exception - which in a thread is obviously not gonna work... + # I wonder if we can hack like we did with display_msgbox? Mhm. #renpy.quit(relaunch=True, status=1) except: pass diff --git a/game/screens.rpy b/game/screens.rpy index 4b544bf..6c34baa 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -1419,14 +1419,14 @@ screen notabox(message): textbutton _("Ok") action Hide('notabox') - timer 20.00 action Hide('notabox') + timer 60.00 action Hide('notabox') init python: def display_msgbox(message): """ :doc: other - The default implementation of :func:`renpy.notify`. + Override implementation of :func:`renpy.notify`. """ renpy.hide_screen('notabox') -- cgit v1.2.3-70-g09d2