Пример #1
0
 def InitRomListPage(self, main_screen):
     self.RomListPage = RomListPage()
     self.RomListPage._Screen = main_screen
     self.RomListPage._Name = self._Emulator["TITLE"]
     self.RomListPage._Emulator = self._Emulator
     self.RomListPage._Parent = self
     self.RomListPage.Init()
Пример #2
0
class MyEmulator(object):

    _Icons = {}
    RomListPage = None
    FavListPage = None
    _Emulator = None

    _FavGID = 31415
    _FavGname = "cpifav"

    def __init__(self):
        self._Icons = {}

    def load_icons(self):
        """
        basepath = os.path.dirname(os.path.realpath(__file__))
        files = os.listdir(basepath+"/icons")
        for i in files:
            if os.path.isfile(basepath+"/"+i) and i.endswith(".png"):
                keyname = i.split(".")[0]
                self._Icons[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha()
        """
        self._Icons["sys"] = MyIconPool._Icons["sys"]

    def InitDeleteConfirmPage(self, main_screen):
        self.DeleteConfirmPage = DeleteConfirmPage()
        self.DeleteConfirmPage._Screen = main_screen
        self.DeleteConfirmPage._Name = "DeleteConfirm"
        self.DeleteConfirmPage.Init()

        self.FavDeleteConfirmPage = FavDeleteConfirmPage()
        self.FavDeleteConfirmPage._Screen = main_screen
        self.FavDeleteConfirmPage._Name = "DeleteConfirm"
        self.FavDeleteConfirmPage.Init()

    def InitFavListPage(self, main_screen):
        self.FavListPage = FavListPage()
        self.FavListPage._Screen = main_screen
        self.FavListPage._Name = "FavouriteGames"
        self.FavListPage._Emulator = self._Emulator
        self.FavListPage._Parent = self

        self.FavListPage.Init()

    def InitRomListPage(self, main_screen):
        self.RomListPage = RomListPage()
        self.RomListPage._Screen = main_screen
        self.RomListPage._Name = self._Emulator["TITLE"]
        self.RomListPage._Emulator = self._Emulator
        self.RomListPage._Parent = self
        self.RomListPage.Init()

    def Init(self, main_screen):
        self.load_icons()
        self.InitDeleteConfirmPage(main_screen)
        self.InitRomListPage(main_screen)
        self.InitFavListPage(main_screen)

    def API(self, main_screen):
        if main_screen != None:
            main_screen.PushCurPage()
            main_screen.SetCurPage(self.RomListPage)
            main_screen.Draw()
            main_screen.SwapAndShow()