For the message queue object I have a very simple class:
Code: Select all
init -1 python:
class MessageQueue:
def __init__(self):
self.messages = []
def add_message(self, message):
self.messages.append(message)
def get_message(self):
if self.messages:
return self.messages.pop(0)
else:
return None
Code: Select all
screen create_notification:
$ print("Entering create_notification")
if notification_queue:
$ message = notification_queue.get_message()
if message is not None:
$ print("Message: " + message)
$ renpy.notify(message)
timer 3.0 action Function(lambda: renpy.show_screen("create_notification"))
else:
$ renpy.hide_screen("create_notification")
Entering create_notification
Message: Test Message 1
Entering create_notification
Message: Test Message 2
Entering create_notification
Entering create_notification
The problem I find is that, despite the timer begin in place to delay the call to the screen again, I only see the second test message, as if the Function action is not being delayed at all by the timer.
Since I am unable to place a while loop in the screen (which would really be super useful to have the ability to do), and renpy.pause is not allowed either, I am at a loss as to how to delay the call to the screen aside from a timer.
Any thoughts?