From f826e3fd58e405a129cc12a8c220b39aef937951 Mon Sep 17 00:00:00 2001 From: Eris Loona Date: Sun, 3 Sep 2023 16:49:38 +0300 Subject: [PATCH] Fixed some weird interactions, added prompt --- MainMenu.Designer.cs | 16 ++++++++++++++++ MainMenu.cs | 26 +++++++++++++++++++++++--- MainMenu.resx | 2 +- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/MainMenu.Designer.cs b/MainMenu.Designer.cs index 3156f20..992ecde 100644 --- a/MainMenu.Designer.cs +++ b/MainMenu.Designer.cs @@ -118,6 +118,7 @@ private void InitializeComponent() this.timerLabel = new System.Windows.Forms.Label(); this.timer = new System.Windows.Forms.Timer(this.components); this.modeCheck = new System.Windows.Forms.CheckBox(); + this.infoLabel = new System.Windows.Forms.Label(); this.normalModePanel.SuspendLayout(); this.farmingModePanel.SuspendLayout(); this.SuspendLayout(); @@ -1579,6 +1580,7 @@ private void InitializeComponent() // farmingModePanel // this.farmingModePanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(36)))), ((int)(((byte)(39))))); + this.farmingModePanel.Controls.Add(this.infoLabel); this.farmingModePanel.Controls.Add(this.playPauseButton); this.farmingModePanel.Controls.Add(this.endSessionButton); this.farmingModePanel.Controls.Add(this.clearSessionButton); @@ -1708,6 +1710,19 @@ private void InitializeComponent() this.modeCheck.UseVisualStyleBackColor = false; this.modeCheck.Click += new System.EventHandler(this.modeCheck_Click); // + // infoLabel + // + this.infoLabel.AutoSize = true; + this.infoLabel.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.infoLabel.ForeColor = System.Drawing.Color.White; + this.infoLabel.Location = new System.Drawing.Point(299, 228); + this.infoLabel.Name = "infoLabel"; + this.infoLabel.Size = new System.Drawing.Size(176, 45); + this.infoLabel.TabIndex = 69; + this.infoLabel.Text = "Select your grinding location\r\nand click the Analyze button\r\nto start a new grind" + + "ing session"; + this.infoLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // MainMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1891,6 +1906,7 @@ private void InitializeComponent() private System.Windows.Forms.Button endSessionButton; private System.Windows.Forms.Button clearSessionButton; private System.Windows.Forms.Button playPauseButton; + private System.Windows.Forms.Label infoLabel; } } diff --git a/MainMenu.cs b/MainMenu.cs index 56f91b1..06ee7bc 100644 --- a/MainMenu.cs +++ b/MainMenu.cs @@ -44,8 +44,8 @@ public partial class MainMenu : Form //Sorting Mode extras public static string[] script = new string[200], itemRemember = new string[128]; - public static int itemListControls = 0, hh = 0, mm = 0, ss = 0, rememberIndex = 0, scriptIndex = 0, websiteLoadDelay = 5000; - public static bool sessionActive = false, sessionPaused = false; + public static int itemListControls = 0, hh = 0, mm = 0, ss = 0, rememberIndex = 0, scriptIndex = 0, websiteLoadDelay = 5000, rememborLocationIndex; + public static bool sessionActive = false, sessionPaused = false, clearTrigger = false, rememborDecision; Image timerButtonPlayIcon, timerButtonPauseIcon; NumericUpDown[] stackCounter = new NumericUpDown[50]; Label[] stackLabel = new Label[50]; @@ -826,6 +826,20 @@ private void analyzeButton_Click(object sender, EventArgs e) } if (sessionActive == true && sessionPaused == false) pauseSession(); + if (clearTrigger == true) + { + rememborLocationIndex = locationBox.SelectedIndex; + clearSessionButton_Click(sender, e); + if (rememborDecision == true) + { + locationBox.SelectedIndex = rememborLocationIndex; + } + else + { + return; + } + + } analyzeButton.Enabled = false; loadingBar.Visible = true; loadingBar.Enabled = true; @@ -861,6 +875,7 @@ public void startSession() if (sessionActive == false) { timerReset(); + infoLabel.Visible = false; modeCheck.Enabled = false; locationBox.Enabled = false; sessionActive = true; @@ -909,12 +924,15 @@ private void clearSessionButton_Click(object sender, EventArgs e) sessionPaused = false; swapPauseButtonIcon(false); rememberIndex = 0; + clearTrigger = false; + rememborDecision = true; GC.Collect(); } else { if (temp == false && sessionActive == true) pauseSession(); + rememborDecision = false; } } @@ -1001,6 +1019,8 @@ private void endSessionButton_Click(object sender, EventArgs e) MessageBox.Show("Please set your ID first in the settings!", "ID not set", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } + clearTrigger = true; + infoLabel.Visible = true; playPauseButton.Enabled = false; playPauseButton.Visible = false; modeCheck.Enabled = true; @@ -1055,7 +1075,7 @@ private void endSessionButton_Click(object sender, EventArgs e) .TextEntry(script[0]) .KeyPress(VirtualKeyCode.TAB) .KeyPress(VirtualKeyCode.RETURN); - Thread.Sleep(750); + Thread.Sleep(1200); new InputSimulator().Keyboard.KeyPress(VirtualKeyCode.TAB) .TextEntry(Convert.ToString(hours)) .KeyPress(VirtualKeyCode.TAB) diff --git a/MainMenu.resx b/MainMenu.resx index 36dea6c..9b2cc65 100644 --- a/MainMenu.resx +++ b/MainMenu.resx @@ -655,7 +655,7 @@ iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vgAADr4B6kKxwAAAD1RJREFUeF7t1rFxXEEMRMGLQCZNhaAQGApDYerUpz8eBs6hu+olsAZ2XgAAAAAA + vQAADr0BR/uQrQAAD1RJREFUeF7t1rFxXEEMRMGLQCZNhaAQGApDYerUpz8eBs6hu+olsAZ2XgAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA