diff --git a/.vs/FloatToolGUI/v16/.suo b/.vs/FloatToolGUI/v16/.suo
index 6f50486..b7edae5 100644
Binary files a/.vs/FloatToolGUI/v16/.suo and b/.vs/FloatToolGUI/v16/.suo differ
diff --git a/FloatToolGUI/App.config b/FloatToolGUI/App.config
index 03a0a75..f59bb87 100644
--- a/FloatToolGUI/App.config
+++ b/FloatToolGUI/App.config
@@ -1,9 +1,6 @@
-
-
-
@@ -16,11 +13,4 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/FloatToolGUI/Benchmark.Designer.cs b/FloatToolGUI/Benchmark.Designer.cs
index 9b281ec..d9ee385 100644
--- a/FloatToolGUI/Benchmark.Designer.cs
+++ b/FloatToolGUI/Benchmark.Designer.cs
@@ -41,20 +41,20 @@ 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.panel2 = new System.Windows.Forms.Panel();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = 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.flowLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
- this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
this.panel3.SuspendLayout();
+ this.panel10.SuspendLayout();
this.SuspendLayout();
//
// startBenchmarkBtn
@@ -64,7 +64,7 @@ private void InitializeComponent()
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.ForeColor = System.Drawing.Color.White;
- this.startBenchmarkBtn.Location = new System.Drawing.Point(394, 247);
+ this.startBenchmarkBtn.Location = new System.Drawing.Point(394, 255);
this.startBenchmarkBtn.Name = "startBenchmarkBtn";
this.startBenchmarkBtn.Size = new System.Drawing.Size(304, 39);
this.startBenchmarkBtn.TabIndex = 1;
@@ -80,7 +80,7 @@ private void InitializeComponent()
this.submitScoreBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitScoreBtn.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 12F);
this.submitScoreBtn.ForeColor = System.Drawing.Color.White;
- this.submitScoreBtn.Location = new System.Drawing.Point(394, 212);
+ this.submitScoreBtn.Location = new System.Drawing.Point(394, 221);
this.submitScoreBtn.Name = "submitScoreBtn";
this.submitScoreBtn.Size = new System.Drawing.Size(304, 29);
this.submitScoreBtn.TabIndex = 2;
@@ -153,14 +153,14 @@ private void InitializeComponent()
this.flowLayoutPanel1.AutoScroll = true;
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.panel2);
+ this.flowLayoutPanel1.Controls.Add(this.panel10);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Left;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.ForeColor = System.Drawing.Color.White;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(10);
- this.flowLayoutPanel1.Size = new System.Drawing.Size(384, 321);
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(388, 333);
this.flowLayoutPanel1.TabIndex = 4;
this.flowLayoutPanel1.WrapContents = false;
//
@@ -169,8 +169,8 @@ private void InitializeComponent()
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(151)))), ((int)(((byte)(10)))), ((int)(((byte)(27)))));
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.label6);
- this.panel1.Location = new System.Drawing.Point(10, 10);
- this.panel1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 5);
+ this.panel1.Location = new System.Drawing.Point(10, 12);
+ this.panel1.Margin = new System.Windows.Forms.Padding(0, 2, 0, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(350, 35);
this.panel1.TabIndex = 0;
@@ -200,42 +200,6 @@ private void InitializeComponent()
this.label6.Text = "AMD Ryzen 5 2600 Six-Core Processor (12 Threads)";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
- // panel2
- //
- this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(125)))), ((int)(((byte)(195)))));
- this.panel2.Controls.Add(this.label1);
- this.panel2.Controls.Add(this.label2);
- this.panel2.Location = new System.Drawing.Point(10, 50);
- this.panel2.Margin = new System.Windows.Forms.Padding(0, 0, 0, 5);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(350, 35);
- this.panel2.TabIndex = 1;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F);
- this.label1.ForeColor = System.Drawing.Color.White;
- this.label1.Location = new System.Drawing.Point(3, 18);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(126, 14);
- this.label1.TabIndex = 3;
- this.label1.Text = "934030 к/с (v.0.5.0 beta)";
- this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Font = new System.Drawing.Font("Microsoft JhengHei UI Light", 8F);
- this.label2.ForeColor = System.Drawing.Color.White;
- 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(289, 14);
- this.label2.TabIndex = 3;
- this.label2.Text = "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)";
- this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
// Updater
//
this.Updater.Enabled = true;
@@ -245,7 +209,7 @@ private void InitializeComponent()
//
this.customProgressBar1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(37)))), ((int)(((byte)(37)))));
this.customProgressBar1.ForeColor = System.Drawing.Color.White;
- this.customProgressBar1.Location = new System.Drawing.Point(394, 289);
+ this.customProgressBar1.Location = new System.Drawing.Point(394, 297);
this.customProgressBar1.Margin = new System.Windows.Forms.Padding(0);
this.customProgressBar1.Maximum = 184756;
this.customProgressBar1.Minimum = 0;
@@ -271,7 +235,7 @@ private void InitializeComponent()
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 40);
this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(704, 321);
+ this.panel4.Size = new System.Drawing.Size(704, 333);
this.panel4.TabIndex = 6;
//
// label8
@@ -319,11 +283,47 @@ 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;
+ //
// Benchmark
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(37)))), ((int)(((byte)(37)))));
- this.ClientSize = new System.Drawing.Size(704, 361);
+ this.ClientSize = new System.Drawing.Size(704, 373);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
@@ -334,12 +334,12 @@ private void InitializeComponent()
this.flowLayoutPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
+ this.panel10.ResumeLayout(false);
+ this.panel10.PerformLayout();
this.ResumeLayout(false);
}
@@ -359,12 +359,12 @@ private void InitializeComponent()
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.Panel panel3;
+ private System.Windows.Forms.Panel panel10;
+ private System.Windows.Forms.Label label17;
+ private System.Windows.Forms.Label label18;
}
}
\ No newline at end of file
diff --git a/FloatToolGUI/Benchmark.cs b/FloatToolGUI/Benchmark.cs
index b78bc3f..d169714 100644
--- a/FloatToolGUI/Benchmark.cs
+++ b/FloatToolGUI/Benchmark.cs
@@ -67,60 +67,50 @@ public enum SearchMode
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}");
+ return number.ToString($"f{figures}", CultureInfo.InvariantCulture);
}
- static public decimal craft(double[] ingridients, float minFloat, float maxFloat)
+ static public decimal craft(List ingridients, float minFloat, float maxFloat)
{
decimal avgFloat = 0;
- foreach (double f in ingridients)
+ foreach (InputSkin f in ingridients)
{
- avgFloat += (decimal)f;
+ avgFloat += (decimal)f.WearValue;
}
avgFloat /= 10;
return ((decimal)(maxFloat - minFloat) * avgFloat) + (decimal)minFloat;
}
- static public string craftF(double[] ingridients, float minFloat, float maxFloat)
+ 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]);
+ arrInput[i] = Convert.ToSingle(ingridients[i].WearValue);
}
foreach (float f in arrInput)
{
@@ -130,14 +120,15 @@ static public string craftF(double[] ingridients, float minFloat, float maxFloat
return setprecission(((maxFloat - minFloat) * avgFloat) + minFloat, 10);
}
- public void parseCraft(double[] inputs, List outputs, string want)
+ public void parseCraft(List inputs, List outputs, string want)
{
+ //List results = new List();
decimal wantFloat;
decimal.TryParse(want, System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out wantFloat);
foreach (var item in outputs)
{
- decimal flotOrigin = Math.Round(craft(inputs.ToArray(), item.MinFloat, item.MaxFloat), 14);
+ decimal flotOrigin = Math.Round(craft(inputs, item.MinFloat, item.MaxFloat), 14);
string flot = craftF(inputs, item.MinFloat, item.MaxFloat);
if (
@@ -151,11 +142,11 @@ public void parseCraft(double[] inputs, List outputs, string want)
}
}
- public void secndThread(List craftList, string wanted, double[] pool, int start, int skip)
+ public void secndThread(List craftList, string wanted, List pool, int start, int skip)
{
- foreach (IEnumerable pair in Combinations(pool, 10, start, skip))
+ foreach (IEnumerable pair in Combinations(pool, 10, start, skip))
{
- parseCraft(pair.ToArray(), craftList, wanted);
+ parseCraft(pair.ToList(), craftList, wanted);
currComb++;
}
}
@@ -191,6 +182,9 @@ private void StartCalculation()
0.157685652375221, 0.217334255576134
};
+ List inputSkins = new List();
+ foreach (double f in pool) inputSkins.Add(new InputSkin(f, 0.03f, Currency.USD));
+
Stopwatch timer = Stopwatch.StartNew();
var threads = Environment.ProcessorCount;
@@ -198,7 +192,7 @@ private void StartCalculation()
{
for (int i = 0; i < threads; i++)
{
- Thread newThread = new Thread(() => secndThread(outcomes, "1", pool, i, threads));
+ Thread newThread = new Thread(() => secndThread(outcomes, "1", inputSkins, i, threads));
newThread.Start();
t2.Add(newThread);
}
@@ -348,5 +342,20 @@ 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/FloatToolGUI.csproj b/FloatToolGUI/FloatToolGUI.csproj
index 81ab64a..27d3004 100644
--- a/FloatToolGUI/FloatToolGUI.csproj
+++ b/FloatToolGUI/FloatToolGUI.csproj
@@ -14,6 +14,8 @@
true
true
false
+
+
publish\
true
Disk
@@ -28,8 +30,6 @@
1.0.0.%2a
false
true
-
-
AnyCPU
@@ -120,6 +120,7 @@
CustomToggleSwitch.cs
+
Form
@@ -171,6 +172,7 @@
SettingsForm.cs
+
SettingsSingleFileGenerator
Settings.Designer.cs
diff --git a/FloatToolGUI/InputSkin.cs b/FloatToolGUI/InputSkin.cs
new file mode 100644
index 0000000..1dbb4b1
--- /dev/null
+++ b/FloatToolGUI/InputSkin.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FloatToolGUI
+{
+ public class InputSkin
+ {
+ public Skin SkinReference { get; set; }
+ public double WearValue { get; set; }
+ public float Price { get; set; }
+ public Currency SkinCurrency { get; set; }
+
+
+ public InputSkin(double wear, float price, Currency currency) {
+ WearValue = wear;
+ Price = price;
+ SkinCurrency = currency;
+ }
+
+ internal int CompareTo(InputSkin b)
+ {
+ return WearValue > b.WearValue ? 1 : (WearValue < b.WearValue ? -1 : 0);
+ }
+ }
+}
diff --git a/FloatToolGUI/Main.Designer.cs b/FloatToolGUI/Main.Designer.cs
index bd2761f..d9e0d4e 100644
--- a/FloatToolGUI/Main.Designer.cs
+++ b/FloatToolGUI/Main.Designer.cs
@@ -49,6 +49,8 @@ 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.outputConsoleBox = new System.Windows.Forms.TextBox();
this.DiscordUpdater = new System.Windows.Forms.Timer(this.components);
this.panel1 = new System.Windows.Forms.Panel();
@@ -68,10 +70,10 @@ private void InitializeComponent()
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel();
+ this.label24 = new System.Windows.Forms.Label();
this.versionLabel = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.panel6 = new System.Windows.Forms.Panel();
- this.stattrackCheckBox = new FloatToolGUI.CustomControls.CustomToggleSwitch();
this.checkPossibilityBtn = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.outcomeSelectorComboBox = new System.Windows.Forms.ComboBox();
@@ -86,7 +88,6 @@ private void InitializeComponent()
this.weaponSkinBox = new System.Windows.Forms.ComboBox();
this.panel5 = new System.Windows.Forms.Panel();
this.panel16 = new System.Windows.Forms.Panel();
- this.downloadProgressBar = new FloatToolGUI.CustomProgressBar();
this.searchmodeGreater_btn = new System.Windows.Forms.Button();
this.searchmodeEqual_btn = new System.Windows.Forms.Button();
this.searchmodeLess_btn = new System.Windows.Forms.Button();
@@ -109,6 +110,12 @@ private void InitializeComponent()
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.WorkStatusUpdater = new System.Windows.Forms.Timer(this.components);
+ this.downloadProgressBar = new FloatToolGUI.CustomProgressBar();
+ this.stattrackCheckBox = new FloatToolGUI.CustomControls.CustomToggleSwitch();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.panel8.SuspendLayout();
this.panel13.SuspendLayout();
@@ -127,6 +134,31 @@ private void InitializeComponent()
this.panel4.SuspendLayout();
this.SuspendLayout();
//
+ // splitContainer1
+ //
+ this.splitContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
+ resources.ApplyResources(this.splitContainer1, "splitContainer1");
+ this.splitContainer1.ForeColor = System.Drawing.Color.White;
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // 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);
+ resources.ApplyResources(this.splitContainer1.Panel1, "splitContainer1.Panel1");
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
+ this.splitContainer1.Panel2.Controls.Add(this.outputConsoleBox);
+ resources.ApplyResources(this.splitContainer1.Panel2, "splitContainer1.Panel2");
+ //
+ // flowLayoutPanel1
+ //
+ 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";
+ //
// outputConsoleBox
//
this.outputConsoleBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
@@ -168,7 +200,7 @@ private void InitializeComponent()
//
// panel11
//
- this.panel11.Controls.Add(this.outputConsoleBox);
+ this.panel11.Controls.Add(this.splitContainer1);
resources.ApplyResources(this.panel11, "panel11");
this.panel11.Name = "panel11";
//
@@ -298,12 +330,19 @@ private void InitializeComponent()
// panel3
//
this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(37)))), ((int)(((byte)(37)))));
+ this.panel3.Controls.Add(this.label24);
this.panel3.Controls.Add(this.versionLabel);
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);
//
+ // label24
+ //
+ resources.ApplyResources(this.label24, "label24");
+ this.label24.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150)))));
+ this.label24.Name = "label24";
+ //
// versionLabel
//
resources.ApplyResources(this.versionLabel, "versionLabel");
@@ -336,16 +375,6 @@ private void InitializeComponent()
resources.ApplyResources(this.panel6, "panel6");
this.panel6.Name = "panel6";
//
- // stattrackCheckBox
- //
- this.stattrackCheckBox.Checked = false;
- this.stattrackCheckBox.ForeColor = System.Drawing.Color.White;
- resources.ApplyResources(this.stattrackCheckBox, "stattrackCheckBox");
- 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);
- //
// checkPossibilityBtn
//
resources.ApplyResources(this.checkPossibilityBtn, "checkPossibilityBtn");
@@ -514,18 +543,6 @@ private void InitializeComponent()
resources.ApplyResources(this.panel16, "panel16");
this.panel16.Name = "panel16";
//
- // downloadProgressBar
- //
- resources.ApplyResources(this.downloadProgressBar, "downloadProgressBar");
- this.downloadProgressBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
- this.downloadProgressBar.ForeColor = System.Drawing.Color.White;
- this.downloadProgressBar.Maximum = 100;
- 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.Value = 0F;
- //
// searchmodeGreater_btn
//
resources.ApplyResources(this.searchmodeGreater_btn, "searchmodeGreater_btn");
@@ -735,6 +752,28 @@ private void InitializeComponent()
this.WorkStatusUpdater.Interval = 250;
this.WorkStatusUpdater.Tick += new System.EventHandler(this.timer2_Tick);
//
+ // downloadProgressBar
+ //
+ resources.ApplyResources(this.downloadProgressBar, "downloadProgressBar");
+ this.downloadProgressBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
+ this.downloadProgressBar.ForeColor = System.Drawing.Color.White;
+ this.downloadProgressBar.Maximum = 100;
+ 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.Value = 0F;
+ //
+ // stattrackCheckBox
+ //
+ this.stattrackCheckBox.Checked = false;
+ this.stattrackCheckBox.ForeColor = System.Drawing.Color.White;
+ resources.ApplyResources(this.stattrackCheckBox, "stattrackCheckBox");
+ 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);
+ //
// FloatTool
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -748,11 +787,15 @@ private void InitializeComponent()
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FloatTool";
this.Load += new System.EventHandler(this.Form1_Load);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.Panel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel8.ResumeLayout(false);
this.panel13.ResumeLayout(false);
this.panel11.ResumeLayout(false);
- this.panel11.PerformLayout();
this.panel7.ResumeLayout(false);
this.panel9.ResumeLayout(false);
this.panel3.ResumeLayout(false);
@@ -834,6 +877,9 @@ private void InitializeComponent()
private CustomControls.CustomToggleSwitch stattrackCheckBox;
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.Label label24;
}
}
diff --git a/FloatToolGUI/Main.cs b/FloatToolGUI/Main.cs
index 4242b13..9c055ed 100644
--- a/FloatToolGUI/Main.cs
+++ b/FloatToolGUI/Main.cs
@@ -21,6 +21,7 @@
using System.Windows.Forms;
using Microsoft.Win32;
using System.Numerics;
+using Button = System.Windows.Forms.Button;
namespace FloatToolGUI
{
@@ -34,6 +35,31 @@ public enum Quality
Covert
}
+ public enum Currency
+ {
+ USD = 1, GBP = 2,
+ EUR = 3, CHF = 4,
+ RUB = 5, PLN = 6,
+ BRL = 7, JPY = 8,
+ NOK = 9, IDR = 10,
+ MYR = 11, PHP = 12,
+ SGD = 13, THB = 14,
+ VND = 15, KRW = 16,
+ TRY = 17, UAH = 18,
+ MXN = 19, CAD = 20,
+ AUD = 21, NZD = 22,
+ CNY = 23, INR = 24,
+ CLP = 25, PEN = 26,
+ COP = 27, ZAR = 28,
+ HKD = 29, TWD = 30,
+ SAR = 31, AED = 32,
+ ARS = 34, ILS = 35,
+ BYN = 36, KZT = 37,
+ KWD = 38, QAR = 39,
+ CRC = 40, UYU = 41,
+ RMB = 9000, NXP = 9001
+ }
+
public partial class FloatTool : Form
{
Thread thread1;
@@ -48,64 +74,52 @@ public enum SearchMode
}
public SearchMode CurrentSearchMode = SearchMode.Equal;
+ public Currency currentCurr = Currency.USD;
+ public bool discordWorker = true;
public static string setprecission(double number, int figures)
{
int e = 0;
-
- while (number >= 10.0)
- {
+ while (number >= 10.0) {
e += 1;
number /= 10;
}
-
- while (number < 1.0)
- {
+ while (number < 1.0) {
e -= 1;
number *= 10;
}
-
figures--;
-
number = (float)Math.Round(number, figures);
-
figures += 0 - e;
- while (e > 0)
- {
+ while (e > 0) {
number *= 10;
e -= 1;
}
-
- while (e < 0)
- {
+ while (e < 0) {
number /= 10;
e += 1;
}
-
if (figures < 0)
- {
figures = 0;
- }
-
- return number.ToString($"f{figures}");
+ return number.ToString($"f{figures}", CultureInfo.InvariantCulture);
}
- static public decimal craft(double[] ingridients, float minFloat, float maxFloat)
+ static public decimal craft(List ingridients, float minFloat, float maxFloat)
{
decimal avgFloat = 0;
- foreach (double f in ingridients)
+ foreach (InputSkin f in ingridients)
{
- avgFloat += (decimal)f;
+ avgFloat += (decimal)f.WearValue;
}
avgFloat /= 10;
return ((decimal)(maxFloat - minFloat) * avgFloat) + (decimal)minFloat;
}
- static public string craftF(double[] ingridients, float minFloat, float maxFloat)
+ 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]);
+ arrInput[i] = Convert.ToSingle(ingridients[i].WearValue);
}
foreach (float f in arrInput)
{
@@ -161,8 +175,7 @@ static public string getSkinData(string name)
}
}
-
- public void parseCraft(double[] inputs, List outputs, string want)
+ public void parseCraft(List inputs, List outputs, string want)
{
//List results = new List();
decimal wantFloat;
@@ -170,7 +183,7 @@ public void parseCraft(double[] inputs, List outputs, string want)
foreach (var item in outputs)
{
- decimal flotOrigin = Math.Round(craft(inputs.ToArray(), item.MinFloat, item.MaxFloat), 14);
+ decimal flotOrigin = Math.Round(craft(inputs, item.MinFloat, item.MaxFloat), 14);
string flot = craftF(inputs, item.MinFloat, item.MaxFloat);
if (
@@ -181,9 +194,18 @@ public void parseCraft(double[] inputs, List outputs, string want)
{
this.Invoke((MethodInvoker)(() =>
{
+ float price = 0f;
+ List floatStrings = new List();
+ foreach (var fl in inputs)
+ {
+ floatStrings.Add(Math.Round(fl.WearValue, 14).ToString().Replace(",", "."));
+ price += fl.Price;
+ }
+ 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}");
ConsoleBuffer.Append($"{strings.TestFloat}: {flot}{newLine}");
+ ConsoleBuffer.Append($"Цена: {price} {inputs[0].SkinCurrency}{newLine}");
ConsoleBuffer.Append($"{strings.FloatList}: ");
if (!muteSound)
{
@@ -191,18 +213,20 @@ public void parseCraft(double[] inputs, List outputs, string want)
SoundPlayer player = new SoundPlayer(Properties.Resources.notification);
player.Play();
}
- client.SetPresence(new RichPresence()
+ if (discordWorker)
{
- Details = "Нашёл комбинацию!!!",
- State = "Крафчу " + flotOrigin,
- Assets = new Assets()
+ client.SetPresence(new RichPresence()
{
- LargeImageKey = "icon",
- LargeImageText = "FloatTool"
- }
- });
- List floatStrings = new List();
- foreach (var fl in inputs) floatStrings.Add(Math.Round(fl, 14).ToString().Replace(",", "."));
+ Details = "Нашёл комбинацию!!!",
+ State = "Крафчу " + flotOrigin,
+ Assets = new Assets()
+ {
+ LargeImageKey = "icon",
+ LargeImageText = "FloatTool"
+ }
+ });
+ }
+
ConsoleBuffer.Append($"[{String.Join(", ", floatStrings)}]{newLine}====================================={newLine}");
}
));
@@ -285,37 +309,28 @@ public FloatTool()
SetStyle(ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
ConsoleBuffer = new StringBuilder();
newLine = Environment.NewLine;
+ CheckRegistry();
registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool");
- if (registryData == null)
- {
- registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
- registryData.SetValue("darkMode", true);
- registryData.SetValue("sound", true);
- registryData.SetValue("updateCheck", true);
- registryData.SetValue("bufferSpeed", 250);
- registryData.Close();
- }
- else
+ 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")))
{
- ChangeTheme(Convert.ToBoolean(registryData.GetValue("darkMode")));
- muteSound = !Convert.ToBoolean(registryData.GetValue("sound"));
- WorkStatusUpdater.Interval = (int)registryData.GetValue("bufferSpeed");
- if (Convert.ToBoolean(registryData.GetValue("updateCheck")))
+ string ver = CheckUpdates();
+ if (ver != versionLabel.Text)
{
- string ver = CheckUpdates();
- if (ver != versionLabel.Text)
- {
- DialogResult result = MessageBox.Show(
- $"Доступна версия {ver}! Хотите открыть страницу загрузки?",
- "Обновление",
- MessageBoxButtons.YesNo,
- MessageBoxIcon.Information,
- MessageBoxDefaultButton.Button1,
- MessageBoxOptions.DefaultDesktopOnly);
-
- if (result == DialogResult.Yes)
- System.Diagnostics.Process.Start("https://github.com/Nemeshio/FloatTool-GUI/releases/latest");
- }
+ DialogResult result = MessageBox.Show(
+ $"Доступна версия {ver}! Хотите открыть страницу загрузки?",
+ "Обновление",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Information,
+ MessageBoxDefaultButton.Button1,
+ MessageBoxOptions.DefaultDesktopOnly);
+
+ if (result == DialogResult.Yes)
+ System.Diagnostics.Process.Start("https://github.com/Nemeshio/FloatTool-GUI/releases/latest");
}
}
}
@@ -343,31 +358,32 @@ private void Form1_Load(object sender, EventArgs e)
//dev = 824349399688937543
//main = 734042978246721537
client = new DiscordRpcClient("734042978246721537");
-
- //Subscribe to events
- client.OnReady += (sender2, e2) =>
+ if (discordWorker)
{
- Console.WriteLine("Received Ready from user {0}", e2.User.Username);
- };
+ //Subscribe to events
+ client.OnReady += (sender2, e2) =>
+ {
+ Console.WriteLine("Received Ready from user {0}", e2.User.Username);
+ };
- client.OnPresenceUpdate += (sender2, e2) =>
- {
- Console.WriteLine("Received Update! {0}", e2.Presence);
- };
+ client.OnPresenceUpdate += (sender2, e2) =>
+ {
+ Console.WriteLine("Received Update! {0}", e2.Presence);
+ };
- //Connect to the RPC
- client.Initialize();
+ //Connect to the RPC
+ client.Initialize();
- client.SetPresence(new RichPresence()
- {
- Details = "Настраиваю поиск",
- Assets = new Assets()
+ client.SetPresence(new RichPresence()
{
- LargeImageKey = "icon",
- LargeImageText = "FloatTool"
- }
- });
-
+ Details = "Настраиваю поиск",
+ Assets = new Assets()
+ {
+ LargeImageKey = "icon",
+ LargeImageText = "FloatTool"
+ }
+ });
+ }
thread1 = new Thread(runCycle);
this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea;
this.threadCountInput.Value = Environment.ProcessorCount;
@@ -462,15 +478,86 @@ private static IEnumerable Combinations(IEnumerable elements, int k, int s
} while (NextCombination(numbers, size, k));
}
- public void secndThread(List craftList, string wanted, double[] pool, int start, int skip)
+ public void secndThread(List craftList, string wanted, List pool, int start, int skip)
{
- foreach (IEnumerable pair in Combinations(pool, 10, start, skip))
+ foreach (IEnumerable pair in Combinations(pool, 10, start, skip))
{
- parseCraft(pair.ToArray(), craftList, wanted);
+ parseCraft(pair.ToList(), craftList, wanted);
currComb++;
//Console.WriteLine(currComb);
}
}
+
+ public List combinationWindows = new List();
+
+ public void AddCombinationToList(string time, decimal flotOrigin, string flot, float price, List floatStrings)
+ {
+ Panel tmpPanel = new Panel
+ {
+ BackColor = Color.FromArgb(44, 44, 44),
+ ForeColor = Color.White,
+ Size = new Size(425, 220),
+ Margin = new Padding(3),
+ Font = new Font("Microsoft JhengHei Light", 10f)
+ };
+ #region Labels
+ tmpPanel.Controls.Add(new Label
+ {
+ AutoSize = true,
+ Location = new Point(3,3),
+ Text = $"{outcomeSelectorComboBox.Text}\nВозможный флоат: {flotOrigin.ToString(CultureInfo.InvariantCulture)}\nПроверочный флоат: {flot}"
+ });
+ tmpPanel.Controls.Add(new Label
+ {
+ AutoSize = false,
+ Size = new Size(160, 54),
+ Location = new Point(263, 3),
+ TextAlign = ContentAlignment.MiddleRight,
+ Text = $"{time}\nЦена: {price.ToString("0.00")} {currentCurr}"
+ });
+ tmpPanel.Controls.Add(new Label
+ {
+ AutoSize = true,
+ Location = new Point(3, 62),
+ Text = "Ингредиенты:"
+ });
+ #endregion
+ #region TextBoxes & Buttons
+ for(int i = 0; i < 10; i++)
+ {
+ int y = 27 * (i % 5) + 81;
+ int x = i > 4 ? 220 : 6;
+ tmpPanel.Controls.Add(new TextBox
+ {
+ BackColor = Color.FromArgb(32, 32, 32),
+ ForeColor = Color.White,
+ ReadOnly = true,
+ BorderStyle = BorderStyle.FixedSingle,
+ Location = new Point(x, y),
+ Size = new Size(116, 25),
+ Text = floatStrings[i]
+ });
+
+ var tmpButton = new Button
+ {
+ BackColor = Color.FromArgb(56, 56, 56),
+ Location = new Point(117 + x, y),
+ Font = new Font("Microsoft JhengHei Light", 8f),
+ Size = new Size(84, 25),
+ Text = "Копировать",
+ Tag = floatStrings[i],
+ FlatStyle = FlatStyle.Flat
+ };
+
+ tmpButton.FlatAppearance.BorderSize = 0;
+ tmpButton.Click += copyButtonClick;
+ tmpPanel.Controls.Add(tmpButton);
+ }
+ #endregion
+
+ combinationWindows.Add(tmpPanel);
+ }
+
public BigInteger Fact(int number)
{
if (number == 1)
@@ -486,17 +573,20 @@ public BigInteger Fact(int number)
private void StartCalculation()
{
- client.SetPresence(new RichPresence()
- {
- Details = "Начал поиск",
- State = "Ищу " + searchFloatInput.Text,
- Timestamps = Timestamps.Now,
- Assets = new Assets()
+ if (discordWorker) {
+ client.SetPresence(new RichPresence()
{
- LargeImageKey = "icon",
- LargeImageText = "FloatTool"
- }
- });
+ Details = "Начал поиск",
+ State = "Ищу " + searchFloatInput.Text,
+ Timestamps = Timestamps.Now,
+ Assets = new Assets()
+ {
+ LargeImageKey = "icon",
+ LargeImageText = "FloatTool"
+ }
+ });
+ }
+
totalComb = quantityInput.Value == 10 ? 1 : Fact((int)quantityInput.Value) / (Fact(10) * Fact((int)quantityInput.Value - 10));
currComb = 0;
@@ -507,6 +597,7 @@ private void StartCalculation()
startBtn.Text = "Стоп";
fullSkinName.SelectionStart = fullSkinName.Text.Length;
outputConsoleBox.ScrollToCaret();
+ flowLayoutPanel1.Controls.Clear();
}
));
@@ -514,7 +605,7 @@ private void StartCalculation()
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=5";
+ 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)(() =>
@@ -528,7 +619,7 @@ private void StartCalculation()
}
));
- List floats = new List();
+ List inputSkins = new List();
using (WebClient wc = new WebClient())
{
string json = wc.DownloadString(url);
@@ -557,7 +648,9 @@ private void StartCalculation()
string jsonf = wcf.DownloadString(url);
dynamic rf = JsonConvert.DeserializeObject(jsonf);
//Debug.WriteLine("[DEBUG] " + counter + "/" + count + " load from csgofloat = " + jsonf);
- floats.Add(Convert.ToDouble(rf["iteminfo"]["floatvalue"]));
+ 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 e)
{
@@ -576,18 +669,15 @@ private void StartCalculation()
{
if (ascendingCheckBox.Checked)
{
- floats.Sort((a, b) => a.CompareTo(b));
+ inputSkins.Sort((a, b) => a.CompareTo(b));
Console.WriteLine("Sorted ascending");
}
else
{
- floats.Sort((a, b) => b.CompareTo(a));
+ inputSkins.Sort((a, b) => b.CompareTo(a));
Console.WriteLine("Sorted descending");
}
}
- //foreach (double v in floats) {
- // Console.WriteLine(v);
- //}
this.Invoke((MethodInvoker)(() =>
{
outputConsoleBox.AppendText( "Поиск ауткамов..." + newLine);
@@ -646,8 +736,6 @@ private void StartCalculation()
}
));
- double[] pool = floats.ToArray();
-
Searching = true;
int threads = (int)threadCountInput.Value;
@@ -655,7 +743,7 @@ private void StartCalculation()
{
for (int i = 1; i < threads; i++)
{
- Thread newThread = new Thread(() => secndThread(outcomes, wanted, pool, i, threads));
+ Thread newThread = new Thread(() => secndThread(outcomes, wanted, inputSkins, i, threads));
newThread.Start();
t2.Add(newThread);
}
@@ -665,9 +753,9 @@ private void StartCalculation()
Console.WriteLine(ex.Message);
}
- foreach (IEnumerable pair in Combinations(pool, 10, 0, threads))
+ foreach (IEnumerable pair in Combinations(inputSkins, 10, 0, threads))
{
- parseCraft(pair.ToArray(), outcomes, wanted);
+ parseCraft(pair.ToList(), outcomes, wanted);
currComb++;
}
Console.WriteLine("Next group");
@@ -968,26 +1056,22 @@ private void panel9_MouseDown(object sender, MouseEventArgs e)
}
}
+ private void copyButtonClick(object sender, EventArgs e)
+ {
+ Clipboard.SetText(((System.Windows.Forms.Button)sender).Tag.ToString());
+ }
+
private void settingsButton_Click(object sender, EventArgs e)
{
SettingsForm settings = new SettingsForm();
settings.ShowDialog();
+ CheckRegistry();
registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool");
- if (registryData == null)
- {
- registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
- registryData.SetValue("darkMode", true);
- registryData.SetValue("sound", true);
- registryData.SetValue("updateCheck", true);
- registryData.SetValue("bufferSpeed", 250);
- registryData.Close();
- }
- else
- {
- ChangeTheme(Convert.ToBoolean(registryData.GetValue("darkMode")));
- muteSound = !Convert.ToBoolean(registryData.GetValue("sound"));
- WorkStatusUpdater.Interval = (int)registryData.GetValue("bufferSpeed");
- }
+ 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");
}
private void benchmarkButton_Click(object sender, EventArgs e)
@@ -1216,18 +1300,20 @@ private void gpuSearch_btn_Click(object sender, EventArgs e)
0.156294032931328, 0.179465100169182,
0.327553898096085, 0.150170117616653
};
-
- client.SetPresence(new RichPresence()
+ if (discordWorker)
{
- Details = "GPU Тест",
- State = "Тестирование подбора на видеокарте",
- Timestamps = Timestamps.Now,
- Assets = new Assets()
+ client.SetPresence(new RichPresence()
{
- LargeImageKey = "icon",
- LargeImageText = "FloatTool"
- }
- });
+ Details = "GPU Тест",
+ State = "Тестирование подбора на видеокарте",
+ Timestamps = Timestamps.Now,
+ Assets = new Assets()
+ {
+ LargeImageKey = "icon",
+ LargeImageText = "FloatTool"
+ }
+ });
+ }
SwitchEnabled();
}
@@ -1240,6 +1326,14 @@ private void timer2_Tick(object sender, EventArgs e)
last = currComb;
combinationsStatusLabel.Text = $"Проверено комбинаций: {currComb} / {totalComb}";
+ foreach (var tmpPanel in combinationWindows)
+ {
+ flowLayoutPanel1.Controls.Add(tmpPanel);
+ flowLayoutPanel1.ScrollControlIntoView(tmpPanel);
+ }
+
+ combinationWindows.Clear();
+
if (ConsoleBuffer.Length > 0)
{
outputConsoleBox.Text += ConsoleBuffer.ToString();
diff --git a/FloatToolGUI/Main.resx b/FloatToolGUI/Main.resx
index 01d32c1..67f5d57 100644
--- a/FloatToolGUI/Main.resx
+++ b/FloatToolGUI/Main.resx
@@ -118,20 +118,74 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
Fill
+
+ 0, 0
+
+
+ Horizontal
+
+
+
+ True
+
+
+ Fill
+
+
+ 5, 5
+
+
+ 0, 0, 0, 0
+
+
+ 449, 292
+
+
+ 0
+
+
+ flowLayoutPanel1
+
+
+ System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ splitContainer1.Panel1
+
+
+ 0
+
+
+ 5, 5, 5, 5
+
+
+ splitContainer1.Panel1
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ splitContainer1
+
+
+ 0
+
+
+ Fill
+
Microsoft JhengHei UI Light, 10pt
- 0, 0
+ 5, 5
40, 40, 40, 40
-
True
@@ -139,7 +193,7 @@
Both
- 459, 408
+ 449, 92
0
@@ -155,11 +209,47 @@
System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- panel11
+ splitContainer1.Panel2
0
+
+ 5, 5, 5, 5
+
+
+ splitContainer1.Panel2
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ splitContainer1
+
+
+ 1
+
+
+ 459, 408
+
+
+ 302
+
+
+ 1
+
+
+ splitContainer1
+
+
+ System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ panel11
+
+
+ 0
+
65, 16
@@ -649,6 +739,39 @@
0
+
+ Top, Right
+
+
+ True
+
+
+ NoControl
+
+
+ 173, 20
+
+
+ 57, 15
+
+
+ 1
+
+
+ by Prevter
+
+
+ label24
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ panel3
+
+
+ 0
+
True
@@ -665,7 +788,7 @@
1
- v.0.5.2
+ v.0.6.0
versionLabel
@@ -677,7 +800,7 @@
panel3
- 0
+ 1
True
@@ -710,7 +833,7 @@
panel3
- 1
+ 2
Top
@@ -737,7 +860,7 @@
2
- 79, 61
+ 79, 64
38, 24
@@ -770,7 +893,7 @@
NoControl
- 150, 90
+ 150, 96
267, 24
@@ -806,7 +929,7 @@
NoControl
- 285, 10
+ 285, 13
71, 18
@@ -848,7 +971,7 @@
* Искать всё *
- 203, 61
+ 203, 64
214, 24
@@ -896,7 +1019,7 @@
Battle-Scarred
- 288, 31
+ 288, 34
129, 24
@@ -932,7 +1055,7 @@
NoControl
- 9, 64
+ 9, 67
70, 18
@@ -968,7 +1091,7 @@
NoControl
- 9, 10
+ 9, 13
88, 18
@@ -1004,7 +1127,7 @@
NoControl
- 9, 93
+ 9, 99
127, 18
@@ -1112,7 +1235,7 @@
P90
- PP-19 Bizon
+ PP-Bizon
R8 Revolver
@@ -1142,7 +1265,7 @@
XM1014
- 12, 31
+ 12, 34
132, 24
@@ -1178,7 +1301,7 @@
NoControl
- 129, 64
+ 129, 67
68, 18
@@ -1214,7 +1337,7 @@
NoControl
- 147, 10
+ 147, 13
43, 18
@@ -1244,7 +1367,7 @@
Microsoft JhengHei Light, 12pt
- 0, 120
+ 0, 126
10, 12, 10, 12
@@ -1286,7 +1409,7 @@
Microsoft JhengHei Light, 9pt
- 150, 31
+ 150, 34
132, 24
@@ -1316,7 +1439,7 @@
0, 40
- 427, 145
+ 427, 151
1
@@ -1337,7 +1460,7 @@
None
- 12, 160
+ 12, 157
0, 0, 0, 0
@@ -1373,7 +1496,7 @@
NoControl
- 169, 32
+ 169, 29
70, 32
@@ -1409,7 +1532,7 @@
NoControl
- 91, 32
+ 91, 29
70, 32
@@ -1445,7 +1568,7 @@
NoControl
- 12, 32
+ 12, 29
70, 32
@@ -1481,7 +1604,7 @@
NoControl
- 9, 11
+ 9, 8
105, 18
@@ -1517,7 +1640,7 @@
NoControl
- 9, 70
+ 9, 67
108, 18
@@ -1547,7 +1670,7 @@
Microsoft JhengHei Light, 10pt
- 122, 99
+ 122, 96
116, 21
@@ -1574,7 +1697,7 @@
Microsoft JhengHei Light, 10pt
- 122, 130
+ 122, 127
117, 21
@@ -1604,7 +1727,7 @@
NoControl
- 245, 42
+ 245, 39
136, 22
@@ -1637,7 +1760,7 @@
NoControl
- 9, 129
+ 9, 126
67, 18
@@ -1673,7 +1796,7 @@
NoControl
- 9, 98
+ 9, 95
89, 18
@@ -1703,7 +1826,7 @@
Microsoft JhengHei Light, 10pt
- 122, 70
+ 122, 67
116, 18
@@ -1736,7 +1859,7 @@
NoControl
- 245, 18
+ 245, 15
111, 22
@@ -1772,7 +1895,7 @@
NoControl
- 244, 70
+ 244, 67
173, 81
@@ -1802,7 +1925,7 @@
0, 0
- 427, 197
+ 427, 191
12
@@ -1901,10 +2024,10 @@
NoControl
- 261, 6
+ 244, 0
- 160, 60
+ 177, 71
3
@@ -1982,7 +2105,7 @@
Bottom
- 0, 197
+ 0, 191
427, 76
@@ -2009,10 +2132,10 @@
Microsoft JhengHei Light, 10pt
- 0, 185
+ 0, 191
- 427, 273
+ 427, 267
0
diff --git a/FloatToolGUI/Properties/DataSources/Utils.Currency.datasource b/FloatToolGUI/Properties/DataSources/Utils.Currency.datasource
new file mode 100644
index 0000000..9573ecf
--- /dev/null
+++ b/FloatToolGUI/Properties/DataSources/Utils.Currency.datasource
@@ -0,0 +1,10 @@
+
+
+
+ FloatToolGUI.Utils+Currency, FloatTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
\ No newline at end of file
diff --git a/FloatToolGUI/Properties/Settings.Designer.cs b/FloatToolGUI/Properties/Settings.Designer.cs
index e1c20db..7c85d1e 100644
--- a/FloatToolGUI/Properties/Settings.Designer.cs
+++ b/FloatToolGUI/Properties/Settings.Designer.cs
@@ -22,14 +22,5 @@ public static Settings Default {
return defaultInstance;
}
}
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string Nova {
- get {
- return ((string)(this["Nova"]));
- }
- }
}
}
diff --git a/FloatToolGUI/Properties/Settings.settings b/FloatToolGUI/Properties/Settings.settings
index 17c701c..8e615f2 100644
--- a/FloatToolGUI/Properties/Settings.settings
+++ b/FloatToolGUI/Properties/Settings.settings
@@ -1,9 +1,5 @@
-
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/FloatToolGUI/SettingsForm.Designer.cs b/FloatToolGUI/SettingsForm.Designer.cs
index c3142b2..36879b8 100644
--- a/FloatToolGUI/SettingsForm.Designer.cs
+++ b/FloatToolGUI/SettingsForm.Designer.cs
@@ -28,6 +28,7 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
+ this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
this.panel3 = new System.Windows.Forms.Panel();
this.closeBtn = new System.Windows.Forms.Button();
@@ -42,8 +43,16 @@ private void InitializeComponent()
this.checkUpdatesToggle = new FloatToolGUI.CustomControls.CustomToggleSwitch();
this.soundToggle = new FloatToolGUI.CustomControls.CustomToggleSwitch();
this.darkModeToggle = new FloatToolGUI.CustomControls.CustomToggleSwitch();
+ this.discordRpcToggle = new FloatToolGUI.CustomControls.CustomToggleSwitch();
+ this.label5 = new System.Windows.Forms.Label();
+ this.currencyComboBox = new System.Windows.Forms.ComboBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.currencyBindingSource = new System.Windows.Forms.BindingSource(this.components);
+ this.currencyBindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bufferSpeedNUP)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currencyBindingSource)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currencyBindingSource1)).BeginInit();
this.SuspendLayout();
//
// panel3
@@ -134,7 +143,7 @@ private void InitializeComponent()
this.saveChangesBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F);
this.saveChangesBtn.ForeColor = System.Drawing.Color.White;
this.saveChangesBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.saveChangesBtn.Location = new System.Drawing.Point(8, 250);
+ this.saveChangesBtn.Location = new System.Drawing.Point(8, 320);
this.saveChangesBtn.Name = "saveChangesBtn";
this.saveChangesBtn.Size = new System.Drawing.Size(185, 32);
this.saveChangesBtn.TabIndex = 4;
@@ -151,7 +160,7 @@ private void InitializeComponent()
this.resetChangesBtn.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F);
this.resetChangesBtn.ForeColor = System.Drawing.Color.White;
this.resetChangesBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.resetChangesBtn.Location = new System.Drawing.Point(199, 250);
+ this.resetChangesBtn.Location = new System.Drawing.Point(199, 320);
this.resetChangesBtn.Name = "resetChangesBtn";
this.resetChangesBtn.Size = new System.Drawing.Size(185, 32);
this.resetChangesBtn.TabIndex = 4;
@@ -165,7 +174,7 @@ private void InitializeComponent()
this.bufferSpeedNUP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.bufferSpeedNUP.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F);
this.bufferSpeedNUP.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(150)))), ((int)(((byte)(150)))));
- this.bufferSpeedNUP.Location = new System.Drawing.Point(12, 207);
+ this.bufferSpeedNUP.Location = new System.Drawing.Point(8, 280);
this.bufferSpeedNUP.Maximum = new decimal(new int[] {
5000,
0,
@@ -177,7 +186,7 @@ private void InitializeComponent()
0,
0});
this.bufferSpeedNUP.Name = "bufferSpeedNUP";
- this.bufferSpeedNUP.Size = new System.Drawing.Size(366, 32);
+ this.bufferSpeedNUP.Size = new System.Drawing.Size(376, 32);
this.bufferSpeedNUP.TabIndex = 5;
this.bufferSpeedNUP.Value = new decimal(new int[] {
250,
@@ -191,7 +200,7 @@ private void InitializeComponent()
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft JhengHei Light", 14F);
this.label4.ForeColor = System.Drawing.Color.White;
- this.label4.Location = new System.Drawing.Point(8, 180);
+ this.label4.Location = new System.Drawing.Point(4, 253);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(320, 24);
this.label4.TabIndex = 3;
@@ -233,17 +242,77 @@ private void InitializeComponent()
this.darkModeToggle.TurnedOnColor = System.Drawing.Color.Green;
this.darkModeToggle.OnToggled += new System.EventHandler(this.darkModeToggle_OnToggled);
//
+ // discordRpcToggle
+ //
+ this.discordRpcToggle.Checked = true;
+ this.discordRpcToggle.ForeColor = System.Drawing.Color.White;
+ this.discordRpcToggle.Location = new System.Drawing.Point(8, 173);
+ this.discordRpcToggle.Name = "discordRpcToggle";
+ this.discordRpcToggle.Size = new System.Drawing.Size(64, 36);
+ 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);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Font = new System.Drawing.Font("Microsoft JhengHei Light", 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.TabIndex = 3;
+ this.label5.Text = "Интеграция Discord";
+ //
+ // currencyComboBox
+ //
+ 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.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.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.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.TabIndex = 3;
+ this.label6.Text = "Валюта:";
+ //
+ // currencyBindingSource
+ //
+ this.currencyBindingSource.DataSource = typeof(FloatToolGUI.Utils.Currency);
+ //
+ // currencyBindingSource1
+ //
+ this.currencyBindingSource1.DataSource = typeof(FloatToolGUI.Utils.Currency);
+ //
// SettingsForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
- this.ClientSize = new System.Drawing.Size(390, 294);
+ this.ClientSize = new System.Drawing.Size(390, 364);
+ this.Controls.Add(this.currencyComboBox);
this.Controls.Add(this.bufferSpeedNUP);
this.Controls.Add(this.resetChangesBtn);
this.Controls.Add(this.saveChangesBtn);
this.Controls.Add(this.label4);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.label5);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
+ this.Controls.Add(this.discordRpcToggle);
this.Controls.Add(this.checkUpdatesToggle);
this.Controls.Add(this.soundToggle);
this.Controls.Add(this.label1);
@@ -257,6 +326,8 @@ private void InitializeComponent()
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.bufferSpeedNUP)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currencyBindingSource)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.currencyBindingSource1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -277,5 +348,11 @@ private void InitializeComponent()
private System.Windows.Forms.Button resetChangesBtn;
private System.Windows.Forms.NumericUpDown bufferSpeedNUP;
private System.Windows.Forms.Label label4;
+ private CustomControls.CustomToggleSwitch discordRpcToggle;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.ComboBox currencyComboBox;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.BindingSource currencyBindingSource;
+ private System.Windows.Forms.BindingSource currencyBindingSource1;
}
}
\ No newline at end of file
diff --git a/FloatToolGUI/SettingsForm.cs b/FloatToolGUI/SettingsForm.cs
index 4ea3f70..7cd9d1b 100644
--- a/FloatToolGUI/SettingsForm.cs
+++ b/FloatToolGUI/SettingsForm.cs
@@ -8,6 +8,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using static FloatToolGUI.Utils;
namespace FloatToolGUI
{
@@ -18,23 +19,16 @@ public partial class SettingsForm : Form
public SettingsForm()
{
InitializeComponent();
+ currencyComboBox.DataSource = Enum.GetValues(typeof(Currency));
+ CheckRegistry();
registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool");
- if (registryData == null)
- {
- registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
- registryData.SetValue("darkMode", true);
- registryData.SetValue("sound", true);
- registryData.SetValue("updateCheck", true);
- registryData.SetValue("bufferSpeed", 250);
- registryData.Close();
- }
- else
- {
- darkModeToggle.Checked = Convert.ToBoolean(registryData.GetValue("darkMode"));
- soundToggle.Checked = Convert.ToBoolean(registryData.GetValue("sound"));
- checkUpdatesToggle.Checked = Convert.ToBoolean(registryData.GetValue("updateCheck"));
- bufferSpeedNUP.Value = (int)registryData.GetValue("bufferSpeed");
- }
+ darkModeToggle.Checked = Convert.ToBoolean(registryData.GetValue("darkMode"));
+ soundToggle.Checked = Convert.ToBoolean(registryData.GetValue("sound"));
+ checkUpdatesToggle.Checked = Convert.ToBoolean(registryData.GetValue("updateCheck"));
+ bufferSpeedNUP.Value = (int)registryData.GetValue("bufferSpeed");
+ discordRpcToggle.Checked = Convert.ToBoolean(registryData.GetValue("discordRPC"));
+ currencyComboBox.SelectedItem = (Currency)registryData.GetValue("currency");
+ saveChangesBtn.Enabled = false;
}
private void CloseForm(object sender, EventArgs e)
@@ -82,46 +76,28 @@ private void bufferSpeedNUP_ValueChanged(object sender, EventArgs e)
private void saveChangesBtn_Click(object sender, EventArgs e)
{
+ CheckRegistry();
registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool", true);
- if (registryData == null)
- {
- registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
- registryData.SetValue("darkMode", darkModeToggle.Checked);
- registryData.SetValue("sound", soundToggle.Checked);
- registryData.SetValue("updateCheck", checkUpdatesToggle.Checked);
- registryData.SetValue("bufferSpeed", bufferSpeedNUP.Value);
- registryData.Close();
- }
- else
- {
- registryData.SetValue("darkMode", darkModeToggle.Checked);
- registryData.SetValue("sound", soundToggle.Checked);
- registryData.SetValue("updateCheck", checkUpdatesToggle.Checked);
- registryData.SetValue("bufferSpeed", (int)bufferSpeedNUP.Value);
- registryData.Close();
- }
+ registryData.SetValue("darkMode", darkModeToggle.Checked);
+ registryData.SetValue("sound", soundToggle.Checked);
+ registryData.SetValue("updateCheck", checkUpdatesToggle.Checked);
+ registryData.SetValue("bufferSpeed", (int)bufferSpeedNUP.Value);
+ registryData.SetValue("discordRPC", discordRpcToggle.Checked);
+ registryData.SetValue("currency", (int)currencyComboBox.SelectedValue);
+ registryData.Close();
saveChangesBtn.Enabled = false;
}
private void resetChangesBtn_Click(object sender, EventArgs e)
{
+ CheckRegistry();
registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool");
- if (registryData == null)
- {
- registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
- registryData.SetValue("darkMode", true);
- registryData.SetValue("sound", true);
- registryData.SetValue("updateCheck", true);
- registryData.SetValue("bufferSpeed", 250);
- registryData.Close();
- }
- else
- {
- darkModeToggle.Checked = Convert.ToBoolean(registryData.GetValue("darkMode"));
- soundToggle.Checked = Convert.ToBoolean(registryData.GetValue("sound"));
- checkUpdatesToggle.Checked = Convert.ToBoolean(registryData.GetValue("updateCheck"));
- bufferSpeedNUP.Value = (int)registryData.GetValue("bufferSpeed");
- }
+ darkModeToggle.Checked = Convert.ToBoolean(registryData.GetValue("darkMode"));
+ soundToggle.Checked = Convert.ToBoolean(registryData.GetValue("sound"));
+ checkUpdatesToggle.Checked = Convert.ToBoolean(registryData.GetValue("updateCheck"));
+ bufferSpeedNUP.Value = (int)registryData.GetValue("bufferSpeed");
+ discordRpcToggle.Checked = Convert.ToBoolean(registryData.GetValue("discordRPC"));
+ currencyComboBox.SelectedItem = (Currency)registryData.GetValue("currency");
saveChangesBtn.Enabled = false;
}
}
diff --git a/FloatToolGUI/SettingsForm.resx b/FloatToolGUI/SettingsForm.resx
index d6bb1e0..4808448 100644
--- a/FloatToolGUI/SettingsForm.resx
+++ b/FloatToolGUI/SettingsForm.resx
@@ -117,6 +117,12 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 17, 17
+
+
+ 194, 17
+
diff --git a/FloatToolGUI/Skin.cs b/FloatToolGUI/Skin.cs
index ee358f1..7ba815d 100644
--- a/FloatToolGUI/Skin.cs
+++ b/FloatToolGUI/Skin.cs
@@ -23,7 +23,7 @@ public Skin(string name, float minWear, float maxWear, Quality rarity)
public override string ToString()
{
- return $"{Name} ({Rarity.ToString()}) | {MinFloat}-{MaxFloat}";
+ return $"{Name} ({Rarity}) | {MinFloat}-{MaxFloat}";
}
}
}
diff --git a/FloatToolGUI/Utils.cs b/FloatToolGUI/Utils.cs
index c0473dd..ddd9dd8 100644
--- a/FloatToolGUI/Utils.cs
+++ b/FloatToolGUI/Utils.cs
@@ -4,12 +4,38 @@
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Win32;
using Newtonsoft.Json;
namespace FloatToolGUI
{
- class Utils
+ static class Utils
{
+ public enum Currency
+ {
+ USD = 1, GBP = 2,
+ EUR = 3, CHF = 4,
+ RUB = 5, PLN = 6,
+ BRL = 7, JPY = 8,
+ NOK = 9, IDR = 10,
+ MYR = 11, PHP = 12,
+ SGD = 13, THB = 14,
+ VND = 15, KRW = 16,
+ TRY = 17, UAH = 18,
+ MXN = 19, CAD = 20,
+ AUD = 21, NZD = 22,
+ CNY = 23, INR = 24,
+ CLP = 25, PEN = 26,
+ COP = 27, ZAR = 28,
+ HKD = 29, TWD = 30,
+ SAR = 31, AED = 32,
+ ARS = 34, ILS = 35,
+ BYN = 36, KZT = 37,
+ KWD = 38, QAR = 39,
+ CRC = 40, UYU = 41,
+ RMB = 9000, NXP = 9001
+ }
+
public static string CheckUpdates()
{
using (var client = new HttpClient())
@@ -25,5 +51,30 @@ public static string CheckUpdates()
}
}
}
+
+ public static void CheckRegistry()
+ {
+ var registryData = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\FloatTool", true);
+ if (registryData == null)
+ {
+ registryData = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\FloatTool");
+ registryData.SetValue("darkMode", true);
+ registryData.SetValue("sound", true);
+ registryData.SetValue("updateCheck", true);
+ registryData.SetValue("bufferSpeed", 250);
+ registryData.SetValue("discordRPC", true);
+ registryData.SetValue("currency", (int)Currency.USD);
+ registryData.Close();
+ }
+ else
+ {
+ if(registryData.GetValue("darkMode") == null) registryData.SetValue("darkMode", true);
+ if (registryData.GetValue("sound") == null) registryData.SetValue("sound", true);
+ if (registryData.GetValue("updateCheck") == null) registryData.SetValue("updateCheck", true);
+ if (registryData.GetValue("bufferSpeed") == null) registryData.SetValue("bufferSpeed", 250);
+ if (registryData.GetValue("discordRPC") == null) registryData.SetValue("discordRPC", true);
+ if (registryData.GetValue("currency") == null) registryData.SetValue("currency", (int)Currency.USD);
+ }
+ }
}
}