From d85d5d6b2bc3ecc03ad93a5c945b3e49618bbacf Mon Sep 17 00:00:00 2001 From: Black Ram <67595890+BlackRam-oss@users.noreply.github.com> Date: Sat, 20 Jan 2024 10:42:03 +0100 Subject: [PATCH] Update renpy_custom_notify.py --- pythonpackages/renpy_utility/renpy_custom_notify.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pythonpackages/renpy_utility/renpy_custom_notify.py b/pythonpackages/renpy_utility/renpy_custom_notify.py index 61fdad1..be48c65 100644 --- a/pythonpackages/renpy_utility/renpy_custom_notify.py +++ b/pythonpackages/renpy_utility/renpy_custom_notify.py @@ -4,7 +4,7 @@ store.notifications = [] -DEFAULT_NOTIFY_DELAY = 10.0 +DEFAULT_NOTIFY_DELAY = 3.0 __all__ = [ "NotifyEx", @@ -21,7 +21,7 @@ class NotifyEx(renpy.python.RevertableObject): def __init__( self, message: Optional[str], - image: Optional[str], + image: Optional[str] = None, delay: Optional[float] = None, ): super(NotifyEx, self).__init__() @@ -57,7 +57,11 @@ def delay(self, value: Optional[float]): self._delay = value -def notify_add(message: Optional[str] = None, image: Optional[str] = None, delay: Optional[float] = None): +def notify_add( + message: Optional[str] = None, + image: Optional[str] = None, + delay: Optional[float] = None, +): store.notifications.append(NotifyEx(message, image, delay)) if len(store.notifications) == 1: renpy.show_screen("notifyEx") @@ -81,6 +85,5 @@ def notify_remove(value: NotifyEx): def notify(notific: NotifyEx): """View defined notifications.6 to use: $ notify(...)""" - store.notifications.append( - NotifyEx(notific.message, notific.image, notific.delay)) + store.notifications.append(NotifyEx(notific.message, notific.image, notific.delay)) return