예제 #1
0
 def __init__(self, **kwargs):
     ModalView.__init__(self, size_hint=(.15, 1), pos_hint={'right': 1},
                        **kwargs)
     app = App.get_running_app()
     scroller = ScrollView(do_scroll_x=False)
     layout = StackLayout(padding=[dp(10)], size_hint_y=None)
     layout.height = layout.width * len(app.powerups.purchased)
     for powerup in app.powerups.purchased:
         if not isinstance(powerup, Powerup):
             continue
         if powerup.type == PowerupType.PLAY_CARD:
             if not app.loaded_deck.get_cards(app.powerups.cards()):
                 continue
         layout.add_widget(UsablePowerupIcon(powerup=powerup,
                                             size_hint=(1, None)))
     scroller.add_widget(layout)
     self.add_widget(scroller)