private void btn_Browse_Click(object sender, EventArgs e) { using (OpenFileDialog open = new OpenFileDialog()) { open.Filter = "Game Executable Files|*.exe"; if (open.ShowDialog() == DialogResult.OK) { string path = open.FileName; List <GameHandlerMetadata> allGames = gameManager.User.InstalledHandlers; GameList list = new GameList(allGames); DPIManager.ForceUpdate(); if (list.ShowDialog() == DialogResult.OK) { GameHandlerMetadata selected = list.Selected; UserGameInfo game = gameManager.TryAddGame(path, list.Selected); if (game == null) { MessageBox.Show("Game already in your library!"); } else { MessageBox.Show("Game accepted as ID " + game.GameID); RefreshGames(); } } } } }
private void btnSearch_Click(object sender, EventArgs e) { using (OpenFileDialog open = new OpenFileDialog()) { open.Filter = "Game Executable Files|*.exe"; if (open.ShowDialog() == DialogResult.OK) { string path = open.FileName; IGameInfo info = gameManager.GetGame(path); GameList list = new GameList(info); if (list.ShowDialog() == DialogResult.OK) { UserGameInfo game = gameManager.TryAddGame(path, info); if (game == null) { MessageBox.Show("Game already in your library!"); } else { MessageBox.Show("Game accepted as " + game.Game.GameName); RefreshGames(); } } } } }
private void btnSearch_Click(object sender, EventArgs e) { using (OpenFileDialog open = new OpenFileDialog()) { open.Filter = "Game Executable Files|*.exe"; if (open.ShowDialog() == DialogResult.OK) { string path = open.FileName; List <GenericGameInfo> info = gameManager.GetGames(path); if (info.Count > 1) { GameList list = new GameList(info); DPIManager.ForceUpdate(); if (list.ShowDialog() == DialogResult.OK) { UserGameInfo game = gameManager.TryAddGame(path, list.Selected); if (game == null) { MessageBox.Show("Game already in your library!"); } else { MessageBox.Show("Game accepted as " + game.Game.GameName); RefreshGames(); } } } else if (info.Count == 1) { UserGameInfo game = gameManager.TryAddGame(path, info[0]); MessageBox.Show("Game accepted as " + game.Game.GameName); RefreshGames(); } else { MessageBox.Show("Unknown game"); } } } }