Code: Select all
init python:
class StoryPart(store.object):
def __init__(self, title, labelto, slotgroup, d=False, choosable=True, read=False):
self.labelto = labelto
self.title = title
self.slotgroup = slotgroup
self.read = read
self.d = d
if choosable:
self.givepart()
else:
if d:
storyline.append(self)
else:
self.queue()
def givepart(self):
if self in parts_queue:
parts_queue.remove(self)
parts.append(self)
def queue(self):
parts_queue.append(self)
def swappart(self):
parts.append = storyline[self.slotgroup]
storyline.append[self.slotgroup] = self
parts.remove(self)
renpy.restart_interaction()
def addpart(self, title, labelto, slotgroup, d=False, choosable=True, read=False,):
thispart = StoryPart(title, labelto, slotgroup, d=False, choosable=False, read=False)
screen StoryMenu:
tag menu
modal True
zorder 15
frame:
padding (5,5)
#height 300
#style_group "mailbox"
vbox:
xalign 0.1
spacing 5
label "Parts Available"
text "What shall you choose?" #temp text
vbox:
spacing 20
viewport id "PartsList":
draggable True mousewheel True
vbox:
spacing 20
#style_prefix "radio"
for i in parts:
textbutton "(i.title)" action swappart()
label "Other Parts"
for i in parts_queue:
text "(i.title)" #action swappart()
vbox:
yalign 1.0
label "Story Sections"
vbox:
for i in storyline:
label "i.title"
textbutton "Read Story" action Jump("story")
label start:
$ parts = []
$ parts_queue = []
$ storyline = []
$ addpart("The Cow", "thecow", 0, True)
$ addpart("Stall", "thestall", 1, True)
$ addpart("Hay", "thehay", 2, True)
$ addpart("All", "thatsall", 3, True)
$ addpart("Moose", "themoose", 0, False)
$ addpart("Fred", "fred", 1, False)
$ addpart("Juice", "thejuice", 2, False)
scene bg room
show eileen happy
# These display lines of dialogue.
e "You've created a new Ren'Py game."
hide screen say
show screen StoryMenu
e "Once you add a story, pictures, and music, you can release it to the world!"
# This ends the game.
return
label thecow:
"There once was a cow."
return
label themoose:
"There once was a moose."
return
label thestall:
"He lived in a stall."
return
label fred:
"His name was Fred."
return
label thehay:
"He ate hay."
return
label thejuice:
"He drank juice."
return
label thatsall:
"That's all."
return
label story:
hide screen StoryMenu
e "Your story will go here."
return