diff --git a/AchievementsTracker/AchievementsTracker/GameManager.cs b/AchievementsTracker/AchievementsTracker/GameManager.cs index 9225b4e..ab1263b 100644 --- a/AchievementsTracker/AchievementsTracker/GameManager.cs +++ b/AchievementsTracker/AchievementsTracker/GameManager.cs @@ -195,10 +195,17 @@ public void update() int newCharSelect = memoryReader.ReadCharSelect(); if (state == ScreenState.ChooseCharacter && charSelect == 0 && newCharSelect != 0) { - // Start timer - Log.WriteLine("Character selected!"); - tracker.RunStarted(time, false); - tracker.SendRunStart(time); + if (characters == 0) + { + // Start timer + Log.WriteLine("Character selected!"); + tracker.RunStarted(time, false); + tracker.SendRunStart(time); + } + else + { + tracker.SetErrorMessage("Characters Unexpectedly Unlocked!"); + } } charSelect = newCharSelect; diff --git a/AchievementsTracker/AchievementsTracker/MainForm.Designer.cs b/AchievementsTracker/AchievementsTracker/MainForm.Designer.cs index cbf20fb..3903642 100644 --- a/AchievementsTracker/AchievementsTracker/MainForm.Designer.cs +++ b/AchievementsTracker/AchievementsTracker/MainForm.Designer.cs @@ -53,6 +53,7 @@ private void InitializeComponent() this.ExtrapolatedTimeStatus = new System.Windows.Forms.Label(); this.ASOStatus = new System.Windows.Forms.Label(); this.ASO = new System.Windows.Forms.Label(); + this.errorMsg = new System.Windows.Forms.Label(); this.Tutorial = new System.Windows.Forms.Label(); this.TutorialStatus = new System.Windows.Forms.Label(); this.aso1Bomb = new System.Windows.Forms.Label(); @@ -314,6 +315,18 @@ private void InitializeComponent() this.ASO.Size = new System.Drawing.Size(46, 15); this.ASO.TabIndex = 25; this.ASO.Text = "AS+O:"; + // + // Error Message + // + this.errorMsg.AutoSize = true; + this.errorMsg.Location = new System.Drawing.Point(12, 32); + this.errorMsg.ForeColor = System.Drawing.Color.Red; + this.errorMsg.Name = "ErrorMessage"; + this.errorMsg.Size = new System.Drawing.Size(38, 13); + this.errorMsg.TabIndex = 51; + this.errorMsg.Text = ""; + + // // Tutorial // @@ -609,6 +622,7 @@ private void InitializeComponent() this.Controls.Add(this.Tutorial); this.Controls.Add(this.ASO); this.Controls.Add(this.ASOStatus); + this.Controls.Add(this.errorMsg); this.Controls.Add(this.ExtrapolatedTimeStatus); this.Controls.Add(this.ExtrapolatedTime); this.Controls.Add(this.AddictedStatus); @@ -670,6 +684,7 @@ private void InitializeComponent() public System.Windows.Forms.Label ExtrapolatedTimeStatus; public System.Windows.Forms.Label ASOStatus; public System.Windows.Forms.Label ASO; + public System.Windows.Forms.Label errorMsg; public System.Windows.Forms.Label Tutorial; public System.Windows.Forms.Label TutorialStatus; public System.Windows.Forms.Label Addicted; diff --git a/AchievementsTracker/AchievementsTracker/MainForm.cs b/AchievementsTracker/AchievementsTracker/MainForm.cs index abc4a97..97fc239 100644 --- a/AchievementsTracker/AchievementsTracker/MainForm.cs +++ b/AchievementsTracker/AchievementsTracker/MainForm.cs @@ -80,7 +80,7 @@ public void SetResetHotKey(int modifiers, Keys key) UnregisterHotKey(Handle, RESET_HOTKEY_ID); RegisterHotKey(Handle, RESET_HOTKEY_ID, modifiers, (int)key); } - + // Hotkey protected override void WndProc(ref Message m) { @@ -96,11 +96,12 @@ public void Reset() { room.Text = ""; roomStatus.Text = ""; + errorMsg.Text = ""; SetHideLoadless(false); startTime = 0; - + // Init timer if (runTimer != null) { @@ -251,12 +252,18 @@ public void Reset() currentlyPlaying = false; } + public void SetErrorMessage(string msg) + { + errorMsg.Text = msg; + } + public void setRoomCode(string code) { if (code != null) { room.Text = "Room: " + code; - } else + } + else { room.Text = ""; } @@ -940,7 +947,8 @@ public void SetHideLoadless(bool hide) { loadlessTimer.Hide(); loadlessLabel.Hide(); - } else + } + else { loadlessTimer.Show(); loadlessLabel.Show(); diff --git a/AchievementsTracker/AchievementsTracker/Tracker.cs b/AchievementsTracker/AchievementsTracker/Tracker.cs index c3d3a6a..e4a83d8 100644 --- a/AchievementsTracker/AchievementsTracker/Tracker.cs +++ b/AchievementsTracker/AchievementsTracker/Tracker.cs @@ -426,7 +426,7 @@ public async void MultiplayerMain() byte[] charBytes = charArray.Select(jv => (byte)jv).ToArray(); byte[] chars = new byte[16 * 4]; int charNum = 0; - for (int i = 0; i < 16; i ++) + for (int i = 0; i < 16; i++) { chars[4 * i] = charBytes[i]; if (charBytes[i] > 0) charNum++; @@ -496,6 +496,11 @@ public async void MultiplayerMain() } } + public void SetErrorMessage(string msg) + { + ui.SetErrorMessage(msg); + } + public void Main() { running = false;