diff --git a/.vs/OpenSaveCloudClient/FileContentIndex/a4e27150-9ef4-42ba-a143-5dc5b727c8fe.vsidx b/.vs/OpenSaveCloudClient/FileContentIndex/a4e27150-9ef4-42ba-a143-5dc5b727c8fe.vsidx deleted file mode 100644 index 5047cd8..0000000 Binary files a/.vs/OpenSaveCloudClient/FileContentIndex/a4e27150-9ef4-42ba-a143-5dc5b727c8fe.vsidx and /dev/null differ diff --git a/.vs/OpenSaveCloudClient/FileContentIndex/b89a2528-5c7e-4956-807b-b5c9481cde0c.vsidx b/.vs/OpenSaveCloudClient/FileContentIndex/b89a2528-5c7e-4956-807b-b5c9481cde0c.vsidx new file mode 100644 index 0000000..f8b0da5 Binary files /dev/null and b/.vs/OpenSaveCloudClient/FileContentIndex/b89a2528-5c7e-4956-807b-b5c9481cde0c.vsidx differ diff --git a/.vs/OpenSaveCloudClient/FileContentIndex/c5381d0b-5965-49f8-b118-b6bbc6639102.vsidx b/.vs/OpenSaveCloudClient/FileContentIndex/c5381d0b-5965-49f8-b118-b6bbc6639102.vsidx new file mode 100644 index 0000000..f053cf9 Binary files /dev/null and b/.vs/OpenSaveCloudClient/FileContentIndex/c5381d0b-5965-49f8-b118-b6bbc6639102.vsidx differ diff --git a/OpenSaveCloudClient/AddGameForm.Designer.cs b/OpenSaveCloudClient/AddGameForm.Designer.cs index 5a961e6..10665a0 100644 --- a/OpenSaveCloudClient/AddGameForm.Designer.cs +++ b/OpenSaveCloudClient/AddGameForm.Designer.cs @@ -28,7 +28,6 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddGameForm)); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); @@ -42,7 +41,6 @@ this.NoCoverLabel = new System.Windows.Forms.Label(); this.CoverPicture = new System.Windows.Forms.PictureBox(); this.AddButton = new System.Windows.Forms.Button(); - this.timer1 = new System.Windows.Forms.Timer(this.components); this.PathErrorLabel = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -201,11 +199,6 @@ this.AddButton.UseVisualStyleBackColor = true; this.AddButton.Click += new System.EventHandler(this.button1_Click); // - // timer1 - // - this.timer1.Interval = 350; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // // PathErrorLabel // this.PathErrorLabel.AutoSize = true; @@ -259,7 +252,6 @@ private Label label2; private Label NoCoverLabel; private PictureBox CoverPicture; - private System.Windows.Forms.Timer timer1; private Label NameWarningLabel; private Label PathErrorLabel; } diff --git a/OpenSaveCloudClient/AddGameForm.cs b/OpenSaveCloudClient/AddGameForm.cs index 1a53a7d..50696c6 100644 --- a/OpenSaveCloudClient/AddGameForm.cs +++ b/OpenSaveCloudClient/AddGameForm.cs @@ -1,6 +1,4 @@ -using IGDB; -using IGDB.Models; -using OpenSaveCloudClient.Core; +using OpenSaveCloudClient.Core; using OpenSaveCloudClient.Models; using System; using System.Collections.Generic; @@ -16,72 +14,21 @@ namespace OpenSaveCloudClient { public partial class AddGameForm : Form { - - private readonly IGDBClient? _client; private GameSave result; private SaveManager saveManager; public GameSave Result { get { return result; } } - public AddGameForm(IGDBClient? iGDBClient) + public AddGameForm() { InitializeComponent(); - _client = iGDBClient; saveManager = SaveManager.GetInstance(); - if (_client == null) - { - NoCoverLabel.Text = "IGDB is not configured"; - } - else - { - NoCoverLabel.Visible = false; - } - } - - private async void timer1_Tick(object sender, EventArgs e) - { - timer1.Stop(); - if (_client != null) - { - NoCoverLabel.Visible = false; - CoverPicture.Visible = true; - if (!string.IsNullOrWhiteSpace(NameBox.Text)) - { - try - { - string query = string.Format("fields *; search \"{0}\";", NameBox.Text.Replace("\"", "")); - Game[] games = await _client.QueryAsync(IGDBClient.Endpoints.Games, query: query); - games = games.Where(g => g.Cover != null && g.Cover.Value != null).ToArray(); - if (games.Length > 0) - { - Game game = games.First(); - CoverPicture.LoadAsync(game.Cover.Value.Url); - } - else - { - CoverPicture.Visible = false; - NoCoverLabel.Text = "No cover found"; - NoCoverLabel.Visible = true; - } - } - catch (Exception ex) - { - CoverPicture.Visible = false; - NoCoverLabel.Text = ex.Message; - NoCoverLabel.Visible = true; - } - } - } + NoCoverLabel.Text = "IGDB is not configured"; } private void NameBox_TextChanged(object sender, EventArgs e) { NameWarningLabel.Visible = saveManager.Saves.Exists(g => g.Name == NameBox.Text); - if (_client != null) - { - timer1.Stop(); - timer1.Start(); - } } private void pathButton_Click(object sender, EventArgs e) diff --git a/OpenSaveCloudClient/AddGameForm.resx b/OpenSaveCloudClient/AddGameForm.resx index 543da25..5c4c12c 100644 --- a/OpenSaveCloudClient/AddGameForm.resx +++ b/OpenSaveCloudClient/AddGameForm.resx @@ -57,9 +57,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - diff --git a/OpenSaveCloudClient/GameLibraryForm.cs b/OpenSaveCloudClient/GameLibraryForm.cs index abdb4d0..cac86fb 100644 --- a/OpenSaveCloudClient/GameLibraryForm.cs +++ b/OpenSaveCloudClient/GameLibraryForm.cs @@ -1,6 +1,5 @@ using OpenSaveCloudClient.Models; using OpenSaveCloudClient.Core; -using IGDB; using OpenSaveCloudClient.Models.Remote; namespace OpenSaveCloudClient @@ -9,7 +8,6 @@ namespace OpenSaveCloudClient { private readonly Configuration _configuration; - //private readonly IGDBClient? _client; private readonly SaveManager saveManager; private readonly TaskManager taskManager; private readonly ServerConnector serverConnector; @@ -28,12 +26,6 @@ namespace OpenSaveCloudClient listViewContextMenu = new ContextMenuStrip(); listViewContextMenu.Items.Add("Delete from server").Click += contextMenuDeleteFromServer_Click; listViewContextMenu.Items.Add("Remove from local library").Click += contextMenuRemoveFromLocalLibrary_Click; - /*if (_configuration.GetBoolean("igdb.enabled", false)) - { - string clientId = _configuration.GetString("igdb.client_id", ""); - string clientSecret = _configuration.GetString("igdb.client_secret", ""); - _client = new IGDBClient(clientId, clientSecret); - }*/ } private void GameLibrary_Load(object sender, EventArgs e) @@ -172,7 +164,7 @@ namespace OpenSaveCloudClient private void AddButton_Click(object sender, EventArgs e) { - AddGameForm form = new(/*_client*/ null); + AddGameForm form = new(); if (form.ShowDialog() == DialogResult.OK) { GameSave newGame = form.Result; ThreadPool.QueueUserWorkItem(delegate { AddGameToLibrary(newGame); }); diff --git a/OpenSaveCloudClient/OpenSaveCloudClient.csproj b/OpenSaveCloudClient/OpenSaveCloudClient.csproj index 3ef2b28..2de5c25 100644 --- a/OpenSaveCloudClient/OpenSaveCloudClient.csproj +++ b/OpenSaveCloudClient/OpenSaveCloudClient.csproj @@ -2,15 +2,35 @@ WinExe - net6.0-windows10.0.22000.0 + net6.0-windows10.0.22621.0 enable true enable - 8.0 + 10.0.17763.0 x64 logo.png logo.ico AnyCPU;x64 + True + D:\keyPair.snk + 6.0-all + 1.0.1 + + + + none + + + + none + + + + none + + + + none @@ -18,7 +38,6 @@ - @@ -28,6 +47,11 @@ True Resources.resx + + True + True + Settings.settings + @@ -42,6 +66,10 @@ True \ + + SettingsSingleFileGenerator + Settings.Designer.cs + \ No newline at end of file diff --git a/OpenSaveCloudClient/Properties/Settings.Designer.cs b/OpenSaveCloudClient/Properties/Settings.Designer.cs new file mode 100644 index 0000000..934c4a7 --- /dev/null +++ b/OpenSaveCloudClient/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OpenSaveCloudClient.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/OpenSaveCloudClient/Properties/Settings.settings b/OpenSaveCloudClient/Properties/Settings.settings new file mode 100644 index 0000000..049245f --- /dev/null +++ b/OpenSaveCloudClient/Properties/Settings.settings @@ -0,0 +1,6 @@ + + + + + +