Exemplo n.º 1
0
 private void RecentGameLoaded(RecentGameInfo gameInfo)
 {
     if (this.Mode == GameScreenMode.RecentGames)
     {
         OnRecentGameLoaded?.Invoke(gameInfo);
     }
     if (this._needResume)
     {
         EmuApi.Resume();
     }
 }
Exemplo n.º 2
0
 private void RecentGameLoaded(RecentGameInfo gameInfo)
 {
     if (this.Mode == GameScreenMode.RecentGames)
     {
         OnRecentGameLoaded?.Invoke(gameInfo);
     }
     if (this._needResume)
     {
         InteropEmu.Resume();
     }
     this.Visible = false;
 }
Exemplo n.º 3
0
        public void Initialize()
        {
            _initialized  = true;
            _recentGames  = new List <RecentGameInfo>();
            _currentIndex = 0;

            foreach (string file in Directory.GetFiles(ConfigManager.RecentGamesFolder, "*.rgd"))
            {
                try {
                    RecentGameInfo info = new RecentGameInfo();
                    ZipArchive     zip  = new ZipArchive(new MemoryStream(File.ReadAllBytes(file)));

                    using (StreamReader sr = new StreamReader(zip.GetEntry("RomInfo.txt").Open())) {
                        info.RomName = sr.ReadLine();
                        info.RomPath = sr.ReadLine();
                    }

                    info.Timestamp = new FileInfo(file).LastWriteTime;
                    info.FileName  = file;

                    if (info.RomPath.Exists)
                    {
                        _recentGames.Add(info);
                    }
                } catch { }
            }

            _recentGames = _recentGames.OrderBy((info) => info.Timestamp).Reverse().ToList();

            if (_recentGames.Count > 36)
            {
                _recentGames.RemoveRange(36, _recentGames.Count - 36);
            }

            InitGrid();

            if (_recentGames.Count == 0)
            {
                this.Visible     = false;
                tmrInput.Enabled = false;
            }
            else
            {
                UpdateGameInfo();
                tmrInput.Enabled = true;
            }

            picPrevGame.Visible = true;
            picNextGame.Visible = true;
        }
Exemplo n.º 4
0
 private void RecentGameLoaded(RecentGameInfo gameInfo)
 {
     OnRecentGameLoaded?.Invoke(gameInfo);
 }