コード例 #1
0
ファイル: mainwalk.py プロジェクト: Shildifreak/Shildimon
 def openshildimenu():
     if richtung:
         return
     putofallrichtungen()
     openmenu(menuliste,screen=screen,FULLSCREEN=FULLSCREEN,
              inform="error",title="MCGEM")
     landi.update(force_update=True)
コード例 #2
0
    def mergeitems(edititems):
        print "merge", edititems
        configleser = ConfigParser.ConfigParser()
        options = []
        for ordner in os.listdir(itemimgspath):
            configleser.read(itemimgspath + ordner + sep + "config.cfg")
            l = configleser.defaults()["tiles"].split(",")
            l2 = edititems.values()
            for i in range(5):
                if "None" in l2:
                    l2.remove("None")
            for i in range(len(l2)):
                l2[i] = l2[i][:-1]  # Zahl für Richtung kürzen
            if set(l).symmetric_difference(set(l2)) == set():
                # print configleser.defaults()["name"]
                options.append(configleser.defaults()["name"])
        if options == []:
            return edititems
        menulist = []
        for item in options:
            menulist.append((item, item))
        item = pygame_menuerstellen.openmenu(menulist, closeafterticking=True, screen=screen) + "0"
        pygame.mouse.set_visible(True)
        edititems = {1: "None", 2: "None", 3: "None", 4: "None", 5: item}
        print edititems

        return edititems
コード例 #3
0
 def mergeitems(edititems):
     print "merge",edititems
     configleser = ConfigParser.ConfigParser()
     options=[]
     for ordner in os.listdir(itemimgspath):
         configleser.read(itemimgspath+ordner+sep+"config.cfg")
         l = configleser.defaults()["tiles"].split(",")
         l2 = edititems.values()
         for i in range(5):
             if "None" in l2:
                 l2.remove("None")
         for i in range(len(l2)):
             l2[i]=l2[i][:-1] # Zahl für Richtung kürzen
         if set(l).symmetric_difference(set(l2))==set():
             #print configleser.defaults()["name"]
             options.append(configleser.defaults()["name"])
     if options==[]:
         return edititems
     menulist=[]
     for item in options:
         menulist.append((item,item))
     item = pygame_menuerstellen.openmenu(menulist,
                                          closeafterticking=True,
                                          screen=screen)+"0"
     pygame.mouse.set_visible(True)
     edititems = {1:"None",2:"None",3:"None",4:"None",5:item}
     print edititems
     
     return edititems
コード例 #4
0
 def mergeitems(site):
     edititems = set()
     for x, y, art in site[1].keys():
         if art == "c":
             if site[1][(x, y, art)][1] != {}:
                 for i in site[1][(x, y, art)][1].values():
                     if i != ["None", {}]:
                         return
             if site[1][(x, y, art)][0] != "None":
                 edititems.add(site[1][(x, y, art)][0][:-1])
     if edititems == set():
         return
     configleser = ConfigParser.ConfigParser()
     options = []
     werkzeug = {}
     for ordner in os.listdir(itempath):
         if "." not in ordner:
             configleser.read(itempath + ordner + sep + "config.cfg")
             if configleser.defaults().has_key("tiles"):
                 for tiles in configleser.defaults()["tiles"].split(";"):
                     l = tiles.replace("#", "").split(",")
                     if set(l).symmetric_difference(
                             set(edititems)) == set():
                         options.append(ordner)
                         werkzeug[ordner] = [
                             i.replace("#", "") for i in tiles.split(",")
                             if "#" in i
                         ]
     if options == []:
         return
     menulist = []
     for item in options:
         menulist.append((item, item))
     item = pygame_menuerstellen.openmenu(menulist,
                                          closeafterticking=True,
                                          screen=screen)
     pygame.mouse.set_visible(True)
     if item == None:
         return
     werkzeug = werkzeug.get(item, [])
     for x, y, art in site[1].keys():
         if art == "c":
             #print site[1][(x,y,art)][0][:-1], werkzeug
             if not site[1][(x, y, art)][0][:-1] in werkzeug:
                 if item == None:
                     site[1][(x, y, art)] = ["None", {}]
                 else:
                     site[1][(x, y, art)] = [item + "0", {}]
                     item = None
コード例 #5
0
ファイル: itemfuncs.py プロジェクト: Shildifreak/Shildimon
 def mergeitems(site):
     edititems=set()
     for x,y,art in site[1].keys():
         if art == "c":
             if site[1][(x,y,art)][1] != {}:
                 for i in site[1][(x,y,art)][1].values():
                     if i != ["None",{}]:
                         return
             if site[1][(x,y,art)][0] != "None":
                 edititems.add(site[1][(x,y,art)][0][:-1])
     if edititems==set():
         return
     configleser = ConfigParser.ConfigParser()
     options=[]
     werkzeug={}
     for ordner in os.listdir(itempath):
         if "." not in ordner:
             configleser.read(itempath+ordner+sep+"config.cfg")
             if configleser.defaults().has_key("tiles"):
                 for tiles in configleser.defaults()["tiles"].split(";"):
                     l = tiles.replace("#","").split(",")
                     if set(l).symmetric_difference(set(edititems))==set():
                         options.append(ordner)
                         werkzeug[ordner]=[i.replace("#","") for i in tiles.split(",") if "#" in i]
     if options==[]:
         return
     menulist=[]
     for item in options:
         menulist.append((item,item))
     item = pygame_menuerstellen.openmenu(menulist,
                                          closeafterticking=True,
                                          screen=screen)
     pygame.mouse.set_visible(True)
     if item==None:
         return
     werkzeug=werkzeug.get(item,[])
     for x,y,art in site[1].keys():
         if art == "c":
             #print site[1][(x,y,art)][0][:-1], werkzeug
             if not site[1][(x,y,art)][0][:-1] in werkzeug:
                 if item == None:
                     site[1][(x,y,art)]=["None",{}]
                 else:
                     site[1][(x,y,art)]=[item+"0",{}]
                     item=None