init python:
class Message( renpy.python.RevertableObject ):
def __init__( self, sender, title, message, isImage=False ):
self.sender = sender
self.title = title
self.message = message
self.isImage = isImage
default inbox = []
default outbox = []
screen mail():
default page = "inbox"
default view = "list"
if page == "compose":
[whatever you want]
# Mail list
elif view == "list":
vpgrid:
col 1
if page == "inbox":
for mail in reverse( inbox ):
use mailTitle( mail )
else:
for mail in reverse( outbox ):
use mailTitle( mail )
textbutton "outbox":
action SetScreenVariable( "page", "outbox" )
textbutton "outbox":
action SetScreenVariable( "page", "inbox" )
textbutton "write":
action SetScreenVariable( "page", "compose" )
# read the mail
else:
hbox:
text view.sender
text view.title
if view.isImage:
add view.message
else:
text view.message
textbutton "close":
action SetScreenVariable( "view", "list" )
textbutton "reply":
action [ SetScreenVariable( "view", "list" ), SetScreenVariable( "page", "compose" ) ]
textbutton "quit":
xalign 0.1
yalign 0.9
action Return()
screen mailTitle( mail ):
button:
hbox:
text mail.sender
text mail.title
action SetScreenVariable( "view", mail )
label whatever:
$ inbox.append( Message( "Some Comedian", "[SPAM] Lonely futa in your neighborhood", "Futa need love too, come to our site https://assRavagers.com" )
$ inbox.append( Message( "Some bear lover", "Definitively not a dick pict", "images/mail/Nixon.jpg", isImage=True )
$ outbox.append( Message( "Some grumpy grandpa", "Get out of my lawn !", "And don't make me repeat myself !" )
$ outbox.append( Message( "Some grumpy grandpa", "Re: Definitively not a dick pict", "images/mail/lovely bear.jpg", isImage=True )
call screen mail