Permalink
Browse files

Oops. That's what happens when you merge branches incorrectly. Fixes #6.

  • Loading branch information...
gibbed committed Nov 24, 2017
1 parent 94a92ed commit 97fee70fdb00b008fe1d8d77aa2896190ccdbc7c
Showing with 25 additions and 4 deletions.
  1. +2 −1 SAM.Picker/GamePicker.Designer.cs
  2. +23 −3 SAM.Picker/GamePicker.cs

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -42,6 +42,7 @@ internal partial class GamePicker : Form
private readonly List<GameInfo> _Games;
private readonly List<GameInfo> _FilteredGames;
private int _SelectedGameIndex;
public List<GameInfo> Games
{
@@ -59,6 +60,7 @@ public GamePicker(API.Client client)
{
this._Games = new List<GameInfo>();
this._FilteredGames = new List<GameInfo>();
this._SelectedGameIndex = -1;
this._LogosAttempted = new List<string>();
this._LogoQueue = new ConcurrentQueue<GameInfo>();
@@ -318,14 +320,32 @@ private void OnTimer(object sender, EventArgs e)
this._CallbackTimer.Enabled = true;
}
private void OnSelectGame(object sender, EventArgs e)
private void OnSelectGame(object sender, ListViewItemSelectionChangedEventArgs e)
{
if (this._GameListView.SelectedItems.Count == 0)
if (e.IsSelected == true && e.ItemIndex != this._SelectedGameIndex)
{
this._SelectedGameIndex = e.ItemIndex;
}
else if (e.IsSelected == true && e.ItemIndex == this._SelectedGameIndex)
{
this._SelectedGameIndex = -1;
}
}
private void OnActivateGame(object sender, EventArgs e)
{
if (this._SelectedGameIndex < 0)
{
return;
}
var index = this._SelectedGameIndex;
if (index < 0 || index >= this._FilteredGames.Count)
{
return;
}
var info = this._GameListView.SelectedItems[0].Tag as GameInfo;
var info = this._FilteredGames[index];
if (info == null)
{
return;

0 comments on commit 97fee70

Please sign in to comment.