diff --git a/UWPHook/App.config b/UWPHook/App.config
index c80186b..f9ab9ff 100644
--- a/UWPHook/App.config
+++ b/UWPHook/App.config
@@ -14,7 +14,7 @@
False
-
+
5
@@ -22,6 +22,9 @@
False
+
+
+
diff --git a/UWPHook/GamesWindow.xaml.cs b/UWPHook/GamesWindow.xaml.cs
index 5ea014e..d3abaad 100644
--- a/UWPHook/GamesWindow.xaml.cs
+++ b/UWPHook/GamesWindow.xaml.cs
@@ -148,8 +148,7 @@ namespace UWPHook
private async Task DownloadGridImages(string userId, string appName, string appTarget)
{
- // Generate app id for grid images
- SteamGridDbApi api = new SteamGridDbApi("0973373b2cec3120ce673d06747d506c");
+ SteamGridDbApi api = new SteamGridDbApi(Properties.Settings.Default.SteamGridDbApiKey);
string gridDirectory = userId + @"\\config\\grid\\";
var games = await api.SearchGame(appName);
@@ -267,8 +266,10 @@ namespace UWPHook
Array.Resize(ref shortcuts, shortcuts.Length + 1);
shortcuts[shortcuts.Length - 1] = newApp;
- // TODO: Check if api key setting exist
- await DownloadGridImages(user, app.Name, appTarget);
+ if (!String.IsNullOrEmpty(Properties.Settings.Default.SteamGridDbApiKey))
+ {
+ await DownloadGridImages(user, app.Name, appTarget);
+ }
}
try
diff --git a/UWPHook/Properties/Settings.Designer.cs b/UWPHook/Properties/Settings.Designer.cs
index 7a982ca..fc330f9 100644
--- a/UWPHook/Properties/Settings.Designer.cs
+++ b/UWPHook/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace UWPHook.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -70,5 +70,17 @@ namespace UWPHook.Properties {
this["StreamMode"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string SteamGridDbApiKey {
+ get {
+ return ((string)(this["SteamGridDbApiKey"]));
+ }
+ set {
+ this["SteamGridDbApiKey"] = value;
+ }
+ }
}
}
diff --git a/UWPHook/Properties/Settings.settings b/UWPHook/Properties/Settings.settings
index 6aed1ad..339d33b 100644
--- a/UWPHook/Properties/Settings.settings
+++ b/UWPHook/Properties/Settings.settings
@@ -14,5 +14,8 @@
False
+
+
+
\ No newline at end of file
diff --git a/UWPHook/SettingsWindow.xaml b/UWPHook/SettingsWindow.xaml
index 383fc72..c79692c 100644
--- a/UWPHook/SettingsWindow.xaml
+++ b/UWPHook/SettingsWindow.xaml
@@ -26,9 +26,12 @@
-
-
-
+
+
+
+
+
+
@@ -39,16 +42,19 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UWPHook/SettingsWindow.xaml.cs b/UWPHook/SettingsWindow.xaml.cs
index fabd401..74faae5 100644
--- a/UWPHook/SettingsWindow.xaml.cs
+++ b/UWPHook/SettingsWindow.xaml.cs
@@ -32,6 +32,7 @@ namespace UWPHook
cultures_comboBox.SelectedItem = Properties.Settings.Default.TargetLanguage;
language_toggle.IsChecked = Properties.Settings.Default.ChangeLanguage;
streaming_toggle.IsChecked = Properties.Settings.Default.StreamMode;
+ steamgriddb_api_key.Text = Properties.Settings.Default.SteamGridDbApiKey;
}
private void saveButton_Click(object sender, RoutedEventArgs e)
@@ -40,6 +41,7 @@ namespace UWPHook
Properties.Settings.Default.TargetLanguage = cultures_comboBox.SelectedItem.ToString();
Properties.Settings.Default.Seconds = Int32.Parse(seconds_comboBox.SelectedItem.ToString().Substring(0, 1));
Properties.Settings.Default.StreamMode = (bool)streaming_toggle.IsChecked;
+ Properties.Settings.Default.SteamGridDbApiKey = steamgriddb_api_key.Text;
Properties.Settings.Default.Save();
this.Close();
}