Пример #1
0
    def build(self):
        # get list of capacities
        capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
        # get saved bands
        try:
            personal_record = open("data/MyBands", 'rb')
            band_list = pickle.load(personal_record)
            personal_record.close()
            if len(band_list) == 0:
                band_list = []
        except:
            band_list = []

        # get saved collection
        try:
            personal_record = open("data/MyCollection", 'rb')
            band_collection = pickle.load(personal_record)
            personal_record.close()
        except:
            band_collection = bandcl.Band("")
        car = BattleCarousel()
        band_page = gui_band_pagekv.BandPage(band_list, capa_list, band_collection)
        rules_page = gui_ruleskv.RulePage(capa_list)
        collection_page = gui_collection_pagekv.MyCollectionPage(band_collection, capa_list)
        car.add_widget(band_page)
        car.add_widget(rules_page)
        car.add_widget(collection_page)

        return car
Пример #2
0
 def build(self):
     model = bandcl.Model("Burgh")
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model.set_combat(4)
     model.add_capacity(capa_list[3])
     model.add_capacity(capa_list[38])
     return ModelEditor(model, capa_list)
Пример #3
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     liste = []
     mainwin = SelectPopup(capa_list)
     return mainwin
Пример #4
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     band = bandcl.Band("My Band")
     band.add_model(model1)
     band.add_model(model2)
     page = MyCollectionPage(band, capa_list)
     return page
Пример #5
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     band = bandcl.Band("Les Zinzins")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     band.add_model(model1)
     band.add_model(model2)
     band2 = bandcl.Band("hehe")
     band3 = bandcl.Band("Waaaaagh")
     band2.add_model(model1)
     band3.add_model(model2)
     band_list = [band, band2, band3, band, band2, band3, band, band2, band3]
     page = BandPage(band_list, capa_list)
     return page
Пример #6
0
class GuiModelApp(App):
    models_wid = GridLayout(cols=1, spacing=10, padding=[0, 10, 0, 10], size_hint=[1, None])
    my_mod = bandcl.Model("Barbare")
    ind = 0
    listc = bandcl.load_capacities_from_file("data/list_capa.txt")

    # FONCTION DE TEST
    def add_mdl(self, instance):
        self.my_mod.add_capacity(self.listc[self.ind])
        self.ind += 1
        self.models_wid.add_widget(
            EditModelLayout(self.my_mod))
        self.models_wid.height = self.models_wid.height + 120

    def build(self):
        main_win = ScrollView()
        add_mdl_but = Button(text="Add model...", height=50, size_hint=[1, None], on_press=self.add_mdl)
        self.models_wid.add_widget(add_mdl_but)
        self.models_wid.height = 70
        main_win.add_widget(self.models_wid)
        return main_win
Пример #7
0
 def build(self):
     scroll = ScrollView()
     capacities_list = bandcl.load_capacities_from_file(
         "data/list_capa.txt")
     scroll.add_widget(RulePage(capacities_list))
     return scroll