def initVariables(self):
		self.guiImages = {
			'ICONtext': 'data/icons/text.png',
			'ICONbutton': 'data/icons/button.png',
			'ICONrectangle': 'data/icons/rectangle.png',
			'ICONimage': 'data/icons/image.png',
			'ICONblank': 'data/icons/blank.png',
			'ICONmenu': 'data/icons/menu.png',
			'ICONdeletemenu': 'data/icons/deletemenu.png',
			'ICONaddmenu': 'data/icons/addmenu.png',
			'ICONmoveg': 'data/icons/moveg.png',
			'ICONinvisible': 'data/icons/invisible.png',
			'ICONkeyboard': 'data/icons/keyboard.png',
			'ICONslider': 'data/icons/slider.png',
			'ICONlist': 'data/icons/list.png',
		
		
			'CODgradient': 'data/gradient.png',
		
			'move': 'data/icons/move.png',
			'moveF': 'data/icons/moveF.png',
			'background': 'data/transparent.png',
			'background2': 'data/cod2dx7.png',
			'background3': 'data/cod2dx9.png',
			'nopreview': 'data/nopreview.png',
			'slider': 'data/slider.png',
		}
		self.guiRawImageData = { }
		
		self.MenuManager = menu_manager.MenuManager(self)
Esempio n. 2
0
    def __init__(self, dump=True, dump_size=3600, dump_dir='experience/'):
        self.dump = dump
        self.dump_size = dump_size
        self.dump_dir = dump_dir

        # TODO This might not always be accurate.
        dolphin_dir = os.path.expanduser('~/.local/share/dolphin-emu')

        self.state = ssbm.GameMemory()
        self.sm = state_manager.StateManager([0, 1])
        self.write_locations(dolphin_dir)

        self.fox = fox.Fox()
        self.agent = agent.Agent()
        self.mm = menu_manager.MenuManager()

        try:
            print('Creating MemoryWatcher.')
            self.mw = memory_watcher.MemoryWatcher(
                dolphin_dir + '/MemoryWatcher/MemoryWatcher')
            print('Creating Pad. Open dolphin now.')
            self.pad = pad.Pad(dolphin_dir + '/Pipes/phillip')
            self.initialized = True
        except KeyboardInterrupt:
            self.initialized = False

        self.init_stats()
Esempio n. 3
0
 def setUp(self):
     self.mm = menu_manager.MenuManager()
     self.pad = unittest.mock.MagicMock()
     self.state = state.State()
     self.state.players = []
     for _ in range(4):
         self.state.players.append(p3.state.State())
Esempio n. 4
0
    def reset(self):
        try:
            os.system("killall -s KILL dolphin-emu")
        except:
            pass
        dolphin_dir = find_dolphin_dir()
        if dolphin_dir is None:
            print('Could not find dolphin config dir.')
            return

        self.state = st.State()
        self.sm = state_manager.StateManager(self.state)
        write_locations(dolphin_dir, self.sm.locations())

        self.stats = stat.Stats()

        print('Start dolphin now. Press ^C to stop ')
        from subprocess import Popen
        Popen([
            "dolphin-emu", "--movie=/home/sci/workspace/Athena/falcon.dtm",
            "--exec=/home/sci/Downloads/Super Smash Bros. Melee (USA) (En,Ja) (v1.02).iso"
        ])
        self.mw = memory_watcher.MemoryWatcher(dolphin_dir +
                                               '/MemoryWatcher/MemoryWatcher')
        self.pad = p.Pad(dolphin_dir + '/Pipes/p3')
        #run(state, sm, mw, pad, stats)
        self.mm = menu_manager.MenuManager()
        self.last_frame = self.state.frame
        print(vars(self))
        #        while self.state.frame <= self.last_frame:
        #            self.last_frame = self.state.frame
        #            res = next(self.mw)
        #            if res is not None:
        #                self.sm.handle(*res)
        #               # print (res)
        #        print(vars(self))
        self.stall(0)
        d3 = self.get_data(copy.deepcopy(self.state))
        return d3
Esempio n. 5
0
def load_manager():
    menuManager = menu_manager.MenuManager()
    return menuManager
Esempio n. 6
0
def load_manager():
    menu_manager.MenuManager()
Esempio n. 7
0
def load_manager():
    return menu_manager.MenuManager()