Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-18 22:18:15 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-18 22:18:38 +0300
commitcbe2e9d21d3f16b2f9068d4ebfa4b8a8fb8c966b (patch)
tree1c4c9220e1c6455c8ae90b1281c5e05fca116abc /SelectModsForm.cs
parent84503d3af44292d12e80942b22c9f5d6babd85e6 (diff)
More drag&drop
Diffstat (limited to 'SelectModsForm.cs')
-rw-r--r--SelectModsForm.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/SelectModsForm.cs b/SelectModsForm.cs
index 5b12955e..06c45478 100644
--- a/SelectModsForm.cs
+++ b/SelectModsForm.cs
@@ -15,7 +15,7 @@ namespace com.clusterrr.hakchi_gui
private readonly string usermodsDirectory;
private readonly string[] readmeFiles;
- public SelectModsForm(bool loadInstalledMods, bool allowDropMods)
+ public SelectModsForm(bool loadInstalledMods, bool allowDropMods, string[] filesToAdd = null)
{
InitializeComponent();
baseDirectory = MainForm.BaseDirectory;
@@ -52,10 +52,10 @@ namespace com.clusterrr.hakchi_gui
readmeFiles = new string[] { "readme.txt", "readme.md", "readme" };
checkedListBoxMods.Items.Clear();
checkedListBoxMods.Items.AddRange(modsList.ToArray());
+ if (filesToAdd != null) AddMods(filesToAdd);
this.AllowDrop = allowDropMods;
}
-
private void buttonOk_Click(object sender, EventArgs e)
{
if (checkedListBoxMods.CheckedItems.Count > 0)
@@ -148,7 +148,12 @@ namespace com.clusterrr.hakchi_gui
private void SelectModsForm_DragDrop(object sender, DragEventArgs e)
{
- var files = (string[])e.Data.GetData(DataFormats.FileDrop);
+ var files = (string[])e.Data.GetData(DataFormats.FileDrop);
+ AddMods(files);
+ }
+
+ private void AddMods(string[] files)
+ {
var listAddedMods = new List<string>();
foreach (var file in files)
{