Ejemplo n.º 1
0
 def fill_crests(self, list_of_crest_names):
     """Places the correct crests. Loaded when the screen is called."""
     #First we erase the crests that are there already
     self.crest_box.clear_widgets()
     self.available_crests = []
     ##We read the save in search of the new available crests
     #list_of_crest_names = g.save.crests
     #Then add them to the box and to a parallel list that guard the btn objects
     for name in list_of_crest_names:
         btn = ToggleButton(group='crests')
         btn.name = name
         btn.background_normal = './data/images/crest_' + name + '_no.png'
         btn.background_down = './data/images/crest_' + name + '.png'
         self.crest_box.add_widget(btn)
         self.available_crests.append(btn)
     #Then we align everything right
     self.crest_box.size = (len(list_of_crest_names) * 90, 90)
     if len(list_of_crest_names) == 3:
         self.scroller.pos = (45, self.pos[1])