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 @@ - -