Skip to content

Commit

Permalink
Updated gamelist and added automatic save to games
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezzpify committed Dec 31, 2016
1 parent 80aa766 commit 613c9e2
Show file tree
Hide file tree
Showing 6 changed files with 34,850 additions and 3 deletions.
Binary file modified SingleBoostr/SingleBoostr/.vs/SingleBoostr/v14/.suo
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
<Setting Name="warningdisplayed" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="selectedgames" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
35 changes: 34 additions & 1 deletion SingleBoostr/SingleBoostr/SingleBoostr/mainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void mainForm_Load(object sender, EventArgs e)
#if DEBUG
Properties.Settings.Default.warningdisplayed = false;
#endif

if (Properties.Settings.Default.warningdisplayed)
{
panelLoading.Visible = true;
Expand All @@ -63,7 +63,20 @@ private void mainForm_Load(object sender, EventArgs e)

private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
stopGames();

/*save selected games*/
if (_gameListSelected.Count > 0)
{
Properties.Settings.Default.selectedgames = new System.Collections.Specialized.StringCollection();
foreach (var game in _gameListSelected)
Properties.Settings.Default.selectedgames.Add(game.appId.ToString());

Properties.Settings.Default.Save();
}

Environment.Exit(1);
}

private void btnTosYes_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -484,6 +497,26 @@ private void steamProfileJsonDownloaded(object sender, DownloadStringCompletedEv

private void refreshGameList()
{
/*Check if we have any saved games from last time*/
if (Properties.Settings.Default.selectedgames != null)
{
foreach (var game in Properties.Settings.Default.selectedgames)
{
long gameId = 0;
if (!long.TryParse(game, out gameId) || gameId == 0)
continue;

var obj = _gameList.FirstOrDefault(o => o.appId == gameId);
if (obj != null)
{
_gameListSelected.Add(obj);
_gameList.Remove(obj);
}
}

Properties.Settings.Default.selectedgames = null;
}

_gameList.Sort();
listGames.Items.Clear();
listGamesSelected.Items.Clear();
Expand Down
1 change: 1 addition & 0 deletions SingleBoostr/SingleBoostrGame/SingleBoostrGame/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private static void restInfo(string[] args)
static void Main(string[] args)
{
long appId = 0;
if (args.Length >= 1 && long.TryParse(args[0], out appId))
{
if (appId == 0)
return;
Expand Down
34,803 changes: 34,801 additions & 2 deletions gameList.xml

Large diffs are not rendered by default.

0 comments on commit 613c9e2

Please sign in to comment.