Browse Source

pre alpha

Krypt0n 1 year ago
parent
commit
0fce374477

+ 7 - 7
FactorioModManager.sln

@@ -1,9 +1,9 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
-VisualStudioVersion = 16.0.28803.202
+VisualStudioVersion = 16.0.30711.63
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorioModManager", "FactorioModManager\FactorioModManager.csproj", "{7B1956A7-B7BD-447F-BF88-65453988E31C}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorioModManager", "FactorioModManager\FactorioModManager.csproj", "{3E47CDF5-3320-4F37-B577-B678A958BAAD}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,15 +11,15 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{7B1956A7-B7BD-447F-BF88-65453988E31C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7B1956A7-B7BD-447F-BF88-65453988E31C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7B1956A7-B7BD-447F-BF88-65453988E31C}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7B1956A7-B7BD-447F-BF88-65453988E31C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3E47CDF5-3320-4F37-B577-B678A958BAAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3E47CDF5-3320-4F37-B577-B678A958BAAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3E47CDF5-3320-4F37-B577-B678A958BAAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3E47CDF5-3320-4F37-B577-B678A958BAAD}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {4E363F65-4B63-4792-B54B-E4DF1CC1B206}
+		SolutionGuid = {B7E1B2B9-E275-42A0-A0C8-ECE7647EDD81}
 	EndGlobalSection
 EndGlobal

+ 53 - 0
FactorioModManager/Account.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FactorioModManager
+{
+    public class Account
+    {
+        public string Username { get; set; } = "";
+        public string Password { get; set; } = "";
+
+        public Account()
+        {
+
+        }
+
+        public Account(string Username,string Password)
+        {
+            this.Username = Username;
+            this.Password = Password;
+        }
+
+        public static Account FromString(string str)
+        {
+            string username = str.Substring(0,str.IndexOf('@'));
+            string saltedpassword = str.Substring(str.IndexOf('@') + 1);
+            return new Account()
+            {
+                Username = username,
+                Password = ApplySalt(saltedpassword)
+            };
+        }
+        public override string ToString()
+        {
+            return Username + "@" + ApplySalt(Password);
+        }
+
+        private static string ApplySalt(string password)
+        {
+            byte[] bytes = Encoding.UTF8.GetBytes(password);
+            for (int i = 0; i < bytes.Length; i++)
+            {
+                bytes[i] = (byte)(bytes[i] ^ 0x42);
+            }
+
+            string result = Encoding.UTF8.GetString(bytes);
+
+            return result;
+        }
+    }
+}

+ 142 - 0
FactorioModManager/F_API.cs

@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using Newtonsoft.Json.Linq;
+using System.Threading.Tasks;
+
+namespace FactorioModManager
+{
+    public class F_API
+    {
+
+        public class ModInfo
+        {
+            public string Name { get; }
+            public string Title { get; }
+            public string Owner { get; }
+            public string Summary { get; }
+            public int DownloadsCout { get; }
+
+            public class LastestRelease
+            {
+                public string DownloadURL { get; }
+                public string FileName { get; }
+                public Version FactorioVersion { get; }
+                public Version Version { get; }
+
+                public LastestRelease(JObject json)
+                {
+                    if (json.ContainsKey("download_url")) DownloadURL = (string)json["download_url"];
+                    if (json.ContainsKey("file_name")) FileName = (string)json["file_name"];
+                    if (json.ContainsKey("version")) Version = new Version((string)json["version"]);
+                    if (json.ContainsKey("info_json"))
+                    {
+                        FactorioVersion = new Version((string)json["info_json"]["factorio_version"]);
+                    }
+                }
+            }
+
+            public ModInfo(JObject json)
+            {
+                if (json.ContainsKey("name")) Name = (string)json["name"];
+                if (json.ContainsKey("title")) Title = (string)json["title"];
+                if (json.ContainsKey("owner")) Owner = (string)json["owner"];
+                if (json.ContainsKey("downloads_count")) DownloadsCout = (int)json["downloads_count"];
+                if (json.ContainsKey("summary")) Summary = (string)json["summary"];
+            }
+        }
+
+
+        private static readonly string auth_link = "https://auth.factorio.com/api-login";
+        private static readonly string mod_link = "https://mods.factorio.com/api/mods/";
+        private readonly HttpClient client = new HttpClient();
+
+        public delegate void OnConnected(bool success);
+
+        public OnConnected Connected { get; set; }
+
+        private string token = null;
+
+        public bool IsConnected { get { return !String.IsNullOrEmpty(token); } }
+        public Account Account { get; set; }
+
+        public F_API()
+        {
+
+        }
+
+        public F_API(Account account)
+        {
+            Account = account;
+        }
+
+        public bool Connect()
+        {
+            token = null;
+            Dictionary<string,string> values = new Dictionary<string, string>
+            {
+                {"username", Account.Username },
+                {"password",Account.Password }
+            };
+
+            FormUrlEncodedContent content = new FormUrlEncodedContent(values);
+
+            HttpResponseMessage response = client.PostAsync(auth_link, content).Result;
+
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
+            {
+                JArray arr = JArray.Parse(response.Content.ReadAsStringAsync().Result);
+                token = (string)arr[0];
+                Connected?.Invoke(true);
+                return true;
+            }
+            else
+            {
+                Connected?.Invoke(false);
+                return false;
+            }
+        }
+
+        public List<ModWorker.Mod> Search(string Name=null)
+        {
+            bool IsURL = false;
+            List<ModWorker.Mod> result = new List<ModWorker.Mod>();
+            try
+            {
+                Uri uri = new Uri(Name);
+                HttpResponseMessage message = client.GetAsync(Name).Result;
+                if (message.StatusCode == System.Net.HttpStatusCode.OK) IsURL = true;
+            }
+            catch { }
+            if (IsURL)
+            {
+                //TODO
+            }
+            else
+            {
+                if (Name == null) Name = "";
+                HttpResponseMessage message = client.GetAsync(mod_link+Name).Result;
+                if (message.StatusCode == System.Net.HttpStatusCode.OK)
+                {
+                    JObject json = JObject.Parse(message.Content.ReadAsStringAsync().Result);
+                    if (json.ContainsKey("results"))
+                    {
+                        JArray mods = (JArray)json["results"];
+                        for (int i= 0; i < mods.Count;i++)
+                        {
+
+                        }
+                    }
+                    else
+                    {
+                        //TODO
+                    }
+                }
+            }
+
+            return result;
+        }
+    }
+}

+ 22 - 26
FactorioModManager/FactorioModManager.csproj

@@ -4,12 +4,13 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{7B1956A7-B7BD-447F-BF88-65453988E31C}</ProjectGuid>
+    <ProjectGuid>{3E47CDF5-3320-4F37-B577-B678A958BAAD}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <RootNamespace>FactorioModManager</RootNamespace>
     <AssemblyName>FactorioModManager</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <Deterministic>true</Deterministic>
     <TargetFrameworkProfile />
   </PropertyGroup>
@@ -22,7 +23,6 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,52 +32,46 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="DotNetZip, Version=1.13.3.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
-      <HintPath>..\packages\DotNetZip.1.13.3\lib\net40\DotNetZip.dll</HintPath>
-    </Reference>
-    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
-      <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
+    <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
+    </Reference>
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="AuthForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="AuthForm.Designer.cs">
-      <DependentUpon>AuthForm.cs</DependentUpon>
-    </Compile>
+    <Compile Include="Account.cs" />
     <Compile Include="Form1.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="Form1.Designer.cs">
       <DependentUpon>Form1.cs</DependentUpon>
     </Compile>
-    <Compile Include="mod-list.cs" />
-    <Compile Include="ModInfo.cs" />
+    <Compile Include="F_API.cs" />
+    <Compile Include="LanguageManager.cs" />
+    <Compile Include="ModWorker.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="SettingsForm.cs">
+    <Compile Include="Settings.cs" />
+    <Compile Include="Settings_Form.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="SettingsForm.Designer.cs">
-      <DependentUpon>SettingsForm.cs</DependentUpon>
+    <Compile Include="Settings_Form.Designer.cs">
+      <DependentUpon>Settings_Form.cs</DependentUpon>
     </Compile>
-    <EmbeddedResource Include="AuthForm.resx">
-      <DependentUpon>AuthForm.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
@@ -91,10 +85,9 @@
       <DependentUpon>Resources.resx</DependentUpon>
       <DesignTime>True</DesignTime>
     </Compile>
-    <EmbeddedResource Include="SettingsForm.resx">
-      <DependentUpon>SettingsForm.cs</DependentUpon>
+    <EmbeddedResource Include="Settings_Form.resx">
+      <DependentUpon>Settings_Form.cs</DependentUpon>
     </EmbeddedResource>
-    <None Include="app.config" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
@@ -106,5 +99,8 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 598 - 200
FactorioModManager/Form1.Designer.cs

@@ -1,4 +1,5 @@
-namespace FactorioModManager
+
+namespace FactorioModManager
 {
     partial class Form1
     {
@@ -29,240 +30,610 @@
         private void InitializeComponent()
         {
             this.menuStrip1 = new System.Windows.Forms.MenuStrip();
-            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.exportOfflineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.exportOnlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.importOfflineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.importOnlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.exportModPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
+            this.changeSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
-            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.connectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.modsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.downloadModToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
-            this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
-            this.enabled = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.NameMod = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.exportSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.importSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
-            this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
-            this.backgroundLoadInfo = new System.ComponentModel.BackgroundWorker();
-            this.backgroundUpdateMods = new System.ComponentModel.BackgroundWorker();
             this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.button5 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.linkLabel2 = new System.Windows.Forms.LinkLabel();
+            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
+            this.button4 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.listView2 = new System.Windows.Forms.ListView();
+            this.label17 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.listView1 = new System.Windows.Forms.ListView();
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.listView3 = new System.Windows.Forms.ListView();
+            this.button1 = new System.Windows.Forms.Button();
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.menuStrip1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.statusStrip1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
             // menuStrip1
             // 
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.fileToolStripMenuItem,
-            this.connectionToolStripMenuItem,
-            this.modsToolStripMenuItem});
+            this.toolStripMenuItem1,
+            this.toolStripMenuItem2});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(800, 24);
+            this.menuStrip1.Size = new System.Drawing.Size(940, 24);
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
-            // fileToolStripMenuItem
+            // toolStripMenuItem1
             // 
-            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.exportToolStripMenuItem,
-            this.importToolStripMenuItem,
-            this.toolStripSeparator1,
-            this.exitToolStripMenuItem});
-            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
-            this.fileToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
-            this.fileToolStripMenuItem.Text = "Файл";
-            // 
-            // exportToolStripMenuItem
-            // 
-            this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.exportOfflineToolStripMenuItem,
-            this.exportOnlineToolStripMenuItem});
-            this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
-            this.exportToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
-            this.exportToolStripMenuItem.Text = "Экспорт";
-            // 
-            // exportOfflineToolStripMenuItem
+            this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.exportModPackToolStripMenuItem});
+            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(113, 20);
+            this.toolStripMenuItem1.Tag = "$File";
+            this.toolStripMenuItem1.Text = "toolStripMenuItem1";
             // 
-            this.exportOfflineToolStripMenuItem.Name = "exportOfflineToolStripMenuItem";
-            this.exportOfflineToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
-            this.exportOfflineToolStripMenuItem.Text = "Экспорт оффлайн";
+            // exportModPackToolStripMenuItem
             // 
-            // exportOnlineToolStripMenuItem
+            this.exportModPackToolStripMenuItem.Name = "exportModPackToolStripMenuItem";
+            this.exportModPackToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
+            this.exportModPackToolStripMenuItem.Tag = "$ExportModPack";
+            this.exportModPackToolStripMenuItem.Text = "ExportModPack";
             // 
-            this.exportOnlineToolStripMenuItem.Name = "exportOnlineToolStripMenuItem";
-            this.exportOnlineToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
-            this.exportOnlineToolStripMenuItem.Text = "Экспорт онлайн";
+            // toolStripMenuItem2
             // 
-            // importToolStripMenuItem
-            // 
-            this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.importOfflineToolStripMenuItem,
-            this.importOnlineToolStripMenuItem});
-            this.importToolStripMenuItem.Name = "importToolStripMenuItem";
-            this.importToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
-            this.importToolStripMenuItem.Text = "Импорт";
-            // 
-            // importOfflineToolStripMenuItem
-            // 
-            this.importOfflineToolStripMenuItem.Name = "importOfflineToolStripMenuItem";
-            this.importOfflineToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
-            this.importOfflineToolStripMenuItem.Text = "Импорт оффлайн";
+            this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.changeSettingsToolStripMenuItem,
+            this.toolStripSeparator1,
+            this.exportSettingsToolStripMenuItem,
+            this.importSettingsToolStripMenuItem});
+            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(113, 20);
+            this.toolStripMenuItem2.Tag = "$Settings";
+            this.toolStripMenuItem2.Text = "toolStripMenuItem2";
             // 
-            // importOnlineToolStripMenuItem
+            // changeSettingsToolStripMenuItem
             // 
-            this.importOnlineToolStripMenuItem.Name = "importOnlineToolStripMenuItem";
-            this.importOnlineToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
-            this.importOnlineToolStripMenuItem.Text = "Импорт онлайн";
+            this.changeSettingsToolStripMenuItem.Name = "changeSettingsToolStripMenuItem";
+            this.changeSettingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.changeSettingsToolStripMenuItem.Tag = "$ChangeSettings";
+            this.changeSettingsToolStripMenuItem.Text = "Change settings";
+            this.changeSettingsToolStripMenuItem.Click += new System.EventHandler(this.changeSettingsToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(116, 6);
-            // 
-            // exitToolStripMenuItem
-            // 
-            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
-            this.exitToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
-            this.exitToolStripMenuItem.Text = "Выход";
-            this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click);
-            // 
-            // connectionToolStripMenuItem
-            // 
-            this.connectionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.connectToolStripMenuItem});
-            this.connectionToolStripMenuItem.Name = "connectionToolStripMenuItem";
-            this.connectionToolStripMenuItem.Size = new System.Drawing.Size(97, 20);
-            this.connectionToolStripMenuItem.Text = "Подключение";
-            // 
-            // connectToolStripMenuItem
-            // 
-            this.connectToolStripMenuItem.Name = "connectToolStripMenuItem";
-            this.connectToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
-            this.connectToolStripMenuItem.Text = "Подключиться";
-            this.connectToolStripMenuItem.Click += new System.EventHandler(this.ConnectToolStripMenuItem_Click);
-            // 
-            // modsToolStripMenuItem
-            // 
-            this.modsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.downloadModToolStripMenuItem,
-            this.toolStripSeparator2,
-            this.settingsToolStripMenuItem});
-            this.modsToolStripMenuItem.Name = "modsToolStripMenuItem";
-            this.modsToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
-            this.modsToolStripMenuItem.Text = "Моды";
+            this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
             // 
-            // downloadModToolStripMenuItem
+            // exportSettingsToolStripMenuItem
             // 
-            this.downloadModToolStripMenuItem.Name = "downloadModToolStripMenuItem";
-            this.downloadModToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-            this.downloadModToolStripMenuItem.Text = "Скачать моды";
+            this.exportSettingsToolStripMenuItem.Name = "exportSettingsToolStripMenuItem";
+            this.exportSettingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.exportSettingsToolStripMenuItem.Tag = "$ExportSettings";
+            this.exportSettingsToolStripMenuItem.Text = "Export settings";
             // 
-            // toolStripSeparator2
+            // importSettingsToolStripMenuItem
             // 
-            this.toolStripSeparator2.Name = "toolStripSeparator2";
-            this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
-            // 
-            // settingsToolStripMenuItem
-            // 
-            this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
-            this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-            this.settingsToolStripMenuItem.Text = "Настройки";
-            this.settingsToolStripMenuItem.Click += new System.EventHandler(this.SettingsToolStripMenuItem_Click);
-            // 
-            // dataGridView1
-            // 
-            this.dataGridView1.AllowUserToAddRows = false;
-            this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
-            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.enabled,
-            this.NameMod});
-            this.dataGridView1.Cursor = System.Windows.Forms.Cursors.Default;
-            this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
-            this.dataGridView1.Location = new System.Drawing.Point(12, 27);
-            this.dataGridView1.MultiSelect = false;
-            this.dataGridView1.Name = "dataGridView1";
-            this.dataGridView1.RowHeadersWidth = 4;
-            this.dataGridView1.Size = new System.Drawing.Size(341, 411);
-            this.dataGridView1.TabIndex = 1;
-            // 
-            // enabled
-            // 
-            this.enabled.HeaderText = "";
-            this.enabled.Name = "enabled";
-            this.enabled.Width = 20;
-            // 
-            // NameMod
-            // 
-            this.NameMod.HeaderText = "Название";
-            this.NameMod.Name = "NameMod";
-            this.NameMod.ReadOnly = true;
-            this.NameMod.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.NameMod.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.NameMod.Width = 300;
+            this.importSettingsToolStripMenuItem.Name = "importSettingsToolStripMenuItem";
+            this.importSettingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.importSettingsToolStripMenuItem.Tag = "$ImportSettings";
+            this.importSettingsToolStripMenuItem.Text = "ImportSettings";
             // 
             // statusStrip1
             // 
             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripProgressBar1,
             this.toolStripStatusLabel1});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 501);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 618);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Size = new System.Drawing.Size(800, 22);
-            this.statusStrip1.TabIndex = 2;
+            this.statusStrip1.Size = new System.Drawing.Size(940, 22);
+            this.statusStrip1.TabIndex = 1;
             this.statusStrip1.Text = "statusStrip1";
             // 
-            // toolStripProgressBar1
-            // 
-            this.toolStripProgressBar1.Name = "toolStripProgressBar1";
-            this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
-            this.toolStripProgressBar1.Step = 1;
-            // 
-            // backgroundLoadInfo
-            // 
-            this.backgroundLoadInfo.WorkerReportsProgress = true;
-            this.backgroundLoadInfo.DoWork += new System.ComponentModel.DoWorkEventHandler(this.BackgroundLoadInfo_DoWork);
-            this.backgroundLoadInfo.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.BackgroundLoadInfo_ProgressChanged);
-            this.backgroundLoadInfo.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.BackgroundLoadInfo_RunWorkerCompleted);
-            // 
-            // backgroundUpdateMods
-            // 
-            this.backgroundUpdateMods.WorkerReportsProgress = true;
-            this.backgroundUpdateMods.DoWork += new System.ComponentModel.DoWorkEventHandler(this.BackgroundUpdateMods_DoWork);
-            this.backgroundUpdateMods.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.BackgroundUpdateMods_ProgressChanged);
-            this.backgroundUpdateMods.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.BackgroundUpdateMods_RunWorkerCompleted);
-            // 
             // toolStripStatusLabel1
             // 
+            this.toolStripStatusLabel1.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(46, 17);
-            this.toolStripStatusLabel1.Text = "Статус:";
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(113, 17);
+            this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.Controls.Add(this.button1);
+            this.tabPage2.Controls.Add(this.listView3);
+            this.tabPage2.Controls.Add(this.textBox2);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(908, 562);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Tag = "$Download";
+            this.tabPage2.Text = "tabPage2";
+            this.tabPage2.UseVisualStyleBackColor = true;
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Controls.Add(this.tabPage3);
+            this.tabControl1.Location = new System.Drawing.Point(12, 27);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(916, 588);
+            this.tabControl1.TabIndex = 2;
+            this.tabControl1.Tag = "";
+            this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.Controls.Add(this.panel1);
+            this.tabPage1.Controls.Add(this.checkBox1);
+            this.tabPage1.Controls.Add(this.textBox1);
+            this.tabPage1.Controls.Add(this.listView1);
+            this.tabPage1.Location = new System.Drawing.Point(4, 22);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(908, 562);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Tag = "$Installed";
+            this.tabPage1.Text = "tabPage1";
+            this.tabPage1.UseVisualStyleBackColor = true;
+            this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.richTextBox1);
+            this.panel1.Controls.Add(this.button5);
+            this.panel1.Controls.Add(this.button3);
+            this.panel1.Controls.Add(this.groupBox1);
+            this.panel1.Controls.Add(this.pictureBox1);
+            this.panel1.Controls.Add(this.label2);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Location = new System.Drawing.Point(394, 6);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(508, 550);
+            this.panel1.TabIndex = 4;
+            // 
+            // button5
+            // 
+            this.button5.BackColor = System.Drawing.Color.DarkRed;
+            this.button5.Enabled = false;
+            this.button5.ForeColor = System.Drawing.Color.White;
+            this.button5.Location = new System.Drawing.Point(408, 8);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(80, 23);
+            this.button5.TabIndex = 6;
+            this.button5.Tag = "$Delete";
+            this.button5.Text = "button5";
+            this.button5.UseVisualStyleBackColor = false;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(65, 512);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(193, 23);
+            this.button3.TabIndex = 5;
+            this.button3.Tag = "$ModDowlnloadAllDepMods";
+            this.button3.Text = "button3";
+            this.button3.UseVisualStyleBackColor = true;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.linkLabel2);
+            this.groupBox1.Controls.Add(this.linkLabel1);
+            this.groupBox1.Controls.Add(this.button4);
+            this.groupBox1.Controls.Add(this.button2);
+            this.groupBox1.Controls.Add(this.listView2);
+            this.groupBox1.Controls.Add(this.label17);
+            this.groupBox1.Controls.Add(this.label16);
+            this.groupBox1.Controls.Add(this.label15);
+            this.groupBox1.Controls.Add(this.label13);
+            this.groupBox1.Controls.Add(this.label11);
+            this.groupBox1.Controls.Add(this.label10);
+            this.groupBox1.Controls.Add(this.label9);
+            this.groupBox1.Controls.Add(this.label8);
+            this.groupBox1.Controls.Add(this.label7);
+            this.groupBox1.Controls.Add(this.label6);
+            this.groupBox1.Controls.Add(this.label5);
+            this.groupBox1.Controls.Add(this.label4);
+            this.groupBox1.Location = new System.Drawing.Point(12, 141);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(481, 400);
+            this.groupBox1.TabIndex = 4;
+            this.groupBox1.TabStop = false;
+            // 
+            // linkLabel2
+            // 
+            this.linkLabel2.AutoSize = true;
+            this.linkLabel2.Location = new System.Drawing.Point(204, 109);
+            this.linkLabel2.Name = "linkLabel2";
+            this.linkLabel2.Size = new System.Drawing.Size(55, 13);
+            this.linkLabel2.TabIndex = 20;
+            this.linkLabel2.TabStop = true;
+            this.linkLabel2.Tag = "$Empty";
+            this.linkLabel2.Text = "linkLabel2";
+            // 
+            // linkLabel1
+            // 
+            this.linkLabel1.AutoSize = true;
+            this.linkLabel1.Location = new System.Drawing.Point(204, 85);
+            this.linkLabel1.Name = "linkLabel1";
+            this.linkLabel1.Size = new System.Drawing.Size(55, 13);
+            this.linkLabel1.TabIndex = 19;
+            this.linkLabel1.TabStop = true;
+            this.linkLabel1.Tag = "$Empty";
+            this.linkLabel1.Text = "linkLabel1";
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(252, 371);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(223, 23);
+            this.button4.TabIndex = 18;
+            this.button4.Tag = "$ModDownloadReqMods";
+            this.button4.Text = "button4";
+            this.button4.UseVisualStyleBackColor = true;
+            // 
+            // button2
+            // 
+            this.button2.Enabled = false;
+            this.button2.Location = new System.Drawing.Point(9, 371);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(38, 23);
+            this.button2.TabIndex = 5;
+            this.button2.Text = "---->";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // listView2
+            // 
+            this.listView2.HideSelection = false;
+            this.listView2.Location = new System.Drawing.Point(6, 170);
+            this.listView2.Name = "listView2";
+            this.listView2.Size = new System.Drawing.Size(469, 195);
+            this.listView2.TabIndex = 17;
+            this.listView2.UseCompatibleStateImageBehavior = false;
+            this.listView2.View = System.Windows.Forms.View.List;
+            this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(6, 154);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(41, 13);
+            this.label17.TabIndex = 16;
+            this.label17.Tag = "$ModDep";
+            this.label17.Text = "label17";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(204, 131);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(41, 13);
+            this.label16.TabIndex = 15;
+            this.label16.Tag = "$Empty";
+            this.label16.Text = "label16";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(6, 131);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(41, 13);
+            this.label15.TabIndex = 14;
+            this.label15.Tag = "$ModFactorioVersion";
+            this.label15.Text = "label15";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(6, 109);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(41, 13);
+            this.label13.TabIndex = 12;
+            this.label13.Tag = "$ModWebsite";
+            this.label13.Text = "label13";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(6, 85);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(41, 13);
+            this.label11.TabIndex = 10;
+            this.label11.Tag = "$ModContact";
+            this.label11.Text = "label11";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(204, 63);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(41, 13);
+            this.label10.TabIndex = 9;
+            this.label10.Tag = "$Empty";
+            this.label10.Text = "label10";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(6, 63);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(35, 13);
+            this.label9.TabIndex = 8;
+            this.label9.Tag = "$ModAuthor";
+            this.label9.Text = "label9";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(204, 39);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(35, 13);
+            this.label8.TabIndex = 7;
+            this.label8.Tag = "$Empty";
+            this.label8.Text = "label8";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(6, 39);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(35, 13);
+            this.label7.TabIndex = 6;
+            this.label7.Tag = "$ModVersion";
+            this.label7.Text = "label7";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(204, 17);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(35, 13);
+            this.label6.TabIndex = 5;
+            this.label6.Tag = "$Empty";
+            this.label6.Text = "label6";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 17);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(35, 13);
+            this.label5.TabIndex = 1;
+            this.label5.Tag = "$ModState";
+            this.label5.Text = "label5";
+            // 
+            // label4
+            // 
+            this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label4.Location = new System.Drawing.Point(191, 15);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(2, 130);
+            this.label4.TabIndex = 0;
+            // 
+            // pictureBox1
+            // 
+            this.pictureBox1.BackColor = System.Drawing.Color.Black;
+            this.pictureBox1.Location = new System.Drawing.Point(408, 55);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(80, 80);
+            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pictureBox1.TabIndex = 3;
+            this.pictureBox1.TabStop = false;
+            // 
+            // label2
+            // 
+            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label2.Cursor = System.Windows.Forms.Cursors.Arrow;
+            this.label2.Location = new System.Drawing.Point(10, 43);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(480, 2);
+            this.label2.TabIndex = 1;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(9, 13);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(35, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Tag = "$ModName";
+            this.label1.Text = "label1";
+            // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Location = new System.Drawing.Point(12, 39);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(15, 14);
+            this.checkBox1.TabIndex = 3;
+            this.checkBox1.UseVisualStyleBackColor = true;
+            this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(6, 6);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(382, 20);
+            this.textBox1.TabIndex = 1;
+            this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
+            // 
+            // listView1
+            // 
+            this.listView1.CheckBoxes = true;
+            this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader3,
+            this.columnHeader1,
+            this.columnHeader2});
+            this.listView1.FullRowSelect = true;
+            this.listView1.HideSelection = false;
+            this.listView1.Location = new System.Drawing.Point(6, 33);
+            this.listView1.MultiSelect = false;
+            this.listView1.Name = "listView1";
+            this.listView1.Size = new System.Drawing.Size(382, 523);
+            this.listView1.TabIndex = 0;
+            this.listView1.UseCompatibleStateImageBehavior = false;
+            this.listView1.View = System.Windows.Forms.View.Details;
+            this.listView1.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.listView1_DrawColumnHeader);
+            this.listView1.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.listView1_DrawItem);
+            this.listView1.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.listView1_DrawSubItem);
+            this.listView1.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listView1_ItemChecked);
+            this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Tag = "true";
+            this.columnHeader3.Text = "";
+            this.columnHeader3.Width = 25;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Tag = "$ModName";
+            this.columnHeader1.Width = 271;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Tag = "$ModVersion";
+            this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader2.Width = 82;
+            // 
+            // tabPage3
+            // 
+            this.tabPage3.Location = new System.Drawing.Point(4, 22);
+            this.tabPage3.Name = "tabPage3";
+            this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage3.Size = new System.Drawing.Size(908, 562);
+            this.tabPage3.TabIndex = 2;
+            this.tabPage3.Tag = "$Updates";
+            this.tabPage3.Text = "tabPage3";
+            this.tabPage3.UseVisualStyleBackColor = true;
+            // 
+            // richTextBox1
+            // 
+            this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.richTextBox1.Location = new System.Drawing.Point(12, 48);
+            this.richTextBox1.Name = "richTextBox1";
+            this.richTextBox1.Size = new System.Drawing.Size(390, 87);
+            this.richTextBox1.TabIndex = 7;
+            this.richTextBox1.Tag = "$ModDesc";
+            this.richTextBox1.Text = "rtBox1";
+            this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown);
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(6, 6);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(263, 20);
+            this.textBox2.TabIndex = 0;
+            // 
+            // listView3
+            // 
+            this.listView3.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader4,
+            this.columnHeader5,
+            this.columnHeader6});
+            this.listView3.HideSelection = false;
+            this.listView3.Location = new System.Drawing.Point(6, 32);
+            this.listView3.Name = "listView3";
+            this.listView3.Size = new System.Drawing.Size(382, 524);
+            this.listView3.TabIndex = 1;
+            this.listView3.UseCompatibleStateImageBehavior = false;
+            this.listView3.View = System.Windows.Forms.View.Details;
+            // 
+            // button1
+            // 
+            this.button1.ForeColor = System.Drawing.Color.DarkBlue;
+            this.button1.Location = new System.Drawing.Point(275, 4);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(113, 23);
+            this.button1.TabIndex = 2;
+            this.button1.Tag = "$Search";
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Tag = "$ModName";
+            this.columnHeader4.Width = 252;
+            // 
+            // columnHeader5
+            // 
+            this.columnHeader5.Tag = "$ModVersion";
+            this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // columnHeader6
+            // 
+            this.columnHeader6.Tag = "$ModDownloads";
+            this.columnHeader6.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 523);
+            this.ClientSize = new System.Drawing.Size(940, 640);
+            this.Controls.Add(this.tabControl1);
             this.Controls.Add(this.statusStrip1);
-            this.Controls.Add(this.dataGridView1);
             this.Controls.Add(this.menuStrip1);
             this.MainMenuStrip = this.menuStrip1;
             this.Name = "Form1";
+            this.Tag = "$FactroioModManager";
             this.Text = "Form1";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.statusStrip1.ResumeLayout(false);
             this.statusStrip1.PerformLayout();
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage2.PerformLayout();
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage1.PerformLayout();
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -271,29 +642,56 @@
         #endregion
 
         private System.Windows.Forms.MenuStrip menuStrip1;
-        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem exportOfflineToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem exportOnlineToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem importOfflineToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem importOnlineToolStripMenuItem;
-        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
-        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem connectionToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem connectToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem modsToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem downloadModToolStripMenuItem;
-        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
-        private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
-        private System.Windows.Forms.DataGridView dataGridView1;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn enabled;
-        private System.Windows.Forms.DataGridViewTextBoxColumn NameMod;
         private System.Windows.Forms.StatusStrip statusStrip1;
-        private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
-        private System.ComponentModel.BackgroundWorker backgroundLoadInfo;
-        private System.ComponentModel.BackgroundWorker backgroundUpdateMods;
         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.ListView listView1;
+        private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
+        private System.Windows.Forms.ToolStripMenuItem exportModPackToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
+        private System.Windows.Forms.ToolStripMenuItem changeSettingsToolStripMenuItem;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        private System.Windows.Forms.ToolStripMenuItem exportSettingsToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem importSettingsToolStripMenuItem;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.CheckBox checkBox1;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.PictureBox pictureBox1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.ListView listView2;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.LinkLabel linkLabel2;
+        private System.Windows.Forms.LinkLabel linkLabel1;
+        private System.Windows.Forms.RichTextBox richTextBox1;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.ListView listView3;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
+        private System.Windows.Forms.ColumnHeader columnHeader5;
+        private System.Windows.Forms.ColumnHeader columnHeader6;
     }
 }
 

+ 273 - 121
FactorioModManager/Form1.cs

@@ -2,209 +2,361 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
+using System.Diagnostics;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
-using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
 using System.Windows.Forms;
-using Newtonsoft.Json;
-using System.Net;
-using Ionic.Zip;
 
 namespace FactorioModManager
 {
     public partial class Form1 : Form
     {
-        Mod_list modlist;
-        List<ModInfo> mods = new List<ModInfo>();
-        List<string> installed_mods = new List<string>();
-
-        string indexes_dir = @"data\indexes\";
-        string API_URL = "https://mods.factorio.com/api/mods/";
-        string status_String = "Статус: ";
-#if (DEBUG)
-        string mods_path = @"E:\FMM\mods\";
-#else
-        string mods_path = @"E:\FMM\mods\";
-#endif
+        public Version Version = new Version("0.0.1");
+        
+        public string SettingsFile = Path.Combine(Directory.GetCurrentDirectory(), @"data\settings\settings.settings");
+        public F_API api = new F_API();
+        public ModWorker Worker;
+
+        private List<ModWorker.Mod> displayedMods = new List<ModWorker.Mod>();
+
+        public string connection_str = "";
+        public string is_connected_str = "";
+        public string is_not_connected_str = "";
+
+        public string Warning;
+        public string SureDeleteMod;
+        public string On, Off;
+
+        public string Updates;
         public Form1()
         {
             InitializeComponent();
+            panel1.Visible = false;
+            Settings.Load(SettingsFile);
+            LanguageManager.LanguageDir = @"data\lang";
+            LanguageManager.ScanForLanguages();
+            Worker = new ModWorker();
+            Worker.ModsLoaded += () =>
+            {
+                listView1.Items.Clear();
+                SetFullModList();
+                displayedMods = Worker.InstalledMods;
+            };
+            new Thread(() =>
+            {
+                try
+                {
+                    Worker.LoadModList();
+                }
+                catch (Exception e)
+                {
+                    Debug.WriteLine(e.Message);
+                }
+            }).Start();
+            Worker.API = api;
+            api.Account = Settings.Account;
+            api.Connected += (bool success) =>
+            {
+                try
+                {
+                    this.Invoke(new Action(() =>
+                    {
+                        toolStripStatusLabel1.Text = connection_str + ": " + (api.IsConnected ? is_connected_str : is_not_connected_str);
+                    }));
+                }
+                catch { }
+            };
+            foreach (Control control in this.Controls)
+            {
+                MakeLinksClicable(control);
+            }
+
         }
 
-        public void loadModsList()
+        private void SetFullModList(List<ModWorker.Mod> mods=null)
         {
-            StreamReader sr = new StreamReader(mods_path + "mod-list.json");
-            modlist = JsonConvert.DeserializeObject<Mod_list>(sr.ReadToEnd());
-            sr.Close();
-            List<Mod> temp_mods = new List<Mod>();
-            foreach(Mod mod in modlist.mods)
+            listView1.Invoke(new Action(() =>
             {
-                if (mod.name != "base")
+                checkBox1.Checked = false;
+                listView1.Items.Clear();
+                if (mods == null)
                 {
-                    mod.title = mod.name;
-                    temp_mods.Add(mod);
+                    for (int i = 0; i < Worker.InstalledMods.Count; i++)
+                    {
+                        ListViewItem item = listView1.Items.Add("");
+                        item.SubItems[0].Tag = Worker.InstalledMods[i].Enabled;
+                        item.SubItems[0].Text = "";
+                        item.Checked = Worker.InstalledMods[i].Enabled;
+                        item.SubItems.Add(Worker.InstalledMods[i].Title);
+                        item.SubItems.Add(Worker.InstalledMods[i].Version.ToString());
+                    }
                 }
-            }
-            modlist.mods = temp_mods.ToArray();
+                else
+                {
+                    for (int i = 0; i < mods.Count; i++)
+                    {
+                        ListViewItem item = listView1.Items.Add("");
+                        item.SubItems[0].Tag = mods[i].Enabled;
+                        item.SubItems[0].Text = "";
+                        item.Checked = mods[i].Enabled;
+                        item.SubItems.Add(mods[i].Title);
+                        item.SubItems.Add(mods[i].Version.ToString());
+                    }
+                }
+            }));
         }
 
-        public void loadLocalMods()
+        private void MakeLinksClicable(Control control)
         {
-            string[] files = new DirectoryInfo(mods_path).GetFiles("*.zip").Select(f => f.Name).ToArray();
-            for(int i = 0; i < files.Length; i++)
+            if (control is LinkLabel)
             {
-                files[i] = files[i].Substring(0, files[i].LastIndexOf('_'));
+                ((LinkLabel)control).Click += (s, e) =>
+                {
+                    LinkLabel label = (LinkLabel)s;
+                    Process.Start(label.Text);
+                };
             }
-            for(int i = 0; i < files.Length; i++)
+            if (control.HasChildren)
             {
-                if (installed_mods.FindIndex(f => f == files[i]) == -1)
+                foreach (Control ctrl in control.Controls)
                 {
-                    installed_mods.Add(files[i]);
+                    MakeLinksClicable(ctrl);
                 }
             }
         }
-
-        private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
+       
+        private void UpdateLang()
         {
-            this.Close();
-        }
+            connection_str = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Connection");
+            is_connected_str = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Connected");
+            is_not_connected_str = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$NotConnected");
 
-        private void ConnectToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            AuthForm frm = new AuthForm();
-            frm.Owner = this;
-            frm.ShowDialog();
-        }
+            On = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$On");
+            Off = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Off");
 
-        private void fixModList()
-        {
-            List<Mod> temp_mods = new List<Mod>();
-            List<string> installed_mods_list = new List<string>(installed_mods);
-            installed_mods_list.Add("base");
+            Updates = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Updates");
+
+            Warning = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Warning");
+            SureDeleteMod = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$SureDeleteMod");
+
+            LanguageManager.ApplyLanguage(Settings.LastLanguage, this);
 
-            if (modlist.mods.Length > installed_mods.Count)
+            toolStripStatusLabel1.Text = connection_str + ": " + (api.IsConnected ? is_connected_str : is_not_connected_str);
+
+            this.Update();
+
+            if (!LanguageManager.LanguageFounded)
             {
-                foreach(Mod mod in modlist.mods)
-                {
-                    if(installed_mods.FindIndex(f=> f == mod.name) != -1)
-                    {
-                        temp_mods.Add(mod);
-                    }
-                }
+                MessageBox.Show("No localization files found! The program window will look incorrect!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
-            else
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            UpdateLang();
+            this.Text += " " + Version.ToString();
+            if (Settings.ConnectAfterStart)
             {
-                temp_mods = modlist.mods.ToList();
-                foreach(string mod in installed_mods)
+                new Thread(() =>
                 {
-                    if(temp_mods.FindIndex(f=> f.name == mod) == -1)
-                    {
-                        temp_mods.Add(new Mod(mod, true));
-                    }
-                }
+                    api.Connect();
+
+                }).Start();
             }
-            modlist.mods = temp_mods.ToArray();
-            StreamWriter sw = new StreamWriter(mods_path + "mod-list.json");
-            sw.Write(JsonConvert.SerializeObject(modlist));
-            sw.Close();
+            listView1.Update();
         }
 
-        private void Form1_Load(object sender, EventArgs e)
+        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            Settings.Save(SettingsFile);
+        }
+
+        private void listView1_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
         {
-            loadModsList();
-            loadLocalMods();
-            if (modlist.mods.Length != installed_mods.Count)
+            if (e.ColumnIndex == 0)
             {
-                if(MessageBox.Show("Внимаение! Не все моды добавлены в мод-лист, запуск игры может происходить дольше. Исправить?", "Предупреждение!", MessageBoxButtons.YesNo) == DialogResult.Yes)
+                e.DrawBackground();
+                bool value = false;
+                try
                 {
-                    fixModList();
+                    value = Convert.ToBoolean(e.Header.Tag);
                 }
+                catch (Exception)
+                {
+                }
+                CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(e.Bounds.Left + 4, e.Bounds.Top + 4),
+                    value ? System.Windows.Forms.VisualStyles.CheckBoxState.CheckedNormal :
+                    System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal);
             }
-            if (Properties.Settings.Default.autoLoadInfo)
+            else
             {
-                toolStripStatusLabel1.Text = status_String + "Загрузка информации";
-                backgroundLoadInfo.RunWorkerAsync();
+                e.DrawDefault = true;
             }
-            dataGridView1.Rows.Clear();
-            if (!Properties.Settings.Default.autoLoadInfo)
+        }
+
+        private void listView1_DrawItem(object sender, DrawListViewItemEventArgs e)
+        {
+            e.DrawDefault = true;
+        }
+
+        private void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
+        {
+            e.DrawDefault = true;
+        }
+
+        private void checkBox1_CheckedChanged(object sender, EventArgs e)
+        {
+            for(int i = 0; i < listView1.Items.Count; i++)
             {
-                foreach (Mod mod in modlist.mods)
-                {
-                    dataGridView1.Rows.Add(mod.enabled, mod.title);
-                }
+                listView1.Items[i].SubItems[0].Tag = checkBox1.Checked;
+                listView1.Items[i].Checked = checkBox1.Checked;
             }
-            else
+            listView1.Refresh();
+        }
+
+        private void tabPage1_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void changeSettingsToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            Settings_Form settings = new Settings_Form();
+            LanguageManager.ApplyLanguage(Settings.LastLanguage, settings);
+            if (settings.ShowDialog() == DialogResult.OK)
             {
-                dataGridView1.Rows.Add(false, "Данные загружаются!");
+                Settings.Save(SettingsFile);
+                UpdateLang();
             }
         }
 
-        private void SettingsToolStripMenuItem_Click(object sender, EventArgs e)
+        private void listView2_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            button2.Enabled = listView2.SelectedIndices.Count != 0;
+        }
+
+        private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
         {
-            SettingsForm frm = new SettingsForm();
-            frm.Owner = this;
-            frm.ShowDialog();
+            e.Handled = false;
+            e.SuppressKeyPress = true;
         }
 
-        private void BackgroundLoadInfo_DoWork(object sender, DoWorkEventArgs e)
+        private void textBox1_TextChanged(object sender, EventArgs e)
         {
-            BackgroundWorker worker = sender as BackgroundWorker;
-            using (var webClient = new WebClient())
+            if (!String.IsNullOrEmpty(textBox1.Text))
             {
-                for(int i=0;i<modlist.mods.Length;i++)
+                List<ModWorker.Mod> findedMods = new List<ModWorker.Mod>();
+
+                for(int i = 0; i < Worker.InstalledMods.Count; i++)
                 {
-                    Mod mod = modlist.mods[i];
-                    ModInfo info;
-                    string response = webClient.DownloadString(API_URL + mod.name + "/full");
-                    info = JsonConvert.DeserializeObject<ModInfo>(response);
-                    mods.Add(info);
-                    int k = i * 100;
-                    int progress = k / modlist.mods.Length;
-                    worker.ReportProgress(progress);
+                    if(Worker.InstalledMods[i].Name.ToLowerInvariant().Contains(textBox1.Text.ToLowerInvariant()) ||
+                        Worker.InstalledMods[i].Title.ToLowerInvariant().Contains(textBox1.Text.ToLowerInvariant()) ||
+                        Worker.InstalledMods[i].Description.ToLowerInvariant().Contains(textBox1.Text.ToLowerInvariant()))
+                    {
+                        findedMods.Add(Worker.InstalledMods[i]);
+                    }
                 }
+
+                SetFullModList(findedMods);
+                displayedMods = findedMods;
+            }
+            else
+            {
+                SetFullModList();
+                displayedMods = Worker.InstalledMods;
             }
         }
 
-        private void BackgroundLoadInfo_ProgressChanged(object sender, ProgressChangedEventArgs e)
+        private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e)
         {
-            toolStripProgressBar1.Value = e.ProgressPercentage;
+            /*bool flag = true;
+            foreach(ListViewItem item in listView1.Items)
+            {
+                flag = item.Checked && flag;
+            }
+            checkBox1.Checked = flag;*/
         }
 
-        private void BackgroundLoadInfo_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+        private void button2_Click(object sender, EventArgs e)
         {
-            dataGridView1.Rows.Clear();
-            toolStripProgressBar1.Value = 0;
-            
-            for (int i=0;i<mods.Count;i++)
+            List<string> deps = displayedMods[listView1.SelectedIndices[0]].DependenciesModNames;
+            ModWorker.Mod mod = null;
+
+            for(int i = 0; i<Worker.InstalledMods.Count; i++)
             {
-                dataGridView1.Rows.Add(modlist.mods[i].enabled, mods[i].title);
+                if (Worker.InstalledMods[i].Name.ToLowerInvariant().Equals(deps[listView2.SelectedIndices[0]].ToLowerInvariant()))
+                {
+                    mod = Worker.InstalledMods[i];
+                }
             }
-            if (Properties.Settings.Default.autoUpdateMods)
+
+            if (mod != null)
             {
-                toolStripStatusLabel1.Text = status_String + "Обновление модов";
-                backgroundUpdateMods.RunWorkerAsync();
+                textBox1.Text = "";
+                SetFullModList();
+                listView1.SelectedIndices.Clear();
+                listView1.SelectedIndices.Add(Worker.InstalledMods.FindIndex(x => x == mod));
             }
             else
             {
-                toolStripStatusLabel1.Text = status_String + "Готово";
+
             }
         }
 
-        private void BackgroundUpdateMods_DoWork(object sender, DoWorkEventArgs e)
+        private void button5_Click(object sender, EventArgs e)
         {
-
+            if (MessageBox.Show(SureDeleteMod, Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+            {
+                string[] files = Directory.GetFiles(Settings.GamePath);
+                for(int i = 0; i < files.Length; i++)
+                {
+                    if (files[i].Substring(files[i].LastIndexOf("\\")).Contains(displayedMods[listView1.SelectedIndices[0]].Name))
+                    {
+                        File.Delete(files[i]);
+                        Worker.LoadModList();
+                        break;
+                    }
+                }
+            }
         }
 
-        private void BackgroundUpdateMods_ProgressChanged(object sender, ProgressChangedEventArgs e)
+        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
         {
-            toolStripProgressBar1.Value = e.ProgressPercentage;
+            if (tabControl1.SelectedIndex == 1)
+            {
+
+            }
         }
 
-        private void BackgroundUpdateMods_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
         {
-            toolStripProgressBar1.Value = 0;
-            toolStripStatusLabel1.Text = status_String + "Готово";
+            button5.Enabled = panel1.Visible = listView1.SelectedIndices.Count != 0;
+            if(listView1.SelectedIndices.Count != 0)
+            {
+                label1.Text = displayedMods[listView1.SelectedIndices[0]].Title;
+                richTextBox1.Text = displayedMods[listView1.SelectedIndices[0]].Description;
+                pictureBox1.Image = displayedMods[listView1.SelectedIndices[0]].Thumbnail;
+                label6.Text = (displayedMods[listView1.SelectedIndices[0]].Enabled) ? On : Off;
+                label8.Text = displayedMods[listView1.SelectedIndices[0]].Version.ToString();
+                label10.Text = displayedMods[listView1.SelectedIndices[0]].Author;
+                linkLabel1.Text = displayedMods[listView1.SelectedIndices[0]].Contact;
+                linkLabel2.Text = displayedMods[listView1.SelectedIndices[0]].WebSite;
+                label16.Text = displayedMods[listView1.SelectedIndices[0]].FactorioVersion.ToString();
+                listView2.Items.Clear();
+                for(int i=0;i< displayedMods[listView1.SelectedIndices[0]].Dependencies.Count; i++)
+                {
+                    ListViewItem item = listView2.Items.Add(displayedMods[listView1.SelectedIndices[0]].Dependencies.Keys.ElementAt(i));
+                    Color fcolor = Color.DarkOrange;
+                    if (displayedMods[listView1.SelectedIndices[0]].Dependencies.Values.ElementAt(i) == ModWorker.Mod.Availability.Banned) fcolor = Color.DarkRed;
+                    if (displayedMods[listView1.SelectedIndices[0]].Dependencies.Values.ElementAt(i) == ModWorker.Mod.Availability.Optional) fcolor = Color.DarkGreen;
+                    item.ForeColor = fcolor;
+                }
+                button2.Enabled = false;
+            }
         }
     }
 }

+ 1 - 19
FactorioModManager/Form1.resx

@@ -120,25 +120,7 @@
   <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <metadata name="enabled.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="NameMod.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="enabled.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="NameMod.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>132, 17</value>
-  </metadata>
-  <metadata name="backgroundLoadInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>248, 17</value>
-  </metadata>
-  <metadata name="backgroundUpdateMods.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>413, 17</value>
+    <value>126, 17</value>
   </metadata>
 </root>

+ 207 - 0
FactorioModManager/LanguageManager.cs

@@ -0,0 +1,207 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FactorioModManager
+{
+    public class LanguageManager
+    {
+        /// <summary>
+        /// Path to the folder with language files relative to the CURRENT program folder
+        /// </summary>
+        public static string LanguageDir { get; set; } = "lang";
+
+        /// <summary>
+        /// List of available languages
+        /// </summary>
+        public static List<string> AvailableLangs { get { return _langs; } }
+
+        private static List<string> _langs = new List<string>();
+        private static Dictionary<string, string> _lines = new Dictionary<string, string>();
+        private static string _current_lang = null;
+
+        public static bool LanguageFounded { get; private set; } = false;
+
+        /// <summary>
+        /// Applies the selected language to all form controls
+        /// </summary>
+        /// <param name="lang">Selected language</param>
+        /// <param name="form">Target form</param>
+        /// <returns>Returns true if localization has been SUCCESSFULLY applied to ALL form elements</returns>
+        public static bool ApplyLanguage(string lang, Form form)
+        {
+            bool result = true;
+            if (form.Tag != null)
+            {
+                string text = GetStrinByTag(lang, (string)form.Tag);
+                if (text == (string)form.Tag) result = false;
+                form.Text = text;
+            }
+            foreach(Control ctrl in form.Controls)
+            {
+                bool tmp = ApplyLanguage(lang, ctrl);
+                result = result && tmp;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Applies the selected language to this control
+        /// </summary>
+        /// <param name="lang">Selected language</param>
+        /// <param name="control">Target control</param>
+        /// <returns>Returns true if localization has been SUCCESSFULLY applied</returns>
+        public static bool ApplyLanguage(string lang, Control control)
+        {
+            
+            bool result = true;
+            if (control.Tag != null)
+            {
+                if ((string)control.Tag == "$Empty") control.Text = String.Empty;
+                else
+                {
+                    string text = GetStrinByTag(lang, (string)control.Tag);
+                    if (text == (string)control.Tag) result = false;
+                    control.Text = text;
+                }
+            }
+            if (control.HasChildren)
+            {
+                foreach (Control ctrl in control.Controls)
+                {
+                    bool tmp = ApplyLanguage(lang, ctrl);
+                    result = result && tmp;
+                }
+            }
+            if (control is MenuStrip)
+            {
+                foreach (ToolStripMenuItem ctrl in ((MenuStrip)control).Items)
+                {
+                    bool tmp = ApplyLanguage(lang, ctrl);
+                    result = result && tmp;
+                }
+            }
+            if(control is ListView)
+            {
+                foreach (ColumnHeader ctrl in ((ListView)control).Columns)
+                {
+                    bool tmp = ApplyLanguage(lang, ctrl);
+                    result = result && tmp;
+                }
+            }
+            return result;
+        }
+
+        public static bool ApplyLanguage(string lang, ColumnHeader control)
+        {
+
+            bool result = true;
+            if (control.Tag != null)
+            {
+                if (control.Tag.ToString().StartsWith("$")) {
+                    string text = GetStrinByTag(lang, (string)control.Tag);
+                    if (text == (string)control.Tag) result = false;
+                    control.Text = text;
+                }
+                else
+                {
+                    control.Text = "";
+                }
+            }
+            return result;
+        }
+
+        public static bool ApplyLanguage(string lang, ToolStripMenuItem control)
+        {
+
+            bool result = true;
+            if (control.Tag != null)
+            {
+                if ((string)control.Tag == "$Empty") control.Text = String.Empty;
+                else
+                {
+                    string text = GetStrinByTag(lang, (string)control.Tag);
+                    if (text == (string)control.Tag) result = false;
+                    control.Text = text;
+                }
+            }
+            if (control.HasDropDownItems)
+            {
+                for(int i = 0; i < control.DropDownItems.Count; i++)
+                {
+                    if(!(control.DropDownItems[i] is ToolStripSeparator))
+                    {
+                        bool tmp = ApplyLanguage(lang, (ToolStripMenuItem)control.DropDownItems[i]);
+                        result = result && tmp;
+                    }
+                }
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Returns a string containing the localized decryption of the tag. If there is none, it returns the tag.
+        /// </summary>
+        /// <param name="lang">Language</param>
+        /// <param name="tag">Tag</param>
+        /// <returns></returns>
+        public static string GetStrinByTag(string lang,string tag)
+        {
+            if (LanguageFounded)
+            {
+                if (_current_lang == null || _current_lang != lang || _lines.Count == 0)
+                {
+                    StreamReader sr = new StreamReader(Path.Combine(Directory.GetCurrentDirectory(), LanguageDir, lang + ".lang"));
+                    List<string> lines = sr.ReadToEnd().Split('\n').ToList();
+                    sr.Close();
+                    _lines.Clear();
+                    for (int i = 0; i < lines.Count; i++)
+                    {
+                        if (!String.IsNullOrEmpty(lines[i]))
+                        {
+                            string key, value;
+                            lines[i] = lines[i].Trim();
+                            key = lines[i].Split('=')[0];
+                            value = lines[i].Split('=')[1];
+                            value = value.Replace("\\n", "\n").Replace("\\t", "\t");
+                            _lines.Add(key, value);
+                        }
+                    }
+
+                }
+            }
+            if (_lines.ContainsKey(tag)) return _lines[tag];
+            else return tag;
+            
+            
+        }
+
+        /// <summary>
+        /// Scans the folder for language files
+        /// </summary>
+        /// <returns>Returns true if at least one language file was found</returns>
+        public static void ScanForLanguages()
+        {
+            if (Directory.Exists(LanguageDir))
+            {
+                List<string> files = Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), LanguageDir)).ToList();
+                for (int i = 0; i < files.Count; i++)
+                {
+
+                    if (files[i].EndsWith(".lang"))
+                    {
+                        files[i] = files[i].Substring(files[i].LastIndexOf('\\') + 1);
+                        files[i] = files[i].Substring(0, files[i].LastIndexOf('.'));
+                    }
+                }
+                _langs = files;
+                LanguageFounded = files.Count > 0;
+            }
+            else LanguageFounded = false;
+        }
+    }
+}

+ 238 - 0
FactorioModManager/ModWorker.cs

@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+
+namespace FactorioModManager
+{
+    public class ModWorker
+    {
+        public class Mod
+        {
+            public enum Availability
+            {
+                Required,
+                Banned,
+                Optional
+            }
+
+            public bool Enabled { get; set; } = true;
+            public string Name { get;}
+            public string Title { get; private set; }
+            public Version Version { get; }
+
+            public string Author { get; }
+            public string Contact { get; }
+            public string WebSite { get; }
+
+            public string Description { get; private set; }
+            public Version FactorioVersion { get; }
+
+            public Image Thumbnail { get; set; }
+
+            public List<string> DependenciesModNames { get
+                {
+                    List<string> val = new List<string>();
+                    for(int i = 0; i < Dependencies.Count; i++)
+                    {
+                        string dep = Dependencies.Keys.ElementAt(i);
+                        string mod = "";
+                        for(int j = 0; j < dep.Length; j++)
+                        {
+                            if(Char.IsLetterOrDigit(dep[j]) || dep[j] == '_' || dep[j] == '-')
+                            {
+                                mod += dep[j];
+                            }
+
+                            if (dep[j] == '>' || dep[j] == '<') break;
+                        }
+                        val.Add(mod);
+                    }
+                    return val;
+                } }
+
+            public Dictionary<string, Availability> Dependencies { get; } = new Dictionary<string, Availability>();
+
+            public Mod(JObject json)
+            {
+                if (json.ContainsKey("name")) Name = (string)json["name"];
+                if (json.ContainsKey("version")) Version = new Version((string)json["version"]);
+                if (json.ContainsKey("factorio_version")) FactorioVersion = new Version((string)json["factorio_version"]);
+                if (json.ContainsKey("title")) Title = (string)json["title"];
+                if (json.ContainsKey("author")) Author = (string)json["author"];
+                if (json.ContainsKey("contact")) Contact = (string)json["contact"];
+                if (json.ContainsKey("homepage")) WebSite = (string)json["homepage"];
+                if (json.ContainsKey("description")) Description = (string)json["description"];
+                if (json.ContainsKey("dependencies")) {
+                    JArray deps = (JArray)json["dependencies"];
+                    for(int i = 0; i < deps.Count; i++)
+                    {
+                        string data = deps[i].ToString();
+                        if (!data.Contains("base"))
+                        {
+                            Availability availability = Availability.Required;
+                            bool notReq = false;
+                            if (data.Contains("?"))
+                            {
+                                availability = Availability.Optional;
+                                notReq = true;
+                            }
+                            else if(data.Contains("!"))
+                            {
+                                availability = Availability.Banned;
+                                notReq = true;
+                            }
+                            Dependencies.Add(data, availability);
+                        }
+                    }
+                }
+            }
+
+            public void SetLocalizedTitle(string Title)
+            {
+                this.Title = Title;
+            }
+
+            public void SetLocalizedDescription(string Description)
+            {
+                this.Description = Description;
+            }
+        }
+
+        public delegate void OnModsLoaded();
+
+        public OnModsLoaded ModsLoaded;
+
+        public string WorkDir { get; set; } = @"data\mods";
+
+        public F_API API { get; set; } = null;
+
+        public List<Mod> InstalledMods { get; } = new List<Mod>();
+
+        public List<Mod> UpdatebleMods { get; } = new List<Mod>();
+
+        public ModWorker()
+        {
+            CheckDirSize();
+            
+        }
+
+        public void LoadModList()
+        {
+            InstalledMods.Clear();
+            if (!String.IsNullOrEmpty(Settings.GamePath))
+            {
+                string[] files = Directory.GetFiles(Settings.GamePath);
+                foreach(string mod in files)
+                {
+                    if (mod.EndsWith(".zip"))
+                    {
+                        Mod jMod = null;
+
+
+
+                        StreamReader sr = new StreamReader(mod);
+                        using (ZipArchive archive = new ZipArchive(sr.BaseStream))
+                        {
+                            string modname = archive.Entries[0].FullName.Substring(0, archive.Entries[0].FullName.IndexOf('/') + 1);
+
+                            for (int i = 0; i < archive.Entries.Count; i++)
+                            {
+                                string path = archive.Entries[i].FullName;
+                                if (archive.Entries[i].FullName == modname + "info.json")
+                                {
+                                    StreamReader ssr = new StreamReader(archive.Entries[i].Open());
+                                    jMod = new Mod(JObject.Parse(ssr.ReadToEnd()));
+                                    ssr.Close();
+                                    break;
+                                }
+                            }
+
+
+                            for (int i = 0; i < archive.Entries.Count; i++)
+                            {
+                                if (archive.Entries[i].FullName.StartsWith(modname + "locale/" + Settings.LastLanguage + "/") && archive.Entries[i].FullName.EndsWith(".cfg"))
+                                {
+                                    StreamReader ssr = new StreamReader(archive.Entries[i].Open());
+                                    string content = ssr.ReadToEnd();
+                                    ssr.Close();
+                                    string[] lines = content.Split('\n');
+                                    for (int j = 0; j < lines.Length; j++)
+                                    {
+                                        lines[j] = lines[j].Trim();
+                                        if (lines[j].Equals("[mod-name]"))
+                                        {
+                                            jMod.SetLocalizedTitle(lines[j + 1].Split('=')[1].Replace("\\n","\n").Replace("\\t", "\t"));
+                                        }
+                                        if (lines[j].Equals("[mod-description]"))
+                                        {
+                                            jMod.SetLocalizedDescription(lines[j + 1].Split('=')[1].Replace("\\n", "\n").Replace("\\t", "\t"));
+                                        }
+                                    }
+                                }
+                                if(archive.Entries[i].FullName.StartsWith(modname+ "thumbnail."))
+                                {
+                                    jMod.Thumbnail = Image.FromStream(archive.Entries[i].Open());
+                                }
+                            }
+
+                        }
+                        sr.Close();
+                        InstalledMods.Add(jMod);
+                    }
+                }
+
+                string[] folders = Directory.GetDirectories(Settings.GamePath);
+                foreach (string folder in folders)
+                {
+                    Version v;
+                    if(folder.Contains("_") && Version.TryParse(folder.Substring(folder.LastIndexOf("_") + 1),out v))
+                    {
+
+                    }
+                }
+
+                StreamReader srr = new StreamReader(Path.Combine(Settings.GamePath, "mod-list.json"));
+                JObject jlist = JObject.Parse(srr.ReadToEnd());
+                srr.Close();
+                JArray list = (JArray)jlist["mods"];
+                for(int i = 0; i < list.Count; i++)
+                {
+                    string name = (string)((JObject)list[i])["name"];
+                    bool enabled = (bool)((JObject)list[i])["enabled"];
+                    int id = InstalledMods.FindIndex(x => x.Name == name);
+                    if (id != -1) InstalledMods[id].Enabled = enabled;
+                }
+            }
+            InstalledMods.Sort((x, y) => x.Title.CompareTo(y.Title));
+            ModsLoaded?.Invoke();
+        }
+
+        public bool CheckForUpdates()
+        {
+            return false;
+        }
+
+        public void CheckDirSize()
+        {
+            string dir = Path.Combine(Directory.GetCurrentDirectory(), WorkDir);
+            long size = new DirectoryInfo(dir).EnumerateFiles().Sum(file => file.Length);
+            double sizeInMb = size / 1024 / 1024;
+            if (sizeInMb > 500)
+            {
+                List<FileInfo> files = new DirectoryInfo(dir).EnumerateFiles().ToList();
+                foreach(FileInfo file in files){
+                    File.Delete(file.FullName);
+                }
+            }
+            
+        }
+
+
+    }
+}

+ 1 - 0
FactorioModManager/Program.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace FactorioModManager

+ 2 - 2
FactorioModManager/Properties/AssemblyInfo.cs

@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("FactorioModManager")]
-[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible(false)]
 
 // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
-[assembly: Guid("7b1956a7-b7bd-447f-bf88-65453988e31c")]
+[assembly: Guid("3e47cdf5-3320-4f37-b577-b678a958baad")]
 
 // Сведения о версии сборки состоят из указанных ниже четырех значений:
 //

+ 1 - 1
FactorioModManager/Properties/Resources.Designer.cs

@@ -19,7 +19,7 @@ namespace FactorioModManager.Properties {
     // с помощью такого средства, как ResGen или Visual Studio.
     // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
     // с параметром /str или перестройте свой проект VS.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     internal class Resources {

+ 1 - 61
FactorioModManager/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace FactorioModManager.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -22,65 +22,5 @@ namespace FactorioModManager.Properties {
                 return defaultInstance;
             }
         }
-        
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("didenkods@yandex.ru")]
-        public string username {
-            get {
-                return ((string)(this["username"]));
-            }
-            set {
-                this["username"] = value;
-            }
-        }
-        
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("")]
-        public string token {
-            get {
-                return ((string)(this["token"]));
-            }
-            set {
-                this["token"] = value;
-            }
-        }
-        
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
-        public bool autoUpdateMods {
-            get {
-                return ((bool)(this["autoUpdateMods"]));
-            }
-            set {
-                this["autoUpdateMods"] = value;
-            }
-        }
-        
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
-        public bool autoLoadInfo {
-            get {
-                return ((bool)(this["autoLoadInfo"]));
-            }
-            set {
-                this["autoLoadInfo"] = value;
-            }
-        }
-        
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
-        public bool saveToken {
-            get {
-                return ((bool)(this["saveToken"]));
-            }
-            set {
-                this["saveToken"] = value;
-            }
-        }
     }
 }

+ 6 - 20
FactorioModManager/Properties/Settings.settings

@@ -1,21 +1,7 @@
 <?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FactorioModManager.Properties" GeneratedClassName="Settings">
-  <Profiles />
-  <Settings>
-    <Setting Name="username" Type="System.String" Scope="User">
-      <Value Profile="(Default)">didenkods@yandex.ru</Value>
-    </Setting>
-    <Setting Name="token" Type="System.String" Scope="User">
-      <Value Profile="(Default)" />
-    </Setting>
-    <Setting Name="autoUpdateMods" Type="System.Boolean" Scope="User">
-      <Value Profile="(Default)">True</Value>
-    </Setting>
-    <Setting Name="autoLoadInfo" Type="System.Boolean" Scope="User">
-      <Value Profile="(Default)">False</Value>
-    </Setting>
-    <Setting Name="saveToken" Type="System.Boolean" Scope="User">
-      <Value Profile="(Default)">True</Value>
-    </Setting>
-  </Settings>
-</SettingsFile>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 54 - 0
FactorioModManager/Settings.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using System.IO;
+
+namespace FactorioModManager
+{
+    public class Settings
+    {
+        public static string LastLanguage { get; set; } = "en";
+
+        public static Account Account { get; set; } = new Account();
+
+        public static string GamePath { get; set; } = "";
+
+        public static bool ConnectAfterStart { get; set; } = true;
+
+        public static void Load(string filename)
+        {
+            if (File.Exists(filename))
+            {
+
+                StreamReader sr = new StreamReader(filename);
+                JObject json = JObject.Parse(sr.ReadToEnd());
+                sr.Close();
+
+                if (json.ContainsKey("last_lang")) LastLanguage = (string)json["last_lang"];
+                if (json.ContainsKey("game_path")) GamePath = (string)json["game_path"];
+                else if (Directory.Exists(@"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Factorio\mods")) GamePath = @"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Factorio\mods";
+                if (json.ContainsKey("account")) Account = Account.FromString((string)json["account"]);
+                if (json.ContainsKey("autoconnect")) ConnectAfterStart = (bool)json["autoconnect"];
+            }
+        }
+
+        public static void Save(string filename)
+        {
+            JObject json = new JObject
+            {
+                { "last_lang", LastLanguage },
+                { "account", Account.ToString() },
+                { "autoconnect", ConnectAfterStart },
+                { "game_path", GamePath }
+            };
+            string dir = filename.Substring(0, filename.LastIndexOf("\\"));
+            if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
+            StreamWriter sw = new StreamWriter(filename);
+            sw.Write(json.ToString());
+            sw.Close();
+        }
+    }
+}

+ 1 - 0
FactorioModManager/SettingsForm.cs

@@ -23,6 +23,7 @@ namespace FactorioModManager
             Properties.Settings.Default.autoLoadInfo = checkBox1.Checked;
             Properties.Settings.Default.saveToken = checkBox3.Checked;
             Properties.Settings.Default.Save();
+            this.Close();
         }
 
         private void SettingsForm_Load(object sender, EventArgs e)

+ 229 - 0
FactorioModManager/Settings_Form.Designer.cs

@@ -0,0 +1,229 @@
+
+namespace FactorioModManager
+{
+    partial class Settings_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
+            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+            this.button2 = new System.Windows.Forms.Button();
+            this.label2 = new System.Windows.Forms.Label();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.maskedTextBox1 = new System.Windows.Forms.MaskedTextBox();
+            this.button3 = new System.Windows.Forms.Button();
+            this.label6 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(12, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(59, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Tag = "$SettingsGamePath";
+            this.label1.Text = "Game path";
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(12, 25);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(170, 20);
+            this.textBox1.TabIndex = 1;
+            // 
+            // button1
+            // 
+            this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+            this.button1.Location = new System.Drawing.Point(188, 23);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(34, 23);
+            this.button1.TabIndex = 2;
+            this.button1.Text = "...";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Location = new System.Drawing.Point(12, 51);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(80, 17);
+            this.checkBox1.TabIndex = 3;
+            this.checkBox1.Tag = "$SettingsAutoConnect";
+            this.checkBox1.Text = "checkBox1";
+            this.checkBox1.UseVisualStyleBackColor = true;
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(147, 280);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 4;
+            this.button2.Tag = "$SettingsApply";
+            this.button2.Text = "button2";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(12, 71);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(35, 13);
+            this.label2.TabIndex = 5;
+            this.label2.Tag = "$SettingsLanguage";
+            this.label2.Text = "label2";
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Location = new System.Drawing.Point(12, 87);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(210, 21);
+            this.comboBox1.TabIndex = 6;
+            // 
+            // label3
+            // 
+            this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label3.Location = new System.Drawing.Point(12, 124);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(210, 2);
+            this.label3.TabIndex = 7;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(12, 133);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(35, 13);
+            this.label4.TabIndex = 8;
+            this.label4.Tag = "$AccountUsername";
+            this.label4.Text = "label4";
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(12, 149);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(210, 20);
+            this.textBox2.TabIndex = 9;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(12, 172);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(35, 13);
+            this.label5.TabIndex = 10;
+            this.label5.Tag = "$AccountPassword";
+            this.label5.Text = "label5";
+            // 
+            // maskedTextBox1
+            // 
+            this.maskedTextBox1.Location = new System.Drawing.Point(12, 188);
+            this.maskedTextBox1.Name = "maskedTextBox1";
+            this.maskedTextBox1.PasswordChar = '*';
+            this.maskedTextBox1.Size = new System.Drawing.Size(210, 20);
+            this.maskedTextBox1.TabIndex = 11;
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(12, 214);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(210, 23);
+            this.button3.TabIndex = 12;
+            this.button3.Tag = "$AccountTestConnection";
+            this.button3.Text = "button3";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(12, 240);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(35, 13);
+            this.label6.TabIndex = 13;
+            this.label6.Tag = "$Empty";
+            this.label6.Text = "label6";
+            // 
+            // Settings_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(234, 315);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.button3);
+            this.Controls.Add(this.maskedTextBox1);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.comboBox1);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.checkBox1);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.label1);
+            this.Name = "Settings_Form";
+            this.Tag = "$Settings";
+            this.Text = "Settings_Form";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Settings_Form_FormClosing);
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Settings_Form_FormClosed);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.CheckBox checkBox1;
+        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.MaskedTextBox maskedTextBox1;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Label label6;
+    }
+}

+ 77 - 0
FactorioModManager/Settings_Form.cs

@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FactorioModManager
+{
+    public partial class Settings_Form : Form
+    {
+        F_API api;
+        public Settings_Form()
+        {
+            InitializeComponent();
+            this.DialogResult = DialogResult.Cancel;
+            textBox1.Text = Settings.GamePath;
+            checkBox1.Checked = Settings.ConnectAfterStart;
+            foreach(string lang in LanguageManager.AvailableLangs)
+            {
+                comboBox1.Items.Add(lang);
+            }
+            comboBox1.SelectedIndex = LanguageManager.AvailableLangs.FindIndex(x => x == Settings.LastLanguage);
+            textBox2.Text = Settings.Account.Username;
+            maskedTextBox1.Text = Settings.Account.Password;
+            
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            Settings.GamePath = textBox1.Text;
+            Settings.ConnectAfterStart = checkBox1.Checked;
+            if(LanguageManager.AvailableLangs.Count>0)
+                Settings.LastLanguage = LanguageManager.AvailableLangs[comboBox1.SelectedIndex];
+            Settings.Account = new Account(textBox2.Text, maskedTextBox1.Text);
+            this.DialogResult = DialogResult.OK;
+        }
+
+        private void Settings_Form_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            
+        }
+
+        private void Settings_Form_FormClosing(object sender, FormClosingEventArgs e)
+        {
+
+        }
+
+        private void button3_Click(object sender, EventArgs e)
+        {
+            api = new F_API(new Account(textBox2.Text, maskedTextBox1.Text));
+            api.Connected += (bool success) =>
+            {
+                if(success) label6.Text = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Connected");
+                else label6.Text = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$NotConnected");
+            };
+            label6.Text = LanguageManager.GetStrinByTag(Settings.LastLanguage, "$Connection");
+            api.Connect();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            folderBrowserDialog1.ShowNewFolderButton = false;
+            folderBrowserDialog1.RootFolder = Environment.SpecialFolder.ApplicationData;
+            if(Directory.Exists(@"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Factorio\mods"))
+                folderBrowserDialog1.SelectedPath = @"C:\Users\"+Environment.UserName+@"\AppData\Roaming\Factorio\mods";
+            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
+            {
+                textBox1.Text = folderBrowserDialog1.SelectedPath;
+            }
+        }
+    }
+}

+ 123 - 0
FactorioModManager/Settings_Form.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 3 - 24
FactorioModManager/app.config

@@ -1,27 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
-<configSections>
-    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
-        <section name="FactorioModManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
-    </sectionGroup>
-</configSections>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup><userSettings>
-        <FactorioModManager.Properties.Settings>
-            <setting name="username" serializeAs="String">
-                <value>didenkods@yandex.ru</value>
-            </setting>
-            <setting name="token" serializeAs="String">
-                <value />
-            </setting>
-            <setting name="autoUpdateMods" serializeAs="String">
-                <value>True</value>
-            </setting>
-            <setting name="autoLoadInfo" serializeAs="String">
-                <value>False</value>
-            </setting>
-            <setting name="saveToken" serializeAs="String">
-                <value>True</value>
-            </setting>
-        </FactorioModManager.Properties.Settings>
-    </userSettings>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
+    </startup>
 </configuration>

+ 11 - 0
FactorioModManager/mod-list.cs

@@ -17,10 +17,21 @@ namespace FactorioModManager
         public string name;
         public bool enabled;
         public string title;
+        public int[] versions;
+        public string[] dependencies;
+        public string version;
+        public string globalVersion;
+        public bool isUpdate = false;
         public Mod(string name, bool enabled)
         {
             this.name = name;
             this.enabled = enabled;
         }
+
+        public void ConvertVersion()
+        {
+            string[] splt = version.Split('.');
+            versions = new int[] { Convert.ToInt32(splt[0]), Convert.ToInt32(splt[1]), Convert.ToInt32(splt[2])};
+        }
     }
 }

+ 2 - 2
FactorioModManager/packages.config

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="DotNetZip" version="1.13.3" targetFramework="net45" />
-  <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
+  <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net47" />
+  <package id="System.IO.Compression" version="4.3.0" targetFramework="net47" />
 </packages>