Beispiel #1
0
 def setup_buttons(self):
     self.buttons = [
         ScreenButton('Back', PlannerScreen())
     ]
     for action in self.state.get_actions(self.location):
         members = list(self.state.get_assigned_cast(
             location=self.location, action=action
         ))
         label = action.capitalize()
         if members:
             nl, nlp = self.state.name_list(members)
             label += "({0})".format(nl)
         self.buttons.append(
             ScreenButton(label, ActionScreen(
                 self.state, action, self.location
             ))
         )
Beispiel #2
0
    def setup_buttons(self):
        total = toga.Box(style=Pack(direction=ROW))
        col1 = toga.Box(style=Pack(direction=COLUMN, padding=20))
        col1.add(toga.Label('People to add to this action'))
        col2 = toga.Box(style=Pack(direction=COLUMN, padding=20))
        col2.add(toga.Label('Currently assigned'))
        total.add(col1)
        total.add(col2)
        self.add(total)

        class AssignButton(ScreenButton):
            def __init__(o, name, image):
                o.name = name
                o.image = image
                o.screen = ActionScreen(self.state, self.action, self.location)
                o.box = col1
            
            def click_button(o, widget):
                self.assign(o.image)
                super().click_button(widget)

        class RemoveButton(ScreenButton):
            def __init__(o, name, image):
                o.name = name
                o.image = image
                o.screen = ActionScreen(self.state, self.action, self.location)
                o.box = col2
            
            def click_button(o, widget):
                self.remove_assignment(o.image)
                super().click_button(widget)
    
        self.buttons = [
            ScreenButton('Back', LocationScreen(self.state, self.location))
        ]
        for cast in self.state.get_unassigned_cast():
            self.buttons.append(
                AssignButton(cast['name'], cast['img'])
            )
        for cast in self.state.get_assigned_cast(self.location):
            self.buttons.append(
                RemoveButton(cast['name'], cast['img'])
            )
Beispiel #3
0
    def setup_buttons(self):
        class ProceedButton(ScreenButton):
            def click_button(o, widget):
                screen = MultipleMessageScreen('')
                def lastbutton():
                    return ScreenButton('Next', PlannerScreen())
                screen.lastbutton = lastbutton
                screen.messages = self.state.progress()
                widget.app.set_screen(screen)

        self.buttons = []
        for location in self.state.get_visible_locations():
            self.buttons.append(
                ScreenButton(
                    location['name'] +
                    self.state.get_assigned_actions_msg(location),
                    LocationScreen(self.state, location)
                )
            )
        self.buttons.append(
            ProceedButton("Proceed with assigned actions", None)
        )
Beispiel #4
0
 def lastbutton(self):
     return ScreenButton('Decide', PlannerScreen())
Beispiel #5
0
 def lastbutton(self):
     return ScreenButton('Begin Game', CastNames())
Beispiel #6
0
 def setup_buttons(self):
     self.buttons = [
         ScreenButton("New Game - Intro", Intro()),
         ScreenButton("New Game - No Intro", CastNames()),
         ScreenButton("Load Game", MessageScreen('This is not yet implemented'))
     ]
Beispiel #7
0
 def setup_buttons(self):
     self.buttons = [ScreenButton("Restart", Menu())]
Beispiel #8
0
 def lastbutton():
     return ScreenButton('Next', PlannerScreen())