Skip to content

Commit 613c9e2

Browse files
committed
Updated gamelist and added automatic save to games
1 parent 80aa766 commit 613c9e2

6 files changed

Lines changed: 34850 additions & 3 deletions

File tree

-3 KB
Binary file not shown.

SingleBoostr/SingleBoostr/SingleBoostr/Properties/Settings.Designer.cs

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SingleBoostr/SingleBoostr/SingleBoostr/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
<Setting Name="warningdisplayed" Type="System.Boolean" Scope="User">
66
<Value Profile="(Default)">False</Value>
77
</Setting>
8+
<Setting Name="selectedgames" Type="System.Collections.Specialized.StringCollection" Scope="User">
9+
<Value Profile="(Default)" />
10+
</Setting>
811
</Settings>
912
</SettingsFile>

SingleBoostr/SingleBoostr/SingleBoostr/mainForm.cs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private void mainForm_Load(object sender, EventArgs e)
4343
#if DEBUG
4444
Properties.Settings.Default.warningdisplayed = false;
4545
#endif
46-
46+
4747
if (Properties.Settings.Default.warningdisplayed)
4848
{
4949
panelLoading.Visible = true;
@@ -63,7 +63,20 @@ private void mainForm_Load(object sender, EventArgs e)
6363

6464
private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
6565
{
66+
e.Cancel = true;
6667
stopGames();
68+
69+
/*save selected games*/
70+
if (_gameListSelected.Count > 0)
71+
{
72+
Properties.Settings.Default.selectedgames = new System.Collections.Specialized.StringCollection();
73+
foreach (var game in _gameListSelected)
74+
Properties.Settings.Default.selectedgames.Add(game.appId.ToString());
75+
76+
Properties.Settings.Default.Save();
77+
}
78+
79+
Environment.Exit(1);
6780
}
6881

6982
private void btnTosYes_Click(object sender, EventArgs e)
@@ -484,6 +497,26 @@ private void steamProfileJsonDownloaded(object sender, DownloadStringCompletedEv
484497

485498
private void refreshGameList()
486499
{
500+
/*Check if we have any saved games from last time*/
501+
if (Properties.Settings.Default.selectedgames != null)
502+
{
503+
foreach (var game in Properties.Settings.Default.selectedgames)
504+
{
505+
long gameId = 0;
506+
if (!long.TryParse(game, out gameId) || gameId == 0)
507+
continue;
508+
509+
var obj = _gameList.FirstOrDefault(o => o.appId == gameId);
510+
if (obj != null)
511+
{
512+
_gameListSelected.Add(obj);
513+
_gameList.Remove(obj);
514+
}
515+
}
516+
517+
Properties.Settings.Default.selectedgames = null;
518+
}
519+
487520
_gameList.Sort();
488521
listGames.Items.Clear();
489522
listGamesSelected.Items.Clear();

SingleBoostr/SingleBoostrGame/SingleBoostrGame/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ private static void restInfo(string[] args)
7676
static void Main(string[] args)
7777
{
7878
long appId = 0;
79+
if (args.Length >= 1 && long.TryParse(args[0], out appId))
7980
{
8081
if (appId == 0)
8182
return;

gameList.xml

Lines changed: 34801 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)