Tweaked some things

This commit is contained in:
2023-05-25 14:15:12 +02:00
parent f417f3581a
commit c105382269
3 changed files with 50 additions and 13 deletions
+6 -4
View File
@@ -114,22 +114,24 @@ namespace Test_Merge
btnFirstDriver.Anchor = AnchorStyles.Left | AnchorStyles.Top; btnFirstDriver.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btnSecondDriver.Anchor = AnchorStyles.Right | AnchorStyles.Top; btnSecondDriver.Anchor = AnchorStyles.Right | AnchorStyles.Top;
lblGap.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
lblGap.Anchor = AnchorStyles.Left | AnchorStyles.Right;
lblGap.Dock = DockStyle.None;
lblGap.TextAlign = ContentAlignment.MiddleCenter; lblGap.TextAlign = ContentAlignment.MiddleCenter;
lblGap.Font = new Font(lblGap.Font.FontFamily, 15);
btnFirstDriver.Click += form1.btnDriver_Click; btnFirstDriver.Click += form1.btnDriver_Click;
btnSecondDriver.Click += form1.btnDriver_Click; btnSecondDriver.Click += form1.btnDriver_Click;
btnFirstDriver.FlatStyle = FlatStyle.Popup; btnFirstDriver.FlatStyle = FlatStyle.Popup;
btnSecondDriver.FlatStyle = FlatStyle.Popup; btnSecondDriver.FlatStyle = FlatStyle.Popup;
lblGap.FlatStyle = FlatStyle.Popup;
btnFirstDriver.Size = new Size(pnlBattles.Width / 3, maxUiHeight); btnFirstDriver.Size = new Size(pnlBattles.Width / 3, maxUiHeight);
btnSecondDriver.Size = new Size(pnlBattles.Width / 3, maxUiHeight); btnSecondDriver.Size = new Size(pnlBattles.Width / 3, maxUiHeight);
lblGap.Size = new Size(pnlBattles.Width / 3, maxUiHeight);
btnFirstDriver.Location = new Point(0, id * maxUiHeight); btnFirstDriver.Location = new Point(pnlBattles.Width / 3 * 0, id * maxUiHeight);
lblGap.Location = new Point(btnFirstDriver.Width, id * maxUiHeight); lblGap.Location = new Point(pnlBattles.Width / 3 * 1, id * maxUiHeight);
btnSecondDriver.Location = new Point(pnlBattles.Width / 3 * 2, id * maxUiHeight); btnSecondDriver.Location = new Point(pnlBattles.Width / 3 * 2, id * maxUiHeight);
btnFirstDriver.Text = battle.d1.Name; btnFirstDriver.Text = battle.d1.Name;
+38 -9
View File
@@ -44,6 +44,8 @@
this.gpbxOvertakes = new System.Windows.Forms.GroupBox(); this.gpbxOvertakes = new System.Windows.Forms.GroupBox();
this.lsbOvertakes = new System.Windows.Forms.ListBox(); this.lsbOvertakes = new System.Windows.Forms.ListBox();
this.gpbxDriverInfos = new System.Windows.Forms.GroupBox(); this.gpbxDriverInfos = new System.Windows.Forms.GroupBox();
this.pnlCover = new System.Windows.Forms.Panel();
this.lbl = new System.Windows.Forms.Label();
this.lblCurrentDriverDRS = new System.Windows.Forms.Label(); this.lblCurrentDriverDRS = new System.Windows.Forms.Label();
this.lblCurrentDriverTyreType = new System.Windows.Forms.Label(); this.lblCurrentDriverTyreType = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label();
@@ -71,6 +73,7 @@
this.gpbxRanking.SuspendLayout(); this.gpbxRanking.SuspendLayout();
this.gpbxOvertakes.SuspendLayout(); this.gpbxOvertakes.SuspendLayout();
this.gpbxDriverInfos.SuspendLayout(); this.gpbxDriverInfos.SuspendLayout();
this.pnlCover.SuspendLayout();
this.gpbxLapTimes.SuspendLayout(); this.gpbxLapTimes.SuspendLayout();
this.gpbxBattles.SuspendLayout(); this.gpbxBattles.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -268,6 +271,7 @@
// gpbxDriverInfos // gpbxDriverInfos
// //
this.gpbxDriverInfos.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(79)))), ((int)(((byte)(79)))), ((int)(((byte)(79))))); this.gpbxDriverInfos.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(79)))), ((int)(((byte)(79)))), ((int)(((byte)(79)))));
this.gpbxDriverInfos.Controls.Add(this.pnlCover);
this.gpbxDriverInfos.Controls.Add(this.lblCurrentDriverDRS); this.gpbxDriverInfos.Controls.Add(this.lblCurrentDriverDRS);
this.gpbxDriverInfos.Controls.Add(this.lblCurrentDriverTyreType); this.gpbxDriverInfos.Controls.Add(this.lblCurrentDriverTyreType);
this.gpbxDriverInfos.Controls.Add(this.label11); this.gpbxDriverInfos.Controls.Add(this.label11);
@@ -292,11 +296,31 @@
this.gpbxDriverInfos.Text = "Driver infos"; this.gpbxDriverInfos.Text = "Driver infos";
this.gpbxDriverInfos.Paint += new System.Windows.Forms.PaintEventHandler(this.removeBorders); this.gpbxDriverInfos.Paint += new System.Windows.Forms.PaintEventHandler(this.removeBorders);
// //
// pnlCover
//
this.pnlCover.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(79)))), ((int)(((byte)(79)))), ((int)(((byte)(79)))));
this.pnlCover.Controls.Add(this.lbl);
this.pnlCover.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252)))));
this.pnlCover.Location = new System.Drawing.Point(9, 19);
this.pnlCover.Name = "pnlCover";
this.pnlCover.Size = new System.Drawing.Size(535, 216);
this.pnlCover.TabIndex = 13;
//
// lbl
//
this.lbl.AutoSize = true;
this.lbl.Font = new System.Drawing.Font("Microsoft YaHei UI", 20F);
this.lbl.Location = new System.Drawing.Point(18, 90);
this.lbl.Name = "lbl";
this.lbl.Size = new System.Drawing.Size(497, 45);
this.lbl.TabIndex = 0;
this.lbl.Text = "Select a driver to see its infos";
//
// lblCurrentDriverDRS // lblCurrentDriverDRS
// //
this.lblCurrentDriverDRS.AutoSize = true; this.lblCurrentDriverDRS.AutoSize = true;
this.lblCurrentDriverDRS.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.lblCurrentDriverDRS.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.lblCurrentDriverDRS.Location = new System.Drawing.Point(191, 175); this.lblCurrentDriverDRS.Location = new System.Drawing.Point(191, 192);
this.lblCurrentDriverDRS.Name = "lblCurrentDriverDRS"; this.lblCurrentDriverDRS.Name = "lblCurrentDriverDRS";
this.lblCurrentDriverDRS.Size = new System.Drawing.Size(41, 27); this.lblCurrentDriverDRS.Size = new System.Drawing.Size(41, 27);
this.lblCurrentDriverDRS.TabIndex = 11; this.lblCurrentDriverDRS.TabIndex = 11;
@@ -306,7 +330,7 @@
// //
this.lblCurrentDriverTyreType.AutoSize = true; this.lblCurrentDriverTyreType.AutoSize = true;
this.lblCurrentDriverTyreType.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.lblCurrentDriverTyreType.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.lblCurrentDriverTyreType.Location = new System.Drawing.Point(66, 138); this.lblCurrentDriverTyreType.Location = new System.Drawing.Point(66, 155);
this.lblCurrentDriverTyreType.Name = "lblCurrentDriverTyreType"; this.lblCurrentDriverTyreType.Name = "lblCurrentDriverTyreType";
this.lblCurrentDriverTyreType.Size = new System.Drawing.Size(111, 27); this.lblCurrentDriverTyreType.Size = new System.Drawing.Size(111, 27);
this.lblCurrentDriverTyreType.TabIndex = 8; this.lblCurrentDriverTyreType.TabIndex = 8;
@@ -316,7 +340,7 @@
// //
this.label11.AutoSize = true; this.label11.AutoSize = true;
this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label11.Location = new System.Drawing.Point(7, 175); this.label11.Location = new System.Drawing.Point(7, 192);
this.label11.Name = "label11"; this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(52, 27); this.label11.Size = new System.Drawing.Size(52, 27);
this.label11.TabIndex = 10; this.label11.TabIndex = 10;
@@ -336,7 +360,7 @@
// //
this.lblCurrentDriverGapToLeader.AutoSize = true; this.lblCurrentDriverGapToLeader.AutoSize = true;
this.lblCurrentDriverGapToLeader.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.lblCurrentDriverGapToLeader.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.lblCurrentDriverGapToLeader.Location = new System.Drawing.Point(191, 102); this.lblCurrentDriverGapToLeader.Location = new System.Drawing.Point(191, 119);
this.lblCurrentDriverGapToLeader.Name = "lblCurrentDriverGapToLeader"; this.lblCurrentDriverGapToLeader.Name = "lblCurrentDriverGapToLeader";
this.lblCurrentDriverGapToLeader.Size = new System.Drawing.Size(94, 27); this.lblCurrentDriverGapToLeader.Size = new System.Drawing.Size(94, 27);
this.lblCurrentDriverGapToLeader.TabIndex = 6; this.lblCurrentDriverGapToLeader.TabIndex = 6;
@@ -346,7 +370,7 @@
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label5.Location = new System.Drawing.Point(7, 102); this.label5.Location = new System.Drawing.Point(7, 119);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(153, 27); this.label5.Size = new System.Drawing.Size(153, 27);
this.label5.TabIndex = 5; this.label5.TabIndex = 5;
@@ -356,7 +380,7 @@
// //
this.label8.AutoSize = true; this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.label8.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label8.Location = new System.Drawing.Point(7, 138); this.label8.Location = new System.Drawing.Point(7, 155);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(58, 27); this.label8.Size = new System.Drawing.Size(58, 27);
this.label8.TabIndex = 7; this.label8.TabIndex = 7;
@@ -366,7 +390,7 @@
// //
this.lblCurrentDriverTyreAge.AutoSize = true; this.lblCurrentDriverTyreAge.AutoSize = true;
this.lblCurrentDriverTyreAge.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.lblCurrentDriverTyreAge.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.lblCurrentDriverTyreAge.Location = new System.Drawing.Point(191, 138); this.lblCurrentDriverTyreAge.Location = new System.Drawing.Point(191, 155);
this.lblCurrentDriverTyreAge.Name = "lblCurrentDriverTyreAge"; this.lblCurrentDriverTyreAge.Name = "lblCurrentDriverTyreAge";
this.lblCurrentDriverTyreAge.Size = new System.Drawing.Size(85, 27); this.lblCurrentDriverTyreAge.Size = new System.Drawing.Size(85, 27);
this.lblCurrentDriverTyreAge.TabIndex = 9; this.lblCurrentDriverTyreAge.TabIndex = 9;
@@ -395,7 +419,7 @@
// //
this.lblCurrentDriverLapTime.AutoSize = true; this.lblCurrentDriverLapTime.AutoSize = true;
this.lblCurrentDriverLapTime.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.lblCurrentDriverLapTime.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.lblCurrentDriverLapTime.Location = new System.Drawing.Point(190, 66); this.lblCurrentDriverLapTime.Location = new System.Drawing.Point(190, 83);
this.lblCurrentDriverLapTime.Name = "lblCurrentDriverLapTime"; this.lblCurrentDriverLapTime.Name = "lblCurrentDriverLapTime";
this.lblCurrentDriverLapTime.Size = new System.Drawing.Size(94, 27); this.lblCurrentDriverLapTime.Size = new System.Drawing.Size(94, 27);
this.lblCurrentDriverLapTime.TabIndex = 2; this.lblCurrentDriverLapTime.TabIndex = 2;
@@ -405,7 +429,7 @@
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label4.Location = new System.Drawing.Point(6, 65); this.label4.Location = new System.Drawing.Point(6, 82);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(105, 27); this.label4.Size = new System.Drawing.Size(105, 27);
this.label4.TabIndex = 1; this.label4.TabIndex = 1;
@@ -528,6 +552,7 @@
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MinimumSize = new System.Drawing.Size(1182, 808); this.MinimumSize = new System.Drawing.Size(1182, 808);
this.Name = "Main"; this.Name = "Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Track Trends"; this.Text = "Track Trends";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
@@ -539,6 +564,8 @@
this.gpbxOvertakes.ResumeLayout(false); this.gpbxOvertakes.ResumeLayout(false);
this.gpbxDriverInfos.ResumeLayout(false); this.gpbxDriverInfos.ResumeLayout(false);
this.gpbxDriverInfos.PerformLayout(); this.gpbxDriverInfos.PerformLayout();
this.pnlCover.ResumeLayout(false);
this.pnlCover.PerformLayout();
this.gpbxLapTimes.ResumeLayout(false); this.gpbxLapTimes.ResumeLayout(false);
this.gpbxLapTimes.PerformLayout(); this.gpbxLapTimes.PerformLayout();
this.gpbxBattles.ResumeLayout(false); this.gpbxBattles.ResumeLayout(false);
@@ -586,6 +613,8 @@
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.ToolTip tip1; private System.Windows.Forms.ToolTip tip1;
private System.Windows.Forms.Panel pnlCover;
private System.Windows.Forms.Label lbl;
} }
} }
+6
View File
@@ -230,6 +230,7 @@ namespace Test_Merge
btnSettings.Enabled = true; btnSettings.Enabled = true;
btnStartDecoding.Enabled = false; btnStartDecoding.Enabled = false;
btnStopUpdating.Enabled = false; btnStopUpdating.Enabled = false;
btnSettings.Enabled = false;
int errorCode = -1; int errorCode = -1;
await Task.Run(async () => await Task.Run(async () =>
{ {
@@ -250,6 +251,8 @@ namespace Test_Merge
//IMPLEMENT MORE SPECIFIC ERROR CODES !! //IMPLEMENT MORE SPECIFIC ERROR CODES !!
MessageBox.Show("An error has occured while trying to start the driver."); MessageBox.Show("An error has occured while trying to start the driver.");
btnResetEmulator.Enabled = true; btnResetEmulator.Enabled = true;
btnSettings.Enabled = true;
btnResetEmulator.Text = "Retry";
} }
else else
{ {
@@ -289,6 +292,9 @@ namespace Test_Merge
} }
public void btnDriver_Click(object sender, EventArgs e) public void btnDriver_Click(object sender, EventArgs e)
{ {
//Removes the cover
if (pnlCover.Visible = true)
pnlCover.Visible = false;
//Happens when a driver button has been clicked //Happens when a driver button has been clicked
//MessageBox.Show((sender as Button).Name + " has been selected"); //MessageBox.Show((sender as Button).Name + " has been selected");
Button btn = (sender as Button); Button btn = (sender as Button);