From 876964efe7088b846db6be226e770f8ca7424ea3 Mon Sep 17 00:00:00 2001 From: cadaei Date: Tue, 24 Dec 2019 23:28:27 +0100 Subject: [PATCH] tweaked fileWatcher. fixed colorUpdating. Tweaked settings info. --- ARKBreedingStats/Form1.cs | 5 +++ ARKBreedingStats/Form1.importExported.cs | 6 +++- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- .../importExported/FileWatcherExports.cs | 6 ++-- .../library/CreatureCollection.cs | 1 + .../settings/Settings.Designer.cs | 30 +++++++++++----- ARKBreedingStats/settings/Settings.resx | 34 ++++++++++++++----- 7 files changed, 62 insertions(+), 22 deletions(-) diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index f7e81855..3d7d2ac2 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -1203,6 +1203,11 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e) timerGlobal.Dispose(); } + /// + /// Sets the text at the top to display infos. + /// + /// + /// private void SetMessageLabelText(string text = "", MessageBoxIcon icon = MessageBoxIcon.None) { lbLibrarySelectionInfo.Text = text; diff --git a/ARKBreedingStats/Form1.importExported.cs b/ARKBreedingStats/Form1.importExported.cs index b8e431dd..0c0fbdda 100644 --- a/ARKBreedingStats/Form1.importExported.cs +++ b/ARKBreedingStats/Form1.importExported.cs @@ -110,8 +110,9 @@ private void ExportedCreatureList_CopyValuesToExtractor(importExported.ExportedC } } - private void ImportExportedAddIfPossible_WatcherThread(string filePath) + private void ImportExportedAddIfPossible_WatcherThread(string filePath, importExported.FileWatcherExports fwe) { + fwe.Watching = false; // wait a moment until the file is readable. why is this necessary? blocked by fileWatcher? System.Threading.Thread.Sleep(200); @@ -119,6 +120,8 @@ private void ImportExportedAddIfPossible_WatcherThread(string filePath) if (File.Exists(filePath)) // filewatcher is on another thread, invoke ui-thread to work with ui Invoke(new Action(delegate () { ImportExportedAddIfPossible(filePath); })); + + fwe.Watching = true; } /// @@ -134,6 +137,7 @@ private void ImportExportedAddIfPossible(string filePath) || (alreadyExists && extractor.validResults)) { AddCreatureToCollection(true, goToLibraryTab: false); + SetMessageLabelText($"Successful {(alreadyExists ? "updated" : "added")} creature of the exported file\n" + filePath); added = true; } diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 8001906b..fe6f1879 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.34.7.2")] +[assembly: AssemblyFileVersion("0.35.0.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/importExported/FileWatcherExports.cs b/ARKBreedingStats/importExported/FileWatcherExports.cs index 217faf63..820b099e 100644 --- a/ARKBreedingStats/importExported/FileWatcherExports.cs +++ b/ARKBreedingStats/importExported/FileWatcherExports.cs @@ -10,15 +10,15 @@ namespace ARKBreedingStats.importExported class FileWatcherExports { private FileSystemWatcher fileWatcherExport; - public FileWatcherExports(string folderToWatch, Action callbackNewFile, bool watching) + public FileWatcherExports(string folderToWatch, Action callbackNewFile, bool watching) { fileWatcherExport = new FileSystemWatcher() { Filter = "*.ini", NotifyFilter = NotifyFilters.LastWrite }; - fileWatcherExport.Created += (sender, e) => callbackNewFile(e.FullPath); - fileWatcherExport.Changed += (sender, e) => callbackNewFile(e.FullPath); + fileWatcherExport.Created += (sender, e) => callbackNewFile(e.FullPath, this); + fileWatcherExport.Changed += (sender, e) => callbackNewFile(e.FullPath, this); SetWatchFolder(folderToWatch, watching); } diff --git a/ARKBreedingStats/library/CreatureCollection.cs b/ARKBreedingStats/library/CreatureCollection.cs index 2b42e2fe..71b5de8d 100644 --- a/ARKBreedingStats/library/CreatureCollection.cs +++ b/ARKBreedingStats/library/CreatureCollection.cs @@ -277,6 +277,7 @@ public bool MergeCreatureList(List creaturesToMerge, bool update = fal old.fatherGuid = creature.fatherGuid; old.fatherName = creature.fatherName; } + old.colors = creature.colors; } if (recalculate) diff --git a/ARKBreedingStats/settings/Settings.Designer.cs b/ARKBreedingStats/settings/Settings.Designer.cs index 29b7bcb3..960d6d83 100644 --- a/ARKBreedingStats/settings/Settings.Designer.cs +++ b/ARKBreedingStats/settings/Settings.Designer.cs @@ -177,6 +177,7 @@ private void InitializeComponent() this.aTExportFolderLocationsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.btAddExportFolder = new System.Windows.Forms.Button(); this.label25 = new System.Windows.Forms.Label(); + this.label29 = new System.Windows.Forms.Label(); this.groupBoxMultiplier.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudWaitBeforeScreenCapture)).BeginInit(); @@ -1621,7 +1622,7 @@ private void InitializeComponent() this.customSCCustom.Location = new System.Drawing.Point(6, 139); this.customSCCustom.Name = "customSCCustom"; this.customSCCustom.Size = new System.Drawing.Size(401, 23); - this.customSCCustom.SoundFile = ""; + this.customSCCustom.SoundFile = null; this.customSCCustom.TabIndex = 7; // // customSCWakeup @@ -1629,7 +1630,7 @@ private void InitializeComponent() this.customSCWakeup.Location = new System.Drawing.Point(6, 81); this.customSCWakeup.Name = "customSCWakeup"; this.customSCWakeup.Size = new System.Drawing.Size(401, 23); - this.customSCWakeup.SoundFile = null; + this.customSCWakeup.SoundFile = ""; this.customSCWakeup.TabIndex = 6; // // customSCBirth @@ -1637,7 +1638,7 @@ private void InitializeComponent() this.customSCBirth.Location = new System.Drawing.Point(6, 110); this.customSCBirth.Name = "customSCBirth"; this.customSCBirth.Size = new System.Drawing.Size(401, 23); - this.customSCBirth.SoundFile = null; + this.customSCBirth.SoundFile = ""; this.customSCBirth.TabIndex = 5; // // customSCStarving @@ -1645,7 +1646,7 @@ private void InitializeComponent() this.customSCStarving.Location = new System.Drawing.Point(6, 52); this.customSCStarving.Name = "customSCStarving"; this.customSCStarving.Size = new System.Drawing.Size(401, 23); - this.customSCStarving.SoundFile = ""; + this.customSCStarving.SoundFile = null; this.customSCStarving.TabIndex = 4; // // label20 @@ -1856,6 +1857,7 @@ private void InitializeComponent() // // groupBox22 // + this.groupBox22.Controls.Add(this.label29); this.groupBox22.Controls.Add(this.cbDeleteAutoImportedFile); this.groupBox22.Controls.Add(this.cbMoveImportedFileToSubFolder); this.groupBox22.Controls.Add(this.label28); @@ -1870,7 +1872,7 @@ private void InitializeComponent() // cbDeleteAutoImportedFile // this.cbDeleteAutoImportedFile.AutoSize = true; - this.cbDeleteAutoImportedFile.Location = new System.Drawing.Point(29, 78); + this.cbDeleteAutoImportedFile.Location = new System.Drawing.Point(32, 100); this.cbDeleteAutoImportedFile.Name = "cbDeleteAutoImportedFile"; this.cbDeleteAutoImportedFile.Size = new System.Drawing.Size(116, 17); this.cbDeleteAutoImportedFile.TabIndex = 3; @@ -1881,7 +1883,7 @@ private void InitializeComponent() // cbMoveImportedFileToSubFolder // this.cbMoveImportedFileToSubFolder.AutoSize = true; - this.cbMoveImportedFileToSubFolder.Location = new System.Drawing.Point(29, 55); + this.cbMoveImportedFileToSubFolder.Location = new System.Drawing.Point(32, 77); this.cbMoveImportedFileToSubFolder.Name = "cbMoveImportedFileToSubFolder"; this.cbMoveImportedFileToSubFolder.Size = new System.Drawing.Size(223, 17); this.cbMoveImportedFileToSubFolder.TabIndex = 2; @@ -1894,9 +1896,9 @@ private void InitializeComponent() this.label28.AutoSize = true; this.label28.Location = new System.Drawing.Point(6, 39); this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(177, 13); + this.label28.Size = new System.Drawing.Size(256, 13); this.label28.TabIndex = 1; - this.label28.Text = "Enable overlay for feedback ingame"; + this.label28.Text = "Enable overlay for feedback about the import ingame"; // // cbAutoImportExported // @@ -1917,7 +1919,7 @@ private void InitializeComponent() this.groupBox21.Size = new System.Drawing.Size(318, 71); this.groupBox21.TabIndex = 8; this.groupBox21.TabStop = false; - this.groupBox21.Text = "Options"; + this.groupBox21.Text = "Auto naming on import"; // // cbCopyPatternNameToClipboard // @@ -2067,6 +2069,15 @@ private void InitializeComponent() this.label25.TabIndex = 0; this.label25.Text = resources.GetString("label25.Text"); // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(6, 58); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(137, 13); + this.label29.TabIndex = 4; + this.label29.Text = "After a successful import do"; + // // Settings // this.AcceptButton = this.buttonOK; @@ -2315,5 +2326,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbAutoImportExported; private System.Windows.Forms.CheckBox cbMoveImportedFileToSubFolder; private System.Windows.Forms.CheckBox cbDeleteAutoImportedFile; + private System.Windows.Forms.Label label29; } } \ No newline at end of file diff --git a/ARKBreedingStats/settings/Settings.resx b/ARKBreedingStats/settings/Settings.resx index db13c6d0..936ba622 100644 --- a/ARKBreedingStats/settings/Settings.resx +++ b/ARKBreedingStats/settings/Settings.resx @@ -122,6 +122,23 @@ It does only work with the resolutions 1920×1080 and 1680×1050, and sometimes does make mistakes. It works with the window-mode "Fullscreen-Windowed" and sometimes does not work when multiple screens are used. + + In ARK you can export a creature (hold use while looking at a creature, then choose "Options" - "Export" from the wheel). + +The exported creatures are saved as a file. Select the folder to import these files. Usually the folder is +...\Steam\steamapps\common\ARK\ShooterGame\Saved\DinoExports\<ID> + +The first entry is the default export folder and is used for 'Import last exported' and the Auto Import. + + + True + + + True + + + 17, 17 + True @@ -144,12 +161,13 @@ If you set the according files below, you can start the process automatically fr 262, 17 - - In ARK you can export a creature (hold use while looking at a creature, then choose "Options" - "Export" from the wheel). - -The exported creatures are saved as a file. Select the folder to import these files. Usually the folder is -...\Steam\steamapps\common\ARK\ShooterGame\Saved\DinoExports\<ID> - -The first entry is the default export folder and is used for 'Import last exported' and the Auto Import. - + + True + + + True + + + 262, 17 + \ No newline at end of file