Ejemplo n.º 1
0
 def preload(self):
     #debug overrides
     #startingmap = 'map1'#'map3'#'map2'#'map1'
     ##init
     self.F_options = MEGA.mega2('Data\\Configuration.MEGA')  ##init options
     smap = self.F_options.fetch(
         'OPTIONS.txt')  ##get map options before map load
     #print(self.F_options.fetch('OPTIONS.txt'))
     #input(smap)
     self.currentmap_data = Class_maphandler.maphandler(
         smap[0].split(' = ')[1])  #(startingmap)
     self.currentmap_data.PS_BGM(True)
     ##sfx setup
     self.soundhandler_SFX.LoadSND('HS_SE_000.wav', 0)  #testing
Ejemplo n.º 2
0
    def __init__(self,mapfile):
        self.clear()
        ##cpyd from  mega
        if mapfile[-5:].upper() == '.MEGA':
            print('is')
        else:
            mapfile+='.MEGA'
        ##

        if os.path.isfile(self.mpath+mapfile):
            self.name = mapfile
            
            self.data_mega = MEGA.mega2(self.mpath+mapfile)
            ##processing
            self.mega_process()
            self.process_collision()
        else:
            print('LOG /maphandler- no file specified or bad file given')
            print('________________ file given - '+str(self.mpath+mapfile))
Ejemplo n.º 3
0
def readfile(fname):
    try:
        f = open(fname, 'r')
        data = f.readlines()
        f.close()
    except:
        try:
            f.close()
        except:
            print('error/file already closed!')
    return data


os.chdir('Main_data')
m = MEGA.mega2('DATA.MEGA')
ford = readfile('MEGAORDER.txt')
##for y in range(len(ford)):
##    ford[y] = ford[y].strip('\n')
ford = ford[0].strip('\n')
print(ford)
ford = csv2array(ford)

for x in range(len(ford)):
    dat = readfile(ford[x])
    for y in range(len(dat)):
        dat[y] = dat[y].strip('\n')
    m.adddata([ford[x], dat])
m.save()

print('parsetest')