diff --git a/.vs/FloatToolGUI/v16/.suo b/.vs/FloatToolGUI/v16/.suo index b7edae5..3a8359b 100644 Binary files a/.vs/FloatToolGUI/v16/.suo and b/.vs/FloatToolGUI/v16/.suo differ diff --git a/FloatToolGUI/Benchmark.Designer.cs b/FloatToolGUI/Benchmark.Designer.cs index d9ee385..bdd6302 100644 --- a/FloatToolGUI/Benchmark.Designer.cs +++ b/FloatToolGUI/Benchmark.Designer.cs @@ -41,20 +41,24 @@ private void InitializeComponent() this.panel1 = new System.Windows.Forms.Panel(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); + this.panel10 = new System.Windows.Forms.Panel(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); this.Updater = new System.Windows.Forms.Timer(this.components); this.customProgressBar1 = new FloatToolGUI.CustomProgressBar(); this.panel4 = new System.Windows.Forms.Panel(); this.label8 = new System.Windows.Forms.Label(); this.closeBtn = new System.Windows.Forms.Button(); this.panel3 = new System.Windows.Forms.Panel(); - this.panel10 = new System.Windows.Forms.Panel(); - this.label17 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); this.flowLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); + this.panel10.SuspendLayout(); this.panel4.SuspendLayout(); this.panel3.SuspendLayout(); - this.panel10.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // // startBenchmarkBtn @@ -62,7 +66,7 @@ private void InitializeComponent() this.startBenchmarkBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.startBenchmarkBtn.FlatAppearance.BorderSize = 0; this.startBenchmarkBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.startBenchmarkBtn.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.startBenchmarkBtn.Font = new System.Drawing.Font("Inter", 14.25F); this.startBenchmarkBtn.ForeColor = System.Drawing.Color.White; this.startBenchmarkBtn.Location = new System.Drawing.Point(394, 255); this.startBenchmarkBtn.Name = "startBenchmarkBtn"; @@ -78,7 +82,7 @@ private void InitializeComponent() this.submitScoreBtn.Enabled = false; this.submitScoreBtn.FlatAppearance.BorderSize = 0; this.submitScoreBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.submitScoreBtn.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F); + this.submitScoreBtn.Font = new System.Drawing.Font("Inter", 12F); this.submitScoreBtn.ForeColor = System.Drawing.Color.White; this.submitScoreBtn.Location = new System.Drawing.Point(394, 221); this.submitScoreBtn.Name = "submitScoreBtn"; @@ -91,11 +95,10 @@ private void InitializeComponent() // cpuNameLabel // this.cpuNameLabel.AutoSize = true; - this.cpuNameLabel.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 11F); this.cpuNameLabel.ForeColor = System.Drawing.Color.White; this.cpuNameLabel.Location = new System.Drawing.Point(390, 9); this.cpuNameLabel.Name = "cpuNameLabel"; - this.cpuNameLabel.Size = new System.Drawing.Size(137, 19); + this.cpuNameLabel.Size = new System.Drawing.Size(144, 19); this.cpuNameLabel.TabIndex = 3; this.cpuNameLabel.Text = "AMD Ryzen 5 2600"; this.cpuNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -103,11 +106,10 @@ private void InitializeComponent() // threadCountLabel // this.threadCountLabel.AutoSize = true; - this.threadCountLabel.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.threadCountLabel.ForeColor = System.Drawing.Color.White; this.threadCountLabel.Location = new System.Drawing.Point(390, 28); this.threadCountLabel.Name = "threadCountLabel"; - this.threadCountLabel.Size = new System.Drawing.Size(93, 20); + this.threadCountLabel.Size = new System.Drawing.Size(91, 19); this.threadCountLabel.TabIndex = 3; this.threadCountLabel.Text = "12 Потоков"; this.threadCountLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -115,11 +117,10 @@ private void InitializeComponent() // versionLabel2 // this.versionLabel2.AutoSize = true; - this.versionLabel2.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.versionLabel2.ForeColor = System.Drawing.Color.White; this.versionLabel2.Location = new System.Drawing.Point(390, 48); this.versionLabel2.Name = "versionLabel2"; - this.versionLabel2.Size = new System.Drawing.Size(93, 20); + this.versionLabel2.Size = new System.Drawing.Size(90, 19); this.versionLabel2.TabIndex = 3; this.versionLabel2.Text = "v.0.5.0 beta"; this.versionLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -127,11 +128,10 @@ private void InitializeComponent() // label4 // this.label4.AutoSize = true; - this.label4.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.ForeColor = System.Drawing.Color.White; this.label4.Location = new System.Drawing.Point(390, 151); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(84, 20); + this.label4.Size = new System.Drawing.Size(83, 19); this.label4.TabIndex = 3; this.label4.Text = "Скорость:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -139,11 +139,10 @@ private void InitializeComponent() // speedLabel // this.speedLabel.AutoSize = true; - this.speedLabel.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.speedLabel.ForeColor = System.Drawing.Color.White; this.speedLabel.Location = new System.Drawing.Point(390, 171); this.speedLabel.Name = "speedLabel"; - this.speedLabel.Size = new System.Drawing.Size(45, 20); + this.speedLabel.Size = new System.Drawing.Size(43, 19); this.speedLabel.TabIndex = 3; this.speedLabel.Text = "0 к/с"; this.speedLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -154,6 +153,7 @@ private void InitializeComponent() this.flowLayoutPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(26)))), ((int)(((byte)(26))))); this.flowLayoutPanel1.Controls.Add(this.panel1); this.flowLayoutPanel1.Controls.Add(this.panel10); + this.flowLayoutPanel1.Controls.Add(this.panel2); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Left; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowLayoutPanel1.ForeColor = System.Drawing.Color.White; @@ -178,11 +178,11 @@ private void InitializeComponent() // label7 // this.label7.AutoSize = true; - this.label7.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F); + this.label7.Font = new System.Drawing.Font("Inter", 8F); this.label7.ForeColor = System.Drawing.Color.White; this.label7.Location = new System.Drawing.Point(3, 18); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(128, 14); + this.label7.Size = new System.Drawing.Size(142, 14); this.label7.TabIndex = 3; this.label7.Text = "1021779 к/с (v.0.5.0 beta)"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -190,16 +190,53 @@ private void InitializeComponent() // label6 // this.label6.AutoSize = true; - this.label6.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F); + this.label6.Font = new System.Drawing.Font("Inter", 8F); this.label6.ForeColor = System.Drawing.Color.White; this.label6.Location = new System.Drawing.Point(3, 3); this.label6.Margin = new System.Windows.Forms.Padding(0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(260, 14); + this.label6.Size = new System.Drawing.Size(281, 14); this.label6.TabIndex = 3; this.label6.Text = "AMD Ryzen 5 2600 Six-Core Processor (12 Threads)"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // panel10 + // + this.panel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(125)))), ((int)(((byte)(195))))); + this.panel10.Controls.Add(this.label17); + this.panel10.Controls.Add(this.label18); + this.panel10.ForeColor = System.Drawing.Color.Black; + this.panel10.Location = new System.Drawing.Point(10, 52); + this.panel10.Margin = new System.Windows.Forms.Padding(0, 2, 0, 3); + this.panel10.Name = "panel10"; + this.panel10.Size = new System.Drawing.Size(350, 35); + this.panel10.TabIndex = 19; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Font = new System.Drawing.Font("Inter", 8F); + this.label17.ForeColor = System.Drawing.Color.White; + this.label17.Location = new System.Drawing.Point(3, 18); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(141, 14); + this.label17.TabIndex = 3; + this.label17.Text = "934030 к/с (v.0.5.0 beta)"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Font = new System.Drawing.Font("Inter", 8F); + this.label18.ForeColor = System.Drawing.Color.White; + this.label18.Location = new System.Drawing.Point(3, 3); + this.label18.Margin = new System.Windows.Forms.Padding(0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(310, 14); + this.label18.TabIndex = 3; + this.label18.Text = "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // Updater // this.Updater.Enabled = true; @@ -215,7 +252,7 @@ private void InitializeComponent() this.customProgressBar1.Minimum = 0; this.customProgressBar1.Name = "customProgressBar1"; this.customProgressBar1.ProgressColor = System.Drawing.Color.Green; - this.customProgressBar1.ProgressFont = new System.Drawing.Font("Microsoft JhengHei UI", 11.25F, System.Drawing.FontStyle.Bold); + this.customProgressBar1.ProgressFont = new System.Drawing.Font("Inter", 11.25F, System.Drawing.FontStyle.Bold); this.customProgressBar1.Size = new System.Drawing.Size(304, 24); this.customProgressBar1.TabIndex = 0; this.customProgressBar1.Value = 0F; @@ -233,6 +270,7 @@ private void InitializeComponent() this.panel4.Controls.Add(this.label4); this.panel4.Controls.Add(this.speedLabel); this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel4.Font = new System.Drawing.Font("Inter", 11F); this.panel4.Location = new System.Drawing.Point(0, 40); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(704, 333); @@ -242,12 +280,12 @@ private void InitializeComponent() // this.label8.AutoSize = true; this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("Microsoft JhengHei Light", 22F); + this.label8.Font = new System.Drawing.Font("Inter", 22F); this.label8.ForeColor = System.Drawing.Color.White; this.label8.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.label8.Location = new System.Drawing.Point(1, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(154, 38); + this.label8.Size = new System.Drawing.Size(160, 36); this.label8.TabIndex = 0; this.label8.Text = "Бенчмарк"; this.label8.MouseDown += new System.Windows.Forms.MouseEventHandler(this.DragWindowMouseDown); @@ -260,7 +298,7 @@ private void InitializeComponent() this.closeBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); this.closeBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black; this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.closeBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 16F); + this.closeBtn.Font = new System.Drawing.Font("Inter", 16F); this.closeBtn.ForeColor = System.Drawing.Color.White; this.closeBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.closeBtn.Location = new System.Drawing.Point(664, 0); @@ -283,41 +321,42 @@ private void InitializeComponent() this.panel3.TabIndex = 5; this.panel3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.DragWindowMouseDown); // - // panel10 - // - this.panel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(125)))), ((int)(((byte)(195))))); - this.panel10.Controls.Add(this.label17); - this.panel10.Controls.Add(this.label18); - this.panel10.Location = new System.Drawing.Point(10, 52); - this.panel10.Margin = new System.Windows.Forms.Padding(0, 2, 0, 3); - this.panel10.Name = "panel10"; - this.panel10.Size = new System.Drawing.Size(350, 35); - this.panel10.TabIndex = 19; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F); - this.label17.ForeColor = System.Drawing.Color.White; - this.label17.Location = new System.Drawing.Point(3, 18); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(126, 14); - this.label17.TabIndex = 3; - this.label17.Text = "934030 к/с (v.0.5.0 beta)"; - this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label18 - // - this.label18.AutoSize = true; - this.label18.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F); - this.label18.ForeColor = System.Drawing.Color.White; - this.label18.Location = new System.Drawing.Point(3, 3); - this.label18.Margin = new System.Windows.Forms.Padding(0); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(289, 14); - this.label18.TabIndex = 3; - this.label18.Text = "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)"; - this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(185)))), ((int)(((byte)(0))))); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label2); + this.panel2.ForeColor = System.Drawing.Color.Black; + this.panel2.Location = new System.Drawing.Point(10, 92); + this.panel2.Margin = new System.Windows.Forms.Padding(0, 2, 0, 3); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(350, 35); + this.panel2.TabIndex = 20; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Inter", 8F); + this.label1.ForeColor = System.Drawing.Color.Black; + this.label1.Location = new System.Drawing.Point(3, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(133, 14); + this.label1.TabIndex = 3; + this.label1.Text = "10000 к/с (CUDA alpha)"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Inter", 8F); + this.label2.ForeColor = System.Drawing.Color.Black; + this.label2.Location = new System.Drawing.Point(3, 3); + this.label2.Margin = new System.Windows.Forms.Padding(0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(259, 14); + this.label2.TabIndex = 3; + this.label2.Text = "NVidia GeForce GTX 1660 Ti (1536 CUDA Cores)"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // Benchmark // @@ -334,12 +373,14 @@ private void InitializeComponent() this.flowLayoutPanel1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); + this.panel10.ResumeLayout(false); + this.panel10.PerformLayout(); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); - this.panel10.ResumeLayout(false); - this.panel10.PerformLayout(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); this.ResumeLayout(false); } @@ -366,5 +407,8 @@ private void InitializeComponent() private System.Windows.Forms.Panel panel10; private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label18; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/FloatToolGUI/Benchmark.cs b/FloatToolGUI/Benchmark.cs index d169714..dbc354c 100644 --- a/FloatToolGUI/Benchmark.cs +++ b/FloatToolGUI/Benchmark.cs @@ -14,48 +14,12 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using static FloatToolGUI.Calculation; namespace FloatToolGUI { public partial class Benchmark : Form { - private static bool NextCombination(IList num, int n, int k) - { - bool finished; - var changed = finished = false; - if (k <= 0) return false; - for (var i = k - 1; !finished && !changed; i--) - { - if (num[i] < n - 1 - (k - 1) + i) - { - num[i]++; - if (i < k - 1) - for (var j = i + 1; j < k; j++) - num[j] = num[j - 1] + 1; - changed = true; - } - finished = i == 0; - } - return changed; - } - - private static IEnumerable Combinations(IEnumerable elements, int k, int start, int skip) - { - var elem = elements.ToArray(); - var size = elem.Length; - if (k > size) yield break; - var numbers = new int[k]; - for (var i = 0; i < k; i++) - numbers[i] = i; - int step = 0; - do - { - if ((step + start) % skip == 0) - yield return numbers.Select(n => elem[n]); - step++; - } while (NextCombination(numbers, size, k)); - } - public enum SearchMode { Less, @@ -64,62 +28,6 @@ public enum SearchMode } SearchMode CurrentSearchMode = SearchMode.Equal; - public static string setprecission(double number, int figures) - { - int e = 0; - while (number >= 10.0) - { - e += 1; - number /= 10; - } - while (number < 1.0) - { - e -= 1; - number *= 10; - } - figures--; - number = (float)Math.Round(number, figures); - figures += 0 - e; - while (e > 0) - { - number *= 10; - e -= 1; - } - while (e < 0) - { - number /= 10; - e += 1; - } - if (figures < 0) - figures = 0; - return number.ToString($"f{figures}", CultureInfo.InvariantCulture); - } - static public decimal craft(List ingridients, float minFloat, float maxFloat) - { - decimal avgFloat = 0; - foreach (InputSkin f in ingridients) - { - avgFloat += (decimal)f.WearValue; - } - avgFloat /= 10; - return ((decimal)(maxFloat - minFloat) * avgFloat) + (decimal)minFloat; - } - static public string craftF(List ingridients, float minFloat, float maxFloat) - { - float avgFloat = 0; - float[] arrInput = new float[10]; - for (int i = 0; i < 10; i++) - { - arrInput[i] = Convert.ToSingle(ingridients[i].WearValue); - } - foreach (float f in arrInput) - { - avgFloat += Convert.ToSingle(f); - } - avgFloat /= 10; - return setprecission(((maxFloat - minFloat) * avgFloat) + minFloat, 10); - } - public void parseCraft(List inputs, List outputs, string want) { //List results = new List(); @@ -162,6 +70,7 @@ private void runCycle() private void StartCalculation() { + Logger.Log($"[{DateTime.Now}]: Started benchmark"); currComb = 0; List outcomes = new List(); outcomes.Add(new Skin("AK-47 | Safari Mesh", 0.06f, 0.8f, Quality.Industrial)); @@ -218,7 +127,7 @@ private void StartCalculation() timer.Stop(); TimeSpan timespan = timer.Elapsed; - + Logger.Log($"[{DateTime.Now}]: Benchmark ended, speed = {Math.Round(currComb / timespan.TotalSeconds)}"); Invoke((MethodInvoker)(() => { submitScoreBtn.Enabled = true; @@ -232,14 +141,16 @@ private void StartCalculation() public Benchmark(string version) { InitializeComponent(); + Logger.Log($"[{DateTime.Now}]: Opened benchmark window"); versionLabel2.Text = version; threadCountLabel.Text = $"{Environment.ProcessorCount} Threads"; ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor"); foreach (ManagementObject mo in mos.Get()) cpuNameLabel.Text = mo["Name"].ToString().Trim(); - + Logger.Log($"[{DateTime.Now}]: CPU Name: {cpuNameLabel.Text} ({threadCountLabel.Text})"); thread1 = new Thread(runCycle); LoadStats(); + } private void startBenchmarkBtn_Click(object sender, EventArgs e) @@ -254,23 +165,23 @@ private void Updater_Tick(object sender, EventArgs e) customProgressBar1.Value = currComb; } - string uri = "https://prevterapi.000webhostapp.com/"; + string uri = "http://prevter.tk/"; - private void AddCpuToList(string cpu, string speed, string ver) + private void AddCpuToList(string cpu, string speed, string ver, bool bigMargin) { - Color backColor = cpu.Contains("AMD") ? Color.FromArgb(157, 0, 20) : (cpu.Contains("Intel") ? Color.FromArgb(0, 125, 195) : Color.FromArgb(56, 56, 56)); - Color foreColor = Color.White; + Color backColor = cpu.Contains("AMD") ? Color.FromArgb(157, 0, 20) : (cpu.Contains("Intel") ? Color.FromArgb(0, 125, 195) : (cpu.Contains("NVidia") ? Color.FromArgb(118, 185, 0) : Color.FromArgb(56, 56, 56))); + Color foreColor = cpu.Contains("NVidia") ? Color.Black : Color.White; var tmpPanel = new Panel { BackColor = backColor, Size = new Size(350, 35), - Margin = new Padding(0,0,0,5) + Margin = new Padding(0,0,0,bigMargin?20:5) }; tmpPanel.Controls.Add(new Label { Location = new Point(3,3), - Font = new Font("Microsoft JhengHei UI Light", 8f), + Font = new Font("Inter", 8f), Text = cpu, AutoSize = true, ForeColor = foreColor @@ -278,7 +189,7 @@ private void AddCpuToList(string cpu, string speed, string ver) tmpPanel.Controls.Add(new Label { Location = new Point(3, 18), - Font = new Font("Microsoft JhengHei UI Light", 8f), + Font = new Font("Inter", 8f), Text = $"{speed} к/с ({ver})", AutoSize = true, ForeColor = foreColor @@ -288,40 +199,69 @@ private void AddCpuToList(string cpu, string speed, string ver) private void LoadStats() { - flowLayoutPanel1.Controls.Clear(); - WebRequest request = WebRequest.Create($"{uri}getBenchmarks.php"); - request.Credentials = CredentialCache.DefaultCredentials; - WebResponse response = request.GetResponse(); - - using (Stream dataStream = response.GetResponseStream()) + try { - StreamReader reader = new StreamReader(dataStream); - string responseFromServer = reader.ReadToEnd(); - Console.WriteLine(responseFromServer); - if(responseFromServer.Contains('|')) + flowLayoutPanel1.Controls.Clear(); + WebRequest request = WebRequest.Create($"{uri}getBenchmarks.php"); + request.Credentials = CredentialCache.DefaultCredentials; + WebResponse response = request.GetResponse(); + + using (Stream dataStream = response.GetResponseStream()) { - foreach (var cpu in responseFromServer.Remove(responseFromServer.Length - 1).Split('&')) + StreamReader reader = new StreamReader(dataStream); + string responseFromServer = reader.ReadToEnd(); + Logger.Log($"[{DateTime.Now}]: Loaded benchmark scores"); + Console.WriteLine(responseFromServer); + if(responseFromServer.Contains('|')) { - var items = cpu.Split('|'); - AddCpuToList(items[0], items[1], items[2]); + var results = responseFromServer.Remove(responseFromServer.Length - 1).Split('&'); + int index = 0; + foreach (var cpu in results) + { + index++; + var items = cpu.Split('|'); + AddCpuToList(items[0], items[1], items[2], index== results.Length); + } } } + response.Close(); + } + catch(Exception ex) + { + flowLayoutPanel1.Controls.Add(new Label + { + Text = "Произошла ошибка подключения", + AutoSize = true, + ForeColor = Color.White + }); + + Logger.Log($"[{DateTime.Now}]: {{EXCEPTION}} {ex.Message}{Environment.NewLine}{ex.StackTrace}"); + Logger.SaveCrashReport(); } - response.Close(); } private void submitScoreBtn_Click(object sender, EventArgs e) { - submitScoreBtn.Enabled = false; - HttpWebRequest req = (HttpWebRequest)WebRequest.Create($"{uri}addBenchmark.php?cpu={cpuNameLabel.Text} ({threadCountLabel.Text})&speed={speedLabel.Text.Split(' ')[0]}"); - req.UserAgent = $"FloatTool/{versionLabel2.Text}"; - HttpWebResponse res = (HttpWebResponse)req.GetResponse(); - res.Close(); - MessageBox.Show("Ваш результат был принят."); + try + { + submitScoreBtn.Enabled = false; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create($"{uri}addBenchmark.php?cpu={cpuNameLabel.Text} ({threadCountLabel.Text})&speed={speedLabel.Text.Split(' ')[0]}"); + req.UserAgent = $"FloatTool/{versionLabel2.Text}"; + HttpWebResponse res = (HttpWebResponse)req.GetResponse(); + res.Close(); + MessageBox.Show("Ваш результат был принят."); + Logger.Log($"[{DateTime.Now}] Recorded benchmark score: {speedLabel.Text.Split(' ')[0]}"); + } + catch (Exception ex) + { + Logger.Log($"[{DateTime.Now}]: {{EXCEPTION}} {ex.Message}{Environment.NewLine}{ex.StackTrace}"); + Logger.SaveCrashReport(); + } } private void closeBtn_Click(object sender, EventArgs e) { + Logger.Log($"[{DateTime.Now}]: Benchmark window closed"); Close(); } @@ -342,20 +282,5 @@ private void DragWindowMouseDown(object sender, MouseEventArgs e) SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); } } - - private void panel7_Paint(object sender, PaintEventArgs e) - { - - } - - private void panel9_Paint(object sender, PaintEventArgs e) - { - - } - - private void panel7_Paint_1(object sender, PaintEventArgs e) - { - - } } } diff --git a/FloatToolGUI/Calculation.cs b/FloatToolGUI/Calculation.cs new file mode 100644 index 0000000..562c3e7 --- /dev/null +++ b/FloatToolGUI/Calculation.cs @@ -0,0 +1,198 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FloatToolGUI +{ + static class Calculation + { + /// + /// Calculates wear value based of input skins and min/max value of outcome + /// + /// List of 10 skins + /// Minimal wear value of skin that is going to be crafted + /// Maximum wear value of skin that is going to be crafted + /// Wear value represented in decimal type + static public decimal craft(List ingridients, float minFloat, float maxFloat) + { + decimal avgFloat = 0; + foreach (InputSkin f in ingridients) + { + avgFloat += (decimal)f.WearValue; + } + avgFloat /= 10; + return ((decimal)(maxFloat - minFloat) * avgFloat) + (decimal)minFloat; + } + + /// + /// Does same job as craft(List, float, float), but uses float as type + /// + /// List of 10 skins + /// Minimal wear value of skin that is going to be crafted + /// Maximum wear value of skin that is going to be crafted + /// Float wear value in string + static public string craftF(List ingridients, float minFloat, float maxFloat) + { + float avgFloat = 0; + float[] arrInput = new float[10]; + for (int i = 0; i < 10; i++) + { + arrInput[i] = Convert.ToSingle(ingridients[i].WearValue); + } + foreach (float f in arrInput) + { + avgFloat += Convert.ToSingle(f); + } + avgFloat /= 10; + return setprecission(((maxFloat - minFloat) * avgFloat) + minFloat, 10); + } + + public static string setprecission(double number, int figures) + { + int e = 0; + while (number >= 10.0) + { + e += 1; + number /= 10; + } + while (number < 1.0) + { + e -= 1; + number *= 10; + } + figures--; + number = (float)Math.Round(number, figures); + figures += 0 - e; + while (e > 0) + { + number *= 10; + e -= 1; + } + while (e < 0) + { + number /= 10; + e += 1; + } + if (figures < 0) + figures = 0; + return number.ToString($"f{figures}", CultureInfo.InvariantCulture); + } + + public static Quality FromString(string value) + { + if (value == "Consumer") return Quality.Consumer; + else if (value == "Industrial") return Quality.Industrial; + else if (value == "Mil-Spec") return Quality.MilSpec; + else if (value == "Restricted") return Quality.Restricted; + else if (value == "Classified") return Quality.Classified; + else return Quality.Covert; + } + + public static List[] GroupOutcomes(List skins) + { + var allList = new List>(); //List with all outcomes + float[] currIter = { 0f, 1f }; //Last iteration wear range + List floatRanges = new List(); //List of all ranges that has been parsed + + foreach (var skin in skins) + { + float[] curr = { skin["maxWear"], skin["minWear"] }; + List list = new List(); + if (curr.SequenceEqual(currIter) || floatRanges.Any(x => (x.SequenceEqual(curr)))) continue; //If range already exists + else + { + currIter = curr; + floatRanges.Add(currIter); + } + foreach (var skin1 in skins) + if ((skin["maxWear"] == skin1["maxWear"]) && (skin["minWear"] == skin1["minWear"])) + list.Add(new Skin(skin1["name"].ToString(), float.Parse(skin1["minWear"].ToString().Replace('.', ',')), float.Parse(skin1["maxWear"].ToString().Replace('.', ',')), FromString(skin1["rarity"].ToString().Split(' ')[0]))); + allList.Add(list); + } + + return allList.ToArray(); + } + + static public bool NextCombination(IList num, int n, int k) + { + bool finished; + var changed = finished = false; + if (k <= 0) return false; + for (var i = k - 1; !finished && !changed; i--) + { + if (num[i] < n - 1 - (k - 1) + i) + { + num[i]++; + if (i < k - 1) + for (var j = i + 1; j < k; j++) + num[j] = num[j - 1] + 1; + changed = true; + } + finished = i == 0; + } + return changed; + } + + static public IEnumerable Combinations(IEnumerable elements, int k, int start, int skip) + { + var elem = elements.ToArray(); + var size = elem.Length; + if (k > size) yield break; + var numbers = new int[k]; + for (var i = 0; i < k; i++) + numbers[i] = i; + int step = 0; + do + { + if ((step + start) % skip == 0) + yield return numbers.Select(n => elem[n]); + step++; + } while (NextCombination(numbers, size, k)); + } + + private static IEnumerable CombinationsRosettaWoRecursion(int m, int n) + { + int[] result = new int[m]; + Stack stack = new Stack(m); + stack.Push(0); + while (stack.Count > 0) + { + int index = stack.Count - 1; + int value = stack.Pop(); + while (value < n) + { + result[index++] = value++; + stack.Push(value); + if (index != m) continue; + yield return (int[])result.Clone(); + break; + } + } + } + public static IEnumerable CombinationsRosettaWoRecursion(T[] array, int m, int startIndex, int skip) + { + if (array.Length < m) + throw new ArgumentException("Array length can't be less than number of selected elements"); + if (m < 1) + throw new ArgumentException("Number of selected elements can't be less than 1"); + T[] result = new T[m]; + int index = 0; + foreach (int[] j in CombinationsRosettaWoRecursion(m, array.Length)) + { + index++; + if ((index - startIndex) % skip != 0) continue; + index = 0; + + for (int i = 0; i < m; i++) + { + result[i] = array[j[i]]; + } + yield return result; + } + } + } +} diff --git a/FloatToolGUI/FloatToolGUI.csproj b/FloatToolGUI/FloatToolGUI.csproj index 27d3004..7cb64a7 100644 --- a/FloatToolGUI/FloatToolGUI.csproj +++ b/FloatToolGUI/FloatToolGUI.csproj @@ -81,9 +81,11 @@ ..\packages\DiscordRichPresence.1.0.175\lib\net35\DiscordRPC.dll + False ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + False @@ -108,6 +110,7 @@ Benchmark.cs + UserControl @@ -121,6 +124,7 @@ CustomToggleSwitch.cs + Form @@ -129,6 +133,11 @@ + + True + True + Resources.resx + Form @@ -158,14 +167,9 @@ ResXFileCodeGenerator - Resources.Designer.cs Designer + Resources.Designer.cs - - True - Resources.resx - True - @@ -189,7 +193,10 @@ - + + Always + + diff --git a/FloatToolGUI/Logger.cs b/FloatToolGUI/Logger.cs new file mode 100644 index 0000000..caa89ac --- /dev/null +++ b/FloatToolGUI/Logger.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FloatToolGUI +{ + static class Logger + { + static public void Log(object data) + { + using (StreamWriter w = File.AppendText("debug.log")) + { + w.WriteLine(data); + } + } + + static public void SaveCrashReport() + { + Directory.CreateDirectory("crashreports"); + File.Copy("debug.log", @$"crashreports{Path.DirectorySeparatorChar}{DateTime.Now.ToString().Replace(' ', '_').Replace(':', '-')}.log"); + } + + static public void ClearLogs() + { + File.WriteAllText("debug.log", string.Empty); + } + } +} diff --git a/FloatToolGUI/Main.Designer.cs b/FloatToolGUI/Main.Designer.cs index d9e0d4e..044208c 100644 --- a/FloatToolGUI/Main.Designer.cs +++ b/FloatToolGUI/Main.Designer.cs @@ -50,7 +50,7 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FloatTool)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.foundCombinationContainer = new System.Windows.Forms.FlowLayoutPanel(); this.outputConsoleBox = new System.Windows.Forms.TextBox(); this.DiscordUpdater = new System.Windows.Forms.Timer(this.components); this.panel1 = new System.Windows.Forms.Panel(); @@ -144,7 +144,7 @@ private void InitializeComponent() // splitContainer1.Panel1 // this.splitContainer1.Panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31))))); - this.splitContainer1.Panel1.Controls.Add(this.flowLayoutPanel1); + this.splitContainer1.Panel1.Controls.Add(this.foundCombinationContainer); resources.ApplyResources(this.splitContainer1.Panel1, "splitContainer1.Panel1"); // // splitContainer1.Panel2 @@ -153,11 +153,11 @@ private void InitializeComponent() this.splitContainer1.Panel2.Controls.Add(this.outputConsoleBox); resources.ApplyResources(this.splitContainer1.Panel2, "splitContainer1.Panel2"); // - // flowLayoutPanel1 + // foundCombinationContainer // - resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); - this.flowLayoutPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(37)))), ((int)(((byte)(37))))); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + resources.ApplyResources(this.foundCombinationContainer, "foundCombinationContainer"); + this.foundCombinationContainer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(37)))), ((int)(((byte)(37))))); + this.foundCombinationContainer.Name = "foundCombinationContainer"; // // outputConsoleBox // @@ -236,12 +236,11 @@ private void InitializeComponent() this.panel9.Controls.Add(this.closeBtn); resources.ApplyResources(this.panel9, "panel9"); this.panel9.Name = "panel9"; - this.panel9.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel9_MouseDown); + this.panel9.MouseDown += new System.Windows.Forms.MouseEventHandler(this.WindowDragEvent); // // benchmarkButton // this.benchmarkButton.BackColor = System.Drawing.Color.Transparent; - this.benchmarkButton.BackgroundImage = global::FloatToolGUI.Properties.Resources.benchmarkWhite; resources.ApplyResources(this.benchmarkButton, "benchmarkButton"); this.benchmarkButton.FlatAppearance.BorderSize = 0; this.benchmarkButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); @@ -254,7 +253,6 @@ private void InitializeComponent() // settingsButton // this.settingsButton.BackColor = System.Drawing.Color.Transparent; - this.settingsButton.BackgroundImage = global::FloatToolGUI.Properties.Resources.gearWhite; resources.ApplyResources(this.settingsButton, "settingsButton"); this.settingsButton.FlatAppearance.BorderSize = 0; this.settingsButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); @@ -335,7 +333,7 @@ private void InitializeComponent() this.panel3.Controls.Add(this.label8); resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; - this.panel3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel3_MouseDown); + this.panel3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.WindowDragEvent); // // label24 // @@ -420,7 +418,7 @@ private void InitializeComponent() resources.GetString("weaponQualityBox.Items3"), resources.GetString("weaponQualityBox.Items4")}); this.weaponQualityBox.Name = "weaponQualityBox"; - this.weaponQualityBox.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged); + this.weaponQualityBox.SelectedIndexChanged += new System.EventHandler(this.SkinComboboxChanged); // // label12 // @@ -513,7 +511,7 @@ private void InitializeComponent() this.weaponSkinBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this.weaponSkinBox.FormattingEnabled = true; this.weaponSkinBox.Name = "weaponSkinBox"; - this.weaponSkinBox.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged); + this.weaponSkinBox.SelectedIndexChanged += new System.EventHandler(this.SkinComboboxChanged); // // panel5 // @@ -668,7 +666,7 @@ private void InitializeComponent() this.startBtn.ForeColor = System.Drawing.Color.White; this.startBtn.Name = "startBtn"; this.startBtn.UseVisualStyleBackColor = false; - this.startBtn.Click += new System.EventHandler(this.button2_Click); + this.startBtn.Click += new System.EventHandler(this.StartButtonClick); // // panel15 // @@ -713,8 +711,8 @@ private void InitializeComponent() // this.threadCountInput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.threadCountInput.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.threadCountInput.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); resources.ApplyResources(this.threadCountInput, "threadCountInput"); + this.threadCountInput.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this.threadCountInput.Maximum = new decimal(new int[] { 1024, 0, @@ -761,7 +759,7 @@ private void InitializeComponent() this.downloadProgressBar.Minimum = 0; this.downloadProgressBar.Name = "downloadProgressBar"; this.downloadProgressBar.ProgressColor = System.Drawing.Color.Green; - this.downloadProgressBar.ProgressFont = new System.Drawing.Font("Microsoft JhengHei UI", 11.25F, System.Drawing.FontStyle.Bold); + this.downloadProgressBar.ProgressFont = new System.Drawing.Font("Inter", 11.25F, System.Drawing.FontStyle.Bold); this.downloadProgressBar.Value = 0F; // // stattrackCheckBox @@ -772,7 +770,7 @@ private void InitializeComponent() this.stattrackCheckBox.Name = "stattrackCheckBox"; this.stattrackCheckBox.TurnedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.stattrackCheckBox.TurnedOnColor = System.Drawing.Color.Green; - this.stattrackCheckBox.OnToggled += new System.EventHandler(this.checkBox1_CheckedChanged); + this.stattrackCheckBox.OnToggled += new System.EventHandler(this.SkinComboboxChanged); // // FloatTool // @@ -878,7 +876,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label12; private System.Windows.Forms.Button benchmarkButton; private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel foundCombinationContainer; private System.Windows.Forms.Label label24; } } diff --git a/FloatToolGUI/Main.cs b/FloatToolGUI/Main.cs index 9c055ed..ffc7181 100644 --- a/FloatToolGUI/Main.cs +++ b/FloatToolGUI/Main.cs @@ -1,6 +1,7 @@ using DiscordRPC; using FloatToolGUI.Resources; using static FloatToolGUI.Utils; +using static FloatToolGUI.Calculation; using Newtonsoft.Json; using System; using System.Collections; @@ -77,81 +78,6 @@ public enum SearchMode public Currency currentCurr = Currency.USD; public bool discordWorker = true; - public static string setprecission(double number, int figures) - { - int e = 0; - while (number >= 10.0) { - e += 1; - number /= 10; - } - while (number < 1.0) { - e -= 1; - number *= 10; - } - figures--; - number = (float)Math.Round(number, figures); - figures += 0 - e; - while (e > 0) { - number *= 10; - e -= 1; - } - while (e < 0) { - number /= 10; - e += 1; - } - if (figures < 0) - figures = 0; - return number.ToString($"f{figures}", CultureInfo.InvariantCulture); - } - static public decimal craft(List ingridients, float minFloat, float maxFloat) - { - decimal avgFloat = 0; - foreach (InputSkin f in ingridients) - { - avgFloat += (decimal)f.WearValue; - } - avgFloat /= 10; - return ((decimal)(maxFloat - minFloat) * avgFloat) + (decimal)minFloat; - } - static public string craftF(List ingridients, float minFloat, float maxFloat) - { - float avgFloat = 0; - float[] arrInput = new float[10]; - for (int i = 0; i < 10; i++) - { - arrInput[i] = Convert.ToSingle(ingridients[i].WearValue); - } - foreach (float f in arrInput) - { - avgFloat += Convert.ToSingle(f); - } - avgFloat /= 10; - return setprecission(((maxFloat - minFloat) * avgFloat) + minFloat, 10); - } - static public string getNextRarity(string rarity) - { - if (rarity == "Consumer") - { - return "Industrial"; - } - else if (rarity == "Industrial") - { - return "Mil-Spec"; - } - else if (rarity == "Mil-Spec") - { - return "Restricted"; - } - else if (rarity == "Restricted") - { - return "Classified"; - } - else if (rarity == "Classified") - { - return "Covert"; - } - return "Nothing"; - } static public string getSkinData(string name) { name = name.Replace("StatTrak™ ",""); //remove stattrack @@ -201,6 +127,13 @@ public void parseCraft(List inputs, List outputs, string want) floatStrings.Add(Math.Round(fl.WearValue, 14).ToString().Replace(",", ".")); price += fl.Price; } + + Logger.Log($"[{DateTime.Now.ToString()}]: Found coombination {{"); + Logger.Log($" Float = {flotOrigin}{newLine}" + + $" Test Float = {flot}{newLine}" + + $" Price = {price} {inputs[0].SkinCurrency}{newLine}" + + $" Float list = [{String.Join(", ", floatStrings)}]{newLine}}}"); + AddCombinationToList(DateTime.Now.ToString("HH:mm:ss"), flotOrigin, flot, price, floatStrings); ConsoleBuffer.Append($"[{DateTime.Now.ToString("HH:mm:ss")}] {strings.CombinationFound}{newLine}"); ConsoleBuffer.Append($"{strings.PossibleFloat}: {flotOrigin}{newLine}"); @@ -300,25 +233,57 @@ public void updateSearchStr() search += " (" + weaponQualityBox.Text + ")"; fullSkinName.Text = search; UpdateOutcomes(); + Logger.Log($"[{DateTime.Now.ToString()}]: Changed search skin to: {search}"); } RegistryKey registryData; public FloatTool() { InitializeComponent(); + Logger.ClearLogs(); + Logger.Log($"[{DateTime.Now}]: FloatTool-GUI {versionLabel.Text}"); SetStyle(ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); ConsoleBuffer = new StringBuilder(); newLine = Environment.NewLine; CheckRegistry(); + registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool"); - ChangeTheme(Convert.ToBoolean(registryData.GetValue("darkMode"))); - muteSound = !Convert.ToBoolean(registryData.GetValue("sound")); - WorkStatusUpdater.Interval = (int)registryData.GetValue("bufferSpeed"); - discordWorker = Convert.ToBoolean(registryData.GetValue("discordRPC")); - currentCurr = (Currency)registryData.GetValue("currency"); - if (Convert.ToBoolean(registryData.GetValue("updateCheck"))) + + var darkThemeRK = registryData.GetValue("darkMode"); + var soundRK = registryData.GetValue("sound"); + var bufferSpeedRK = registryData.GetValue("bufferSpeed"); + var discordRPCRK = registryData.GetValue("discordRPC"); + var currencyRK = registryData.GetValue("currency"); + var updateCheckRK = registryData.GetValue("updateCheck"); + + ChangeTheme(Convert.ToBoolean(darkThemeRK)); + muteSound = !Convert.ToBoolean(soundRK); + WorkStatusUpdater.Interval = (int)bufferSpeedRK; + discordWorker = Convert.ToBoolean(discordRPCRK); + currentCurr = (Currency)currencyRK; + + Logger.Log($"[{DateTime.Now}]: Loaded registry settings:"); + Logger.Log($"Dark mode = {darkThemeRK}"); + Logger.Log($"Sound = {soundRK}"); + Logger.Log($"Buffer speed = {bufferSpeedRK}"); + Logger.Log($"Discord RPC = {discordRPCRK}"); + Logger.Log($"Currency = {currencyRK}"); + Logger.Log($"Check updates = {updateCheckRK}"); + + if (Convert.ToBoolean(updateCheckRK)) { - string ver = CheckUpdates(); + string ver = versionLabel.Text; + try + { + ver = CheckUpdates(); + } + catch(Exception ex) + { + Logger.Log($"[{DateTime.Now}]: {{EXCEPTION}} {ex.Message}{newLine}{ex.StackTrace}"); + Logger.SaveCrashReport(); + } + + Logger.Log($"Checked version is: {ver}{newLine}Installed: {versionLabel.Text}"); if (ver != versionLabel.Text) { DialogResult result = MessageBox.Show( @@ -333,6 +298,7 @@ public FloatTool() System.Diagnostics.Process.Start("https://github.com/Nemeshio/FloatTool-GUI/releases/latest"); } } + Logger.Log($"[{DateTime.Now.ToString()}]: Initialized"); } public DiscordRpcClient client; @@ -387,6 +353,7 @@ private void Form1_Load(object sender, EventArgs e) thread1 = new Thread(runCycle); this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea; this.threadCountInput.Value = Environment.ProcessorCount; + AddFont(Properties.Resources.Inter_Regular); } private void runCycle() @@ -412,72 +379,14 @@ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) } } updateSearchStr(); + } - private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) - { - updateSearchStr(); - } - - private void checkBox1_CheckedChanged(object sender, EventArgs e) - { - updateSearchStr(); - } - - private void comboBox3_SelectedIndexChanged(object sender, EventArgs e) + private void SkinComboboxChanged(object sender, EventArgs e) { updateSearchStr(); } - private static bool NextCombination(IList num, int n, int k) - { - bool finished; - - var changed = finished = false; - - if (k <= 0) return false; - - for (var i = k - 1; !finished && !changed; i--) - { - if (num[i] < n - 1 - (k - 1) + i) - { - num[i]++; - - if (i < k - 1) - for (var j = i + 1; j < k; j++) - num[j] = num[j - 1] + 1; - changed = true; - } - finished = i == 0; - } - - return changed; - } - - private static IEnumerable Combinations(IEnumerable elements, int k, int start, int skip) - { - var elem = elements.ToArray(); - var size = elem.Length; - - if (k > size) yield break; - - var numbers = new int[k]; - - for (var i = 0; i < k; i++) - numbers[i] = i; - - int step = 0; - - do - { - if((step+start)%skip == 0) - { - yield return numbers.Select(n => elem[n]); - } - step++; - } while (NextCombination(numbers, size, k)); - } - public void secndThread(List craftList, string wanted, List pool, int start, int skip) { foreach (IEnumerable pair in Combinations(pool, 10, start, skip)) @@ -498,7 +407,7 @@ public void AddCombinationToList(string time, decimal flotOrigin, string flot, f ForeColor = Color.White, Size = new Size(425, 220), Margin = new Padding(3), - Font = new Font("Microsoft JhengHei Light", 10f) + Font = new Font("Inter", 10f) }; #region Labels tmpPanel.Controls.Add(new Label @@ -542,7 +451,7 @@ public void AddCombinationToList(string time, decimal flotOrigin, string flot, f { BackColor = Color.FromArgb(56, 56, 56), Location = new Point(117 + x, y), - Font = new Font("Microsoft JhengHei Light", 8f), + Font = new Font("Inter", 8f), Size = new Size(84, 25), Text = "Копировать", Tag = floatStrings[i], @@ -573,6 +482,7 @@ public BigInteger Fact(int number) private void StartCalculation() { + Logger.Log($"[{DateTime.Now.ToString()}]: Started search"); if (discordWorker) { client.SetPresence(new RichPresence() { @@ -597,15 +507,23 @@ private void StartCalculation() startBtn.Text = "Стоп"; fullSkinName.SelectionStart = fullSkinName.Text.Length; outputConsoleBox.ScrollToCaret(); - flowLayoutPanel1.Controls.Clear(); + foundCombinationContainer.Controls.Clear(); } )); - string count = "" + quantityInput.Value; string start = "" + skipValueInput.Value; string wanted = searchFloatInput.Text; string q = fullSkinName.Text; - string url = $"https://steamcommunity.com/market/listings/730/{q}/render/?query=&language=russian&count={count}&start={start}¤cy={(int)currentCurr}"; + + Logger.Log($"Settings: {{{newLine}" + + $" Float = {wanted}{newLine}" + + $" Count = {count}{newLine}" + + $" Skip = {start}{newLine}" + + $" Name = {q}{newLine}" + + $" Threads = {threadCountInput.Value}{newLine}" + + $"}}"); + + string url = $"https://steamcommunity.com/market/listings/730/{ q }/render/?query=&language=russian&count={ count }&start={ start }¤cy={ (int)currentCurr }"; Console.WriteLine(url); this.Invoke((MethodInvoker)(() => @@ -620,49 +538,62 @@ private void StartCalculation() )); List inputSkins = new List(); - using (WebClient wc = new WebClient()) + try { - string json = wc.DownloadString(url); - Console.WriteLine(json); - dynamic r = JsonConvert.DeserializeObject(json); - this.Invoke((MethodInvoker)(() => + using (WebClient wc = new WebClient()) + { + string json = wc.DownloadString(url); + Console.WriteLine(json); + dynamic r = JsonConvert.DeserializeObject(json); + this.Invoke((MethodInvoker)(() => { - outputConsoleBox.AppendText( "Получение флоатов..." + newLine); + outputConsoleBox.AppendText("Получение флоатов..." + newLine); fullSkinName.SelectionStart = fullSkinName.Text.Length; outputConsoleBox.ScrollToCaret(); } - )); - int counter = 0; - foreach (var el in r["listinginfo"]) - { - counter++; - string lid = r["listinginfo"][el.Name]["listingid"]; - string aid = r["listinginfo"][el.Name]["asset"]["id"]; - string link = r["listinginfo"][el.Name]["asset"]["market_actions"][0]["link"]; - url = "https://api.csgofloat.com/?url=" + link.Replace("%assetid%", aid).Replace("%listingid%", lid); - using (WebClient wcf = new WebClient()) + )); + int counter = 0; + foreach (var el in r["listinginfo"]) { - try + counter++; + string lid = r["listinginfo"][el.Name]["listingid"]; + string aid = r["listinginfo"][el.Name]["asset"]["id"]; + string link = r["listinginfo"][el.Name]["asset"]["market_actions"][0]["link"]; + url = "https://api.csgofloat.com/?url=" + link.Replace("%assetid%", aid).Replace("%listingid%", lid); + using (WebClient wcf = new WebClient()) { - wcf.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); - string jsonf = wcf.DownloadString(url); - dynamic rf = JsonConvert.DeserializeObject(jsonf); - //Debug.WriteLine("[DEBUG] " + counter + "/" + count + " load from csgofloat = " + jsonf); - inputSkins.Add(new InputSkin(Convert.ToDouble(rf["iteminfo"]["floatvalue"]), - (float.Parse(r["listinginfo"][el.Name]["converted_price"].ToString()) + float.Parse(r["listinginfo"][el.Name]["converted_fee"].ToString())) / 100, - currentCurr)); + try + { + wcf.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + string jsonf = wcf.DownloadString(url); + dynamic rf = JsonConvert.DeserializeObject(jsonf); + //Debug.WriteLine("[DEBUG] " + counter + "/" + count + " load from csgofloat = " + jsonf); + inputSkins.Add(new InputSkin(Convert.ToDouble(rf["iteminfo"]["floatvalue"]), + (float.Parse(r["listinginfo"][el.Name]["converted_price"].ToString()) + float.Parse(r["listinginfo"][el.Name]["converted_fee"].ToString())) / 100, + currentCurr)); + } + catch (Exception ex) + { + if (ex.GetType() != typeof(ThreadAbortException)) + { + Logger.Log($"[{DateTime.Now}]: {{EXCEPTION}} {ex.Message}{Environment.NewLine}{ex.StackTrace}"); + Logger.SaveCrashReport(); + } + } } - catch (Exception e) + this.Invoke((MethodInvoker)(() => { - Console.WriteLine($"{url} = {e.Message}"); - } - } - this.Invoke((MethodInvoker)(() => - { - downloadProgressBar.Value = counter; + downloadProgressBar.Value = counter; + })); } - )); - + } + } + catch (Exception ex) + { + if(ex.GetType() != typeof(ThreadAbortException)) + { + Logger.Log($"[{DateTime.Now}]: {{EXCEPTION}} {ex.Message}{Environment.NewLine}{ex.StackTrace}"); + Logger.SaveCrashReport(); } } if (sortCheckBox.Checked) @@ -741,7 +672,7 @@ private void StartCalculation() int threads = (int)threadCountInput.Value; try { - for (int i = 1; i < threads; i++) + for (int i = 0; i < threads; i++) { Thread newThread = new Thread(() => secndThread(outcomes, wanted, inputSkins, i, threads)); newThread.Start(); @@ -753,12 +684,7 @@ private void StartCalculation() Console.WriteLine(ex.Message); } - foreach (IEnumerable pair in Combinations(inputSkins, 10, 0, threads)) - { - parseCraft(pair.ToList(), outcomes, wanted); - currComb++; - } - Console.WriteLine("Next group"); + Console.WriteLine($"[DEBUG] {threads} threads started!"); while (true) { @@ -791,7 +717,7 @@ private void StartCalculation() } - private void button2_Click(object sender, EventArgs e) + private void StartButtonClick(object sender, EventArgs e) { if(startBtn.Text == "Старт") { thread1.Abort(); @@ -800,6 +726,7 @@ private void button2_Click(object sender, EventArgs e) } else { + Logger.Log($"[{DateTime.Now}] Stopping search"); Searching = false; thread1.Abort(); startBtn.Text = "Старт"; @@ -892,47 +819,7 @@ private void button1_Click(object sender, EventArgs e) MessageBox.Show("Такого скина не существует! Перепроверьте настройки.", "FloatTool", MessageBoxButtons.OK, MessageBoxIcon.Error); } - bool testOverlap(float x1, float x2, float y1, float y2) - { - return (x1 >= y1 && x1 <= y2) || - (x2 >= y1 && x2 <= y2) || - (y1 >= x1 && y1 <= x2) || - (y2 >= x1 && y2 <= x2); - } - - private Quality FromString(string value) - { - if (value == "Consumer") return Quality.Consumer; - else if (value == "Industrial") return Quality.Industrial; - else if (value == "Mil-Spec") return Quality.MilSpec; - else if (value == "Restricted") return Quality.Restricted; - else if (value == "Classified") return Quality.Classified; - else return Quality.Covert; - } - - private List[] GroupOutcomes(List skins) - { - var allList = new List>(); //List with all outcomes - float[] currIter = { 0f, 1f }; //Last iteration wear range - List floatRanges = new List(); //List of all ranges that has been parsed - - foreach(var skin in skins) - { - float[] curr = { skin["maxWear"], skin["minWear"] }; - List list = new List(); - if (curr.SequenceEqual(currIter) || floatRanges.Any(x => (x.SequenceEqual(curr)))) continue; //If range already exists - else { - currIter = curr; - floatRanges.Add(currIter); - } - foreach (var skin1 in skins) - if ((skin["maxWear"] == skin1["maxWear"]) && (skin["minWear"] == skin1["minWear"])) - list.Add(new Skin(skin1["name"].ToString(), float.Parse(skin1["minWear"].ToString().Replace('.', ',')), float.Parse(skin1["maxWear"].ToString().Replace('.', ',')), FromString(skin1["rarity"].ToString().Split(' ')[0]))); - allList.Add(list); - } - - return allList.ToArray(); - } + private bool floatRangeText(string text, string minVal, string maxVal) { @@ -953,7 +840,7 @@ private bool floatRangeText(string text, string minVal, string maxVal) { return testOverlap(minWear, maxWear, 0.15f, 0.38f); } - else if (text == "Well-Wornr") + else if (text == "Well-Worn") { return testOverlap(minWear, maxWear, 0.38f, 0.45f); } @@ -977,7 +864,7 @@ private void button8_Click(object sender, EventArgs e) private void MaximizeMinimizeButton(object sender, EventArgs e) { - var buttonText = ((System.Windows.Forms.Button)sender).Text; + var buttonText = ((Button)sender).Text; if(buttonText == "_") WindowState = FormWindowState.Minimized; else { @@ -1038,16 +925,7 @@ protected override void WndProc(ref Message message) } } - private void panel3_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - ReleaseCapture(); - SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); - } - } - - private void panel9_MouseDown(object sender, MouseEventArgs e) + private void WindowDragEvent(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { @@ -1084,8 +962,14 @@ void ChangeTheme(bool dark) { if (dark) { + BackColor = Color.FromArgb(44, 44, 44); outputConsoleBox.BackColor = Color.FromArgb(31, 31, 31); outputConsoleBox.ForeColor = Color.FromArgb(255, 255, 255); + splitContainer1.BackColor = Color.FromArgb(31, 31, 31); + splitContainer1.Panel1.BackColor = Color.FromArgb(31, 31, 31); + splitContainer1.Panel2.BackColor = Color.FromArgb(31, 31, 31); + + foundCombinationContainer.BackColor = Color.FromArgb(37, 37, 37); panel10.BackColor = Color.FromArgb(31, 31, 31); panel12.BackColor = Color.FromArgb(31, 31, 31); @@ -1178,8 +1062,14 @@ void ChangeTheme(bool dark) } else { + BackColor = Color.FromArgb(222, 222, 222); outputConsoleBox.BackColor = Color.FromArgb(255, 255, 255); outputConsoleBox.ForeColor = Color.FromArgb(0, 0, 0); + splitContainer1.BackColor = Color.FromArgb(255, 255, 255); + splitContainer1.Panel1.BackColor = Color.FromArgb(255, 255, 255); + splitContainer1.Panel2.BackColor = Color.FromArgb(255, 255, 255); + + foundCombinationContainer.BackColor = Color.FromArgb(222, 222, 222); panel10.BackColor = Color.FromArgb(255, 255, 255); panel12.BackColor = Color.FromArgb(255, 255, 255); @@ -1273,33 +1163,6 @@ void ChangeTheme(bool dark) private void gpuSearch_btn_Click(object sender, EventArgs e) { - double[] floats = { - 0.246938750147820, 0.196652039885521, - 0.154839321970940, 0.333326697349548, - 0.163415759801865, 0.291821509599686, - 0.374309629201889, 0.378754675388336, - 0.231419935822487, 0.311867892742157, - 0.374067693948746, 0.377068012952805, - 0.244467452168465, 0.355135351419449, - 0.352264583110809, 0.227853879332542, - 0.340960860252380, 0.375657349824905, - 0.157685652375221, 0.217334255576134, - 0.323678821325302, 0.363768666982651, - 0.350994020700455, 0.369551151990891, - 0.350340574979782, 0.338801741600037, - 0.329752802848816, 0.369740217924118, - 0.370476812124252, 0.205233186483383, - 0.360520750284195, 0.373722523450851, - 0.161364838480949, 0.263432979583740, - 0.314681977033615, 0.310743361711502, - 0.349280923604965, 0.355936050415039, - 0.269742101430893, 0.199420168995857, - 0.364472836256027, 0.218964993953705, - 0.239638179540634, 0.325499594211578, - 0.228406846523285, 0.307701110839844, - 0.156294032931328, 0.179465100169182, - 0.327553898096085, 0.150170117616653 - }; if (discordWorker) { client.SetPresence(new RichPresence() @@ -1328,8 +1191,8 @@ private void timer2_Tick(object sender, EventArgs e) foreach (var tmpPanel in combinationWindows) { - flowLayoutPanel1.Controls.Add(tmpPanel); - flowLayoutPanel1.ScrollControlIntoView(tmpPanel); + foundCombinationContainer.Controls.Add(tmpPanel); + foundCombinationContainer.ScrollControlIntoView(tmpPanel); } combinationWindows.Clear(); @@ -1371,5 +1234,16 @@ private void changeSearchMode(object sender, EventArgs e) CurrentSearchMode = SearchMode.Less; } } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.F1) + { + System.Diagnostics.Process.Start("https://prevter.github.io/FloatTool-GUI/table.html"); + return true; + } + + return base.ProcessCmdKey(ref msg, keyData); + } } } diff --git a/FloatToolGUI/Main.resx b/FloatToolGUI/Main.resx index 67f5d57..3e90f1d 100644 --- a/FloatToolGUI/Main.resx +++ b/FloatToolGUI/Main.resx @@ -129,34 +129,34 @@ Horizontal - + True - + Fill - + 5, 5 - + 0, 0, 0, 0 - + 449, 292 - + 0 - - flowLayoutPanel1 + + foundCombinationContainer - + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + splitContainer1.Panel1 - + 0 @@ -178,7 +178,7 @@ Fill - Microsoft JhengHei UI Light, 10pt + Inter, 9.75pt 5, 5 @@ -253,18 +253,102 @@ 65, 16 - + + panel8 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + panel7 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + Fill - - 0, 10 + + 0, 0 - - 459, 408 + + 469, 458 - + + 7 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + panel13 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel8 + + + 0 + + + panel10 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel8 + + + 1 + + + Fill + + + 0, 40 + + + 469, 418 + + 2 + + panel8 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + panel11 @@ -277,18 +361,6 @@ 0 - - Top - - - 0, 0 - - - 459, 10 - - - 3 - panel12 @@ -325,6 +397,54 @@ 0 + + Fill + + + 0, 10 + + + 459, 408 + + + 2 + + + panel11 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel13 + + + 0 + + + Top + + + 0, 0 + + + 459, 10 + + + 3 + + + panel12 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel13 + + + 1 + Left @@ -349,28 +469,160 @@ 1 - - Fill + + panel9 - - 0, 40 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 469, 418 + + panel7 - + + 0 + + + button5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel7 + + + 1 + + + button4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel7 + + 2 - - panel8 + + button3 - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel7 + + + 3 + + + Top + + + 0, 0 + + + 469, 40 + + + 1 + + + panel7 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + panel1 - + + 1 + + + benchmarkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel9 + + + 0 + + + settingsButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel9 + + + 1 + + + MaximizeButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel9 + + + 2 + + + minimizeBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel9 + + + 3 + + + closeBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel9 + + + 4 + + + Top + + + 0, 0 + + + 469, 40 + + + 3 + + + panel9 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel7 + + 0 @@ -458,7 +710,7 @@ Flat - Microsoft JhengHei Light, 16pt + Inter, 18pt NoControl @@ -494,7 +746,7 @@ Flat - Microsoft JhengHei Light, 16pt + Inter, 18pt NoControl @@ -530,7 +782,7 @@ Flat - Microsoft JhengHei Light, 16pt + Inter, 18pt NoControl @@ -559,30 +811,6 @@ 4 - - Top - - - 0, 0 - - - 469, 40 - - - 3 - - - panel9 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel7 - - - 0 - Top, Right @@ -691,53 +919,65 @@ 3 - - Top + + label24 - - 0, 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 469, 40 + + panel3 - - 1 + + 0 - - panel7 + + versionLabel - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel1 + + panel3 - + 1 - - Fill + + label8 - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 2 + + + Top + + 0, 0 - - 469, 458 + + 427, 40 - - 7 + + 0 - - panel1 + + panel3 - + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel4 + + panel2 - - 0 + + 2 Top, Right @@ -745,14 +985,17 @@ True + + Inter, 8.25pt + NoControl - 173, 20 + 177, 19 - 57, 15 + 60, 14 1 @@ -775,20 +1018,23 @@ True + + Inter, 8.25pt + NoControl - 138, 20 + 141, 19 - 38, 15 + 40, 14 1 - v.0.6.0 + v.0.6.1 versionLabel @@ -806,7 +1052,7 @@ True - Microsoft JhengHei Light, 22pt + Inter, 21.75pt NoControl @@ -815,7 +1061,7 @@ 5, 2 - 140, 38 + 140, 35 0 @@ -835,35 +1081,14 @@ 2 - - Top - - - 0, 0 - - - 427, 40 - - - 0 - - - panel3 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 2 - - 79, 64 + 86, 66 + + + 6, 6, 6, 6 - 38, 24 + 40, 24 2 @@ -887,13 +1112,13 @@ Flat - Microsoft JhengHei Light, 10pt + Inter, 10.25pt NoControl - 150, 96 + 150, 98 267, 24 @@ -922,9 +1147,6 @@ True - - Microsoft JhengHei Light, 10pt - NoControl @@ -932,7 +1154,7 @@ 285, 13 - 71, 18 + 82, 19 7 @@ -959,7 +1181,7 @@ Flat - Microsoft JhengHei Light, 9pt + Inter, 9.75pt 80% (AK-47 | Safari Mesh + 3) @@ -971,10 +1193,10 @@ * Искать всё * - 203, 64 + 204, 66 - 214, 24 + 213, 24 6 @@ -1001,7 +1223,7 @@ Flat - Microsoft JhengHei Light, 9pt + Inter, 9.75pt Factory New @@ -1048,17 +1270,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 67 + 7, 68 - 70, 18 + 79, 19 3 @@ -1084,17 +1303,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 13 + 7, 13 - 88, 18 + 100, 19 3 @@ -1120,17 +1336,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 99 + 7, 101 - 127, 18 + 140, 19 9 @@ -1160,7 +1373,7 @@ Flat - Microsoft JhengHei Light, 9pt + Inter, 9.75pt AK-47 @@ -1265,7 +1478,7 @@ XM1014 - 12, 34 + 11, 34 132, 24 @@ -1294,17 +1507,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 129, 67 + 127, 68 - 68, 18 + 77, 19 4 @@ -1330,17 +1540,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 147, 13 + 146, 12 - 43, 18 + 50, 19 4 @@ -1364,7 +1571,7 @@ Bottom - Microsoft JhengHei Light, 12pt + Inter, 12pt 0, 126 @@ -1406,7 +1613,7 @@ Flat - Microsoft JhengHei Light, 9pt + Inter, 9.75pt 150, 34 @@ -1414,73 +1621,286 @@ 132, 24 - - 5 + + 5 + + + Predator + + + weaponSkinBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel6 + + + 12 + + + Top + + + 0, 40 + + + 427, 151 + + + 1 + + + panel6 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + panel16 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel5 + + + 0 + + + panel15 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel5 + + + 1 + + + Fill + + + 0, 191 + + + 427, 267 + + + 0 + + + panel5 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + downloadProgressBar + + + FloatToolGUI.CustomProgressBar, FloatTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + panel16 + + + 0 + + + searchmodeGreater_btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 1 + + + searchmodeEqual_btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 2 + + + searchmodeLess_btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 3 + + + searchModeLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 4 + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 5 + + + quantityInput + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 6 + + + skipValueInput + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 7 + + + ascendingCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 8 + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel16 + + + 9 + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Predator + + panel16 - - weaponSkinBox + + 10 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + searchFloatInput - - panel6 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12 + + panel16 - - Top + + 11 - - 0, 40 + + sortCheckBox - - 427, 151 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 + + panel16 - - panel6 + + 12 - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + startBtn - - panel2 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 + + panel16 - - None + + 13 - - 12, 157 + + Fill - - 0, 0, 0, 0 + + 0, 0 - - 405, 24 + + 427, 191 - + 12 - - downloadProgressBar + + panel16 - - FloatToolGUI.CustomProgressBar, FloatTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel16 + + panel5 - + 0 @@ -1490,16 +1910,16 @@ Flat - Microsoft JhengHei UI, 12.75pt, style=Bold + Inter, 14pt, style=Bold NoControl - 169, 29 + 180, 29 - 70, 32 + 77, 32 11 @@ -1526,16 +1946,16 @@ Flat - Microsoft JhengHei UI, 12.75pt, style=Bold + Inter, 14pt, style=Bold NoControl - 91, 29 + 94, 29 - 70, 32 + 80, 32 11 @@ -1562,16 +1982,16 @@ Flat - Microsoft JhengHei UI, 12.75pt, style=Bold + Inter, 14pt, style=Bold NoControl - 12, 29 + 11, 29 - 70, 32 + 77, 32 11 @@ -1597,17 +2017,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 8 + 7, 7 - 105, 18 + 119, 19 5 @@ -1633,17 +2050,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 67 + 7, 70 - 108, 18 + 121, 19 5 @@ -1667,13 +2081,13 @@ None - Microsoft JhengHei Light, 10pt + Inter, 9.75pt - 122, 96 + 131, 98 - 116, 21 + 126, 19 3 @@ -1694,13 +2108,13 @@ None - Microsoft JhengHei Light, 10pt + Inter, 9.75pt - 122, 127 + 131, 127 - 117, 21 + 126, 19 4 @@ -1727,10 +2141,10 @@ NoControl - 245, 39 + 267, 38 - 136, 22 + 147, 23 9 @@ -1760,10 +2174,10 @@ NoControl - 9, 126 + 7, 127 - 67, 18 + 75, 19 7 @@ -1789,17 +2203,14 @@ True - - Microsoft JhengHei Light, 10pt - NoControl - 9, 95 + 7, 98 - 89, 18 + 101, 19 6 @@ -1823,13 +2234,16 @@ None - Microsoft JhengHei Light, 10pt + Inter, 9.75pt - 122, 67 + 131, 73 + + + 16 - 116, 18 + 126, 16 2 @@ -1859,10 +2273,10 @@ NoControl - 245, 15 + 267, 15 - 111, 22 + 124, 23 8 @@ -1889,16 +2303,16 @@ Flat - Microsoft JhengHei Light, 18pt + Inter, 20.25pt NoControl - 244, 67 + 267, 70 - 173, 81 + 150, 82 0 @@ -1918,44 +2332,104 @@ 13 - - Fill + + speedStatusLabel - - 0, 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 427, 191 + + panel15 - - 12 + + 0 - - panel16 + + combinationsStatusLabel - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel15 + + + 1 + + + gpuSearch_btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel15 + + + 2 + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel15 + + + 3 + + + threadCountInput + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel15 + + + 4 + + + Bottom + + + 0, 191 + + + 427, 76 + + + 11 + + + panel15 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + panel5 - - 0 + + 1 True - Microsoft JhengHei Light, 9pt + Inter, 9pt NoControl - 9, 34 + 8, 33 - 221, 16 + 229, 15 5 @@ -1979,16 +2453,16 @@ True - Microsoft JhengHei Light, 9pt + Inter, 9pt NoControl - 9, 50 + 8, 50 - 179, 16 + 179, 15 5 @@ -2018,7 +2492,7 @@ Flat - Microsoft JhengHei Light, 14pt + Inter, 16pt NoControl @@ -2027,7 +2501,7 @@ 244, 0 - 177, 71 + 173, 71 3 @@ -2057,10 +2531,10 @@ NoControl - 9, 2 + 7, 0 - 72, 18 + 79, 19 2 @@ -2080,11 +2554,14 @@ 3 + + Inter, 11.25pt + - 87, 2 + 92, 0 - 120, 21 + 120, 22 1 @@ -2101,57 +2578,6 @@ 4 - - Bottom - - - 0, 191 - - - 427, 76 - - - 11 - - - panel15 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel5 - - - 1 - - - Fill - - - Microsoft JhengHei Light, 10pt - - - 0, 191 - - - 427, 267 - - - 0 - - - panel5 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - Left @@ -2203,6 +2629,36 @@ 198, 16 + + None + + + Inter, 9.75pt + + + 11, 161 + + + 0, 0, 0, 0 + + + 406, 24 + + + 12 + + + downloadProgressBar + + + FloatToolGUI.CustomProgressBar, FloatTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + panel16 + + + 0 + True @@ -2216,7 +2672,7 @@ 900, 460 - Microsoft JhengHei Light, 8.25pt + Inter, 11.249999pt diff --git a/FloatToolGUI/Properties/Resources.Designer.cs b/FloatToolGUI/Properties/Resources.Designer.cs index 65c0a30..52543d9 100644 --- a/FloatToolGUI/Properties/Resources.Designer.cs +++ b/FloatToolGUI/Properties/Resources.Designer.cs @@ -110,6 +110,16 @@ internal static System.Drawing.Bitmap github { } } + /// + /// Поиск локализованного ресурса типа System.Byte[]. + /// + internal static byte[] Inter_Regular { + get { + object obj = ResourceManager.GetObject("Inter_Regular", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Поиск локализованного ресурса типа System.Drawing.Bitmap. /// diff --git a/FloatToolGUI/Properties/Resources.resx b/FloatToolGUI/Properties/Resources.resx index 257ea90..aa34fd0 100644 --- a/FloatToolGUI/Properties/Resources.resx +++ b/FloatToolGUI/Properties/Resources.resx @@ -133,6 +133,9 @@ ..\Resources\github.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Inter-Regular.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\mutedBlack.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/FloatToolGUI/Resources/Inter-Regular.ttf b/FloatToolGUI/Resources/Inter-Regular.ttf new file mode 100644 index 0000000..96fd6a1 Binary files /dev/null and b/FloatToolGUI/Resources/Inter-Regular.ttf differ diff --git a/FloatToolGUI/SettingsForm.Designer.cs b/FloatToolGUI/SettingsForm.Designer.cs index 36879b8..dcf1dfb 100644 --- a/FloatToolGUI/SettingsForm.Designer.cs +++ b/FloatToolGUI/SettingsForm.Designer.cs @@ -75,7 +75,7 @@ private void InitializeComponent() this.closeBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); this.closeBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black; this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.closeBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 16F); + this.closeBtn.Font = new System.Drawing.Font("Inter", 16F); this.closeBtn.ForeColor = System.Drawing.Color.White; this.closeBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.closeBtn.Location = new System.Drawing.Point(350, 0); @@ -90,12 +90,12 @@ private void InitializeComponent() // this.label8.AutoSize = true; this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("Microsoft JhengHei Light", 22F); + this.label8.Font = new System.Drawing.Font("Inter", 22F); this.label8.ForeColor = System.Drawing.Color.White; this.label8.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.label8.Location = new System.Drawing.Point(1, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(167, 38); + this.label8.Size = new System.Drawing.Size(175, 36); this.label8.TabIndex = 0; this.label8.Text = "Настройки"; this.label8.MouseDown += new System.Windows.Forms.MouseEventHandler(this.DragWindowMouseDown); @@ -103,33 +103,33 @@ private void InitializeComponent() // label1 // this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label1.Font = new System.Drawing.Font("Inter", 14F); this.label1.ForeColor = System.Drawing.Color.White; this.label1.Location = new System.Drawing.Point(75, 52); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(122, 24); + this.label1.Size = new System.Drawing.Size(131, 23); this.label1.TabIndex = 3; this.label1.Text = "Тёмная тема"; // // label2 // this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label2.Font = new System.Drawing.Font("Inter", 14F); this.label2.ForeColor = System.Drawing.Color.White; this.label2.Location = new System.Drawing.Point(75, 95); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(205, 24); + this.label2.Size = new System.Drawing.Size(213, 23); this.label2.TabIndex = 3; this.label2.Text = "Звук при нахождении"; // // label3 // this.label3.AutoSize = true; - this.label3.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label3.Font = new System.Drawing.Font("Inter", 14F); this.label3.ForeColor = System.Drawing.Color.White; this.label3.Location = new System.Drawing.Point(75, 137); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(214, 24); + this.label3.Size = new System.Drawing.Size(217, 23); this.label3.TabIndex = 3; this.label3.Text = "Проверка обновлений"; // @@ -140,7 +140,7 @@ private void InitializeComponent() this.saveChangesBtn.Enabled = false; this.saveChangesBtn.FlatAppearance.BorderSize = 0; this.saveChangesBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.saveChangesBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.saveChangesBtn.Font = new System.Drawing.Font("Inter", 14F); this.saveChangesBtn.ForeColor = System.Drawing.Color.White; this.saveChangesBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.saveChangesBtn.Location = new System.Drawing.Point(8, 320); @@ -157,7 +157,7 @@ private void InitializeComponent() this.resetChangesBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.resetChangesBtn.FlatAppearance.BorderSize = 0; this.resetChangesBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.resetChangesBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.resetChangesBtn.Font = new System.Drawing.Font("Inter", 14F); this.resetChangesBtn.ForeColor = System.Drawing.Color.White; this.resetChangesBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.resetChangesBtn.Location = new System.Drawing.Point(199, 320); @@ -172,7 +172,7 @@ private void InitializeComponent() // this.bufferSpeedNUP.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(24)))), ((int)(((byte)(24))))); this.bufferSpeedNUP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.bufferSpeedNUP.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.bufferSpeedNUP.Font = new System.Drawing.Font("Inter", 14F); this.bufferSpeedNUP.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150))))); this.bufferSpeedNUP.Location = new System.Drawing.Point(8, 280); this.bufferSpeedNUP.Maximum = new decimal(new int[] { @@ -186,7 +186,7 @@ private void InitializeComponent() 0, 0}); this.bufferSpeedNUP.Name = "bufferSpeedNUP"; - this.bufferSpeedNUP.Size = new System.Drawing.Size(376, 32); + this.bufferSpeedNUP.Size = new System.Drawing.Size(376, 30); this.bufferSpeedNUP.TabIndex = 5; this.bufferSpeedNUP.Value = new decimal(new int[] { 250, @@ -198,11 +198,11 @@ private void InitializeComponent() // label4 // this.label4.AutoSize = true; - this.label4.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label4.Font = new System.Drawing.Font("Inter", 14F); this.label4.ForeColor = System.Drawing.Color.White; this.label4.Location = new System.Drawing.Point(4, 253); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(320, 24); + this.label4.Size = new System.Drawing.Size(333, 23); this.label4.TabIndex = 3; this.label4.Text = "Скорость обновления буфера (мс)"; // @@ -216,7 +216,7 @@ private void InitializeComponent() this.checkUpdatesToggle.TabIndex = 2; this.checkUpdatesToggle.TurnedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.checkUpdatesToggle.TurnedOnColor = System.Drawing.Color.Green; - this.checkUpdatesToggle.OnToggled += new System.EventHandler(this.checkUpdatesToggle_OnToggled); + this.checkUpdatesToggle.OnToggled += new System.EventHandler(this.Toggle_OnToggled); // // soundToggle // @@ -228,7 +228,7 @@ private void InitializeComponent() this.soundToggle.TabIndex = 2; this.soundToggle.TurnedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.soundToggle.TurnedOnColor = System.Drawing.Color.Green; - this.soundToggle.OnToggled += new System.EventHandler(this.soundToggle_OnToggled); + this.soundToggle.OnToggled += new System.EventHandler(this.Toggle_OnToggled); // // darkModeToggle // @@ -240,7 +240,7 @@ private void InitializeComponent() this.darkModeToggle.TabIndex = 2; this.darkModeToggle.TurnedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.darkModeToggle.TurnedOnColor = System.Drawing.Color.Green; - this.darkModeToggle.OnToggled += new System.EventHandler(this.darkModeToggle_OnToggled); + this.darkModeToggle.OnToggled += new System.EventHandler(this.Toggle_OnToggled); // // discordRpcToggle // @@ -252,16 +252,16 @@ private void InitializeComponent() this.discordRpcToggle.TabIndex = 2; this.discordRpcToggle.TurnedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.discordRpcToggle.TurnedOnColor = System.Drawing.Color.Green; - this.discordRpcToggle.OnToggled += new System.EventHandler(this.checkUpdatesToggle_OnToggled); + this.discordRpcToggle.OnToggled += new System.EventHandler(this.Toggle_OnToggled); // // label5 // this.label5.AutoSize = true; - this.label5.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label5.Font = new System.Drawing.Font("Inter", 14F); this.label5.ForeColor = System.Drawing.Color.White; this.label5.Location = new System.Drawing.Point(75, 179); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(188, 24); + this.label5.Size = new System.Drawing.Size(197, 23); this.label5.TabIndex = 3; this.label5.Text = "Интеграция Discord"; // @@ -270,23 +270,23 @@ private void InitializeComponent() this.currencyComboBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(24)))), ((int)(((byte)(24))))); this.currencyComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.currencyComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.currencyComboBox.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.currencyComboBox.Font = new System.Drawing.Font("Inter", 14F); this.currencyComboBox.ForeColor = System.Drawing.Color.White; this.currencyComboBox.FormattingEnabled = true; this.currencyComboBox.Location = new System.Drawing.Point(90, 218); this.currencyComboBox.Name = "currencyComboBox"; - this.currencyComboBox.Size = new System.Drawing.Size(173, 32); + this.currencyComboBox.Size = new System.Drawing.Size(173, 31); this.currencyComboBox.TabIndex = 6; this.currencyComboBox.SelectedIndexChanged += new System.EventHandler(this.bufferSpeedNUP_ValueChanged); // // label6 // this.label6.AutoSize = true; - this.label6.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F); + this.label6.Font = new System.Drawing.Font("Inter", 14F); this.label6.ForeColor = System.Drawing.Color.White; this.label6.Location = new System.Drawing.Point(4, 221); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(80, 24); + this.label6.Size = new System.Drawing.Size(85, 23); this.label6.TabIndex = 3; this.label6.Text = "Валюта:"; // diff --git a/FloatToolGUI/SettingsForm.cs b/FloatToolGUI/SettingsForm.cs index 7cd9d1b..091c48d 100644 --- a/FloatToolGUI/SettingsForm.cs +++ b/FloatToolGUI/SettingsForm.cs @@ -29,10 +29,12 @@ public SettingsForm() discordRpcToggle.Checked = Convert.ToBoolean(registryData.GetValue("discordRPC")); currencyComboBox.SelectedItem = (Currency)registryData.GetValue("currency"); saveChangesBtn.Enabled = false; + Logger.Log($"[{DateTime.Now}]: Settings window opened"); } private void CloseForm(object sender, EventArgs e) { + Logger.Log($"[{DateTime.Now}]: Settings window closed"); Close(); } @@ -54,19 +56,10 @@ private void DragWindowMouseDown(object sender, MouseEventArgs e) } } - private void darkModeToggle_OnToggled(object sender, EventArgs e) - { - saveChangesBtn.Enabled = true; - } - - private void soundToggle_OnToggled(object sender, EventArgs e) - { - saveChangesBtn.Enabled = true; - } - - private void checkUpdatesToggle_OnToggled(object sender, EventArgs e) + private void Toggle_OnToggled(object sender, EventArgs e) { saveChangesBtn.Enabled = true; + Logger.Log($"[{DateTime.Now}]: Option been toggled."); } private void bufferSpeedNUP_ValueChanged(object sender, EventArgs e) @@ -86,6 +79,7 @@ private void saveChangesBtn_Click(object sender, EventArgs e) registryData.SetValue("currency", (int)currencyComboBox.SelectedValue); registryData.Close(); saveChangesBtn.Enabled = false; + Logger.Log($"[{DateTime.Now}]: Settings saved"); } private void resetChangesBtn_Click(object sender, EventArgs e) @@ -99,6 +93,7 @@ private void resetChangesBtn_Click(object sender, EventArgs e) discordRpcToggle.Checked = Convert.ToBoolean(registryData.GetValue("discordRPC")); currencyComboBox.SelectedItem = (Currency)registryData.GetValue("currency"); saveChangesBtn.Enabled = false; + Logger.Log($"[{DateTime.Now}]: Settings reseted"); } } } diff --git a/FloatToolGUI/Utils.cs b/FloatToolGUI/Utils.cs index ddd9dd8..e6e4e1a 100644 --- a/FloatToolGUI/Utils.cs +++ b/FloatToolGUI/Utils.cs @@ -1,7 +1,11 @@ using System; using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Text; +using System.IO; using System.Linq; using System.Net.Http; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Microsoft.Win32; @@ -36,13 +40,23 @@ public enum Currency RMB = 9000, NXP = 9001 } + static public string getNextRarity(string rarity) + { + if (rarity == "Consumer") return "Industrial"; + else if (rarity == "Industrial") return "Mil-Spec"; + else if (rarity == "Mil-Spec") return "Restricted"; + else if (rarity == "Restricted") return "Classified"; + else if (rarity == "Classified") return "Covert"; + return "Nothing"; + } + public static string CheckUpdates() { using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"); - using (var response = client.GetAsync("https://api.github.com/repos/nemeshio/FloatTool-GUI/releases/latest").Result) + using (var response = client.GetAsync("https://api.github.com/repos/prevter/FloatTool-GUI/releases/latest").Result) { var json = response.Content.ReadAsStringAsync().Result; @@ -52,6 +66,14 @@ public static string CheckUpdates() } } + public static bool testOverlap(float x1, float x2, float y1, float y2) + { + return (x1 >= y1 && x1 <= y2) || + (x2 >= y1 && x2 <= y2) || + (y1 >= x1 && y1 <= x2) || + (y2 >= x1 && y2 <= x2); + } + public static void CheckRegistry() { var registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool", true); @@ -76,5 +98,31 @@ public static void CheckRegistry() if (registryData.GetValue("currency") == null) registryData.SetValue("currency", (int)Currency.USD); } } + + static private PrivateFontCollection _privateFontCollection = new PrivateFontCollection(); + + static public FontFamily GetFontFamilyByName(string name) + { + return _privateFontCollection.Families.FirstOrDefault(x => x.Name == name); + } + + static public void AddFont(string fullFileName) + { + AddFont(File.ReadAllBytes(fullFileName)); + } + + static public void AddFont(byte[] fontBytes) + { + var handle = GCHandle.Alloc(fontBytes, GCHandleType.Pinned); + IntPtr pointer = handle.AddrOfPinnedObject(); + try + { + _privateFontCollection.AddMemoryFont(pointer, fontBytes.Length); + } + finally + { + handle.Free(); + } + } } } diff --git a/FloatToolGUI/Resources/itemData.json b/FloatToolGUI/itemData.json similarity index 90% rename from FloatToolGUI/Resources/itemData.json rename to FloatToolGUI/itemData.json index d557cc0..519c683 100644 --- a/FloatToolGUI/Resources/itemData.json +++ b/FloatToolGUI/itemData.json @@ -1,13 +1,787 @@ [ { - "name": "M4A1-S | Printstream", + "name":"M4A1-S | Printstream", + "rarity":"Covert Rifle", + "minWear":"0.00", + "maxWear":"0.80", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":true + }, + { + "name":"Glock-18 | Neo-Noir", + "rarity":"Covert Pistol", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":true + }, + { + "name":"M4A4 | Cyber Security", + "rarity":"Classified Rifle", + "minWear":"0.00", + "maxWear":"0.98", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"USP-S | Monster Mashup", + "rarity":"Classified Pistol", + "minWear":"0.00", + "maxWear":"0.70", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"Five-Seven | Fairy Tale", + "rarity":"Classified Pistol", + "minWear":"0.02", + "maxWear":"0.90", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"AWP | Exoskeleton", + "rarity":"Restricted Sniper Rifle", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"SSG 08 | Parallax", + "rarity":"Restricted Sniper Rifle", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"Dual Berettas | Dezastre", + "rarity":"Restricted Pistol", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"UMP-45 | Gold Bismuth", + "rarity":"Restricted SMG", + "minWear":"0.00", + "maxWear":"0.70", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"Nova | Clear Polymer", + "rarity":"Restricted Shotgun", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":false, + "highestRarity":false + }, + { + "name":"MP5-SD | Condition Zero", + "rarity":"Mil-Spec SMG", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"Galil AR | Vandal", + "rarity":"Mil-Spec Rifle", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"CZ75-Auto | Vendetta", + "rarity":"Mil-Spec Pistol", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"P90 | Cocoa Rampage", + "rarity":"Mil-Spec SMG", + "minWear":"0.00", + "maxWear":"0.60", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"P250 | Contaminant", + "rarity":"Mil-Spec Pistol", + "minWear":"0.00", + "maxWear":"0.70", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"M249 | Deep Relief", + "rarity":"Mil-Spec Machine Gun", + "minWear":"0.00", + "maxWear":"1.00", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name":"G3SG1 | Digital Mesh", + "rarity":"Mil-Spec Pistol", + "minWear":"0.00", + "maxWear":"0.80", + "case":"Operation Broken Fang", + "lowestRarity":true, + "highestRarity":false + }, + { + "name": "Desert Eagle | Printstream", + "rarity": "Covert Pistol", + "minWear": "0.00", + "maxWear": "0.80", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": true + }, + { + "name": "AK-47 | Legion of Anubis", + "rarity": "Covert Rifle", + "minWear": "0.00", + "maxWear": "0.70", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": true + }, + { + "name": "Glock-18 | Vogue", + "rarity": "Classified Pistol", + "minWear": "0.00", + "maxWear": "0.75", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "M4A4 | Tooth Fairy", + "rarity": "Classified Rifle", + "minWear": "0.00", + "maxWear": "0.73", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "XM1014 | Entombed", + "rarity": "Classified Shotgun", + "minWear": "0.00", + "maxWear": "0.50", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAG-7 | Monster Call", + "rarity": "Restricted Shotgun", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAC-10 | Allure", + "rarity": "Restricted SMG", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Galil AR | Connexion", + "rarity": "Restricted Rifle", + "minWear": "0.00", + "maxWear": "0.80", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MP5-SD | Kitbash", + "rarity": "Restricted SMG", + "minWear": "0.00", + "maxWear": "0.80", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Tec-9 | Brother", + "rarity": "Restricted Pistol", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SSG 08 | Mainframe 001", + "rarity": "Mil-Spec Sniper Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "PP-Bizon | Runic", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "P250 | Cassette", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "0.60", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "P90 | Freight", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "P2000 | Gnarled", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Negev | Ultralight", + "rarity": "Mil-Spec Machine Gun", + "minWear": "0.00", + "maxWear": "0.79", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "SG 553 | Ol' Rusty", + "rarity": "Mil-Spec Rifle", + "minWear": "0.00", + "maxWear": "0.70", + "case": "Fracture Case", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Glock-18 | Bullet Queen", + "rarity": "Covert Pistol", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": true + }, + { + "name": "M4A1-S | Player Two", "rarity": "Covert Rifle", "minWear": "0.00", + "maxWear": "0.84", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": true + }, + { + "name": "AK-47 | Phantom Disruptor", + "rarity": "Classified Rifle", + "minWear": "0.00", + "maxWear": "0.65", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAC-10 | Disco Tech", + "rarity": "Classified SMG", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAG-7 | Justice", + "rarity": "Classified Shotgun", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SG 553 | Darkwing", + "rarity": "Restricted Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SSG 08 | Fever Dream", + "rarity": "Restricted Sniper Rifle", + "minWear": "0.00", + "maxWear": "0.72", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Sawed-Off | Apocalypto", + "rarity": "Restricted Shotgun", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SCAR-20 | Enforcer", + "rarity": "Restricted Sniper Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "P2000 | Acid Etched", + "rarity": "Restricted Sniper Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "AWP | Capillary", + "rarity": "Mil-Spec Sniper Rifle", + "minWear": "0.05", + "maxWear": "0.70", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Desert Eagle | Blue Ply", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "AUG | Tom Cat", + "rarity": "Mil-Spec Rifle", + "minWear": "0.05", "maxWear": "0.80", - "case": "Operation Broken Fang Case", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "MP5-SD | Desert Strike", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "CZ75-Auto | Distressed", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "1.00", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Negev | Prototype", + "rarity": "Mil-Spec Machine Gun", + "minWear": "0.00", + "maxWear": "0.70", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "R8 Revolver | Bone Forged", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "0.60", + "case": "Prisma 2 Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "AK-47 | Wild Lotus", + "rarity": "Covert Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": true + }, + { + "name": "MP9 | Wild Lily", + "rarity": "Classified SMG", + "minWear": "0.00", + "maxWear": "0.70", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "AUG | Midnight Lily", + "rarity": "Restricted Rifle", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SSG 08 | Sea Calico", + "rarity": "Restricted Sniper Rifle", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Glock-18 | Synth Leaf", + "rarity": "Restricted Pistol", + "minWear": "0.00", + "maxWear": "0.70", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MP7 | Teal Blossom", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "UMP-45 | Day Lily", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "0.55", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "FAMAS | Sundown", + "rarity": "Mil-Spec Rifle", + "minWear": "0.00", + "maxWear": "0.60", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Five-SeveN | Crimson Blossom", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Tec-9 | Rust Leaf", + "rarity": "Industrial Grade Pistol", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "M4A4 | Dark Blossom", + "rarity": "Industrial Grade Rifle", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "XM1014 | Banana Leaf", + "rarity": "Industrial Grade Shotgun", + "minWear": "0.00", + "maxWear": "0.60", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "P90 | Sunset Lily", + "rarity": "Industrial Grade SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "M249 | Jungle", + "rarity": "Consumer Grade Machine Gun", + "minWear": "0.06", + "maxWear": "0.80", + "case": "The St. Marc Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "MP5-SD | Bamboo Garden", + "rarity": "Consumer Grade SMG", + "minWear": "0.00", + "maxWear": "0.55", + "case": "The St. Marc Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "PP-Bizon | Seabird", + "rarity": "Consumer Grade SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "MAC-10 | Surfwood", + "rarity": "Consumer Grade SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Sawed-Off | Jungle Thicket", + "rarity": "Consumer Grade Shotgun", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The St. Marc Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "AWP | Gungnir", + "rarity": "Covert Sniper Rifle", + "minWear": "0.00", + "maxWear": "0.60", + "case": "The Norse Collection", "lowestRarity": false, "highestRarity": true }, + { + "name": "Negev | Mjölnir", + "rarity": "Classified Machine Gun", + "minWear": "0.00", + "maxWear": "0.60", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "AUG | Flame Jörmungandr", + "rarity": "Restricted Rifle", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "P90 | Astral Jörmungandr", + "rarity": "Restricted SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Desert Eagle | Emerald Jörmungandr", + "rarity": "Restricted Pistol", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "XM1014 | Frost Borre", + "rarity": "Mil-Spec Shotgun", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAC-10 | Copper Borre", + "rarity": "Mil-Spec SMG", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "SCAR-20 | Brass", + "rarity": "Mil-Spec Sniper Rifle", + "minWear": "0.00", + "maxWear": "1.00", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "CZ75-Auto | Emerald Quartz", + "rarity": "Mil-Spec Pistol", + "minWear": "0.00", + "maxWear": "0.70", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "Dual Berettas | Pyre", + "rarity": "Industrial Grade Pistol", + "minWear": "0.06", + "maxWear": "0.55", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "USP-S | Pathfinder", + "rarity": "Industrial Grade Pistol", + "minWear": "0.00", + "maxWear": "0.35", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MAG-7 | Chainmail", + "rarity": "Industrial Grade Shotgun", + "minWear": "0.00", + "maxWear": "0.22", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "M4A1-S | Moss Quartz", + "rarity": "Industrial Grade Rifle", + "minWear": "0.00", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": false, + "highestRarity": false + }, + { + "name": "MP7 | Scorched", + "rarity": "Consumer Grade SMG", + "minWear": "0.06", + "maxWear": "0.80", + "case": "The Norse Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "Galil AR | Tornado", + "rarity": "Consumer Grade Rifle", + "minWear": "0.06", + "maxWear": "0.80", + "case": "The Norse Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "SSG 08 | Red Stone", + "rarity": "Consumer Grade Sniper Rifle", + "minWear": "0.06", + "maxWear": "0.50", + "case": "The Norse Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "SG 553 | Barricade", + "rarity": "Consumer Grade Rifle", + "minWear": "0.00", + "maxWear": "0.65", + "case": "The Norse Collection", + "lowestRarity": true, + "highestRarity": false + }, + { + "name": "FAMAS | Night Borre", + "rarity": "Consumer Grade Rifle", + "minWear": "0.00", + "maxWear": "0.55", + "case": "The Norse Collection", + "lowestRarity": true, + "highestRarity": false + }, { "name": "AWP | The Prince", "rarity": "Covert Sniper Rifle", @@ -475,8 +1249,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": true - }, - { + }, + { "name": "M4A4 | The Emperor", "rarity": "Covert Rifle", "minWear": "0.00", @@ -493,8 +1267,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "R8 Revolver | Skull Crusher", "rarity": "Classified Pistol", "minWear": "0.25", @@ -502,8 +1276,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "AUG | Momentum", "rarity": "Classified Rifle", "minWear": "0.05", @@ -511,7 +1285,7 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, + }, { "name": "AWP | Atheris", "rarity": "Restricted Rifle", @@ -520,8 +1294,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "Tec-9 | Bamboozle", "rarity": "Restricted Pistol", "minWear": "0.00", @@ -529,8 +1303,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "Desert Eagle | Light Rail", "rarity": "Restricted Pistol", "minWear": "0.00", @@ -538,8 +1312,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "MP5-SD | Gauss", "rarity": "Restricted SMG", "minWear": "0.00", @@ -547,8 +1321,8 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, - { + }, + { "name": "UMP-45 | Moonrise", "rarity": "Restricted SMG", "minWear": "0.00", @@ -556,7 +1330,7 @@ "case": "The Prisma Collection", "lowestRarity": false, "highestRarity": false - }, + }, { "name": "FAMAS | Crypsis", "rarity": "Mil-Spec Rifle", @@ -565,8 +1339,8 @@ "case": "The Prisma Collection", "lowestRarity": true, "highestRarity": false - }, - { + }, + { "name": "AK-47 | Uncharted", "rarity": "Mil-Spec Rifle", "minWear": "0.00", @@ -574,8 +1348,8 @@ "case": "The Prisma Collection", "lowestRarity": true, "highestRarity": false - }, - { + }, + { "name": "MAC-10 | Whitefish", "rarity": "Mil-Spec SMG", "minWear": "0.00", @@ -583,8 +1357,8 @@ "case": "The Prisma Collection", "lowestRarity": true, "highestRarity": false - }, - { + }, + { "name": "MP7 | Mischief", "rarity": "Mil-Spec SMG", "minWear": "0.10", @@ -592,8 +1366,8 @@ "case": "The Prisma Collection", "lowestRarity": true, "highestRarity": false - }, - { + }, + { "name": "P250 | Verdigris", "rarity": "Mil-Spec Pistol", "minWear": "0.00", @@ -601,7 +1375,7 @@ "case": "The Prisma Collection", "lowestRarity": true, "highestRarity": false - }, + }, { "name": "MP5-SD | Lab Rats", "rarity": "Restricted SMG",