From 2d8831c29ca4d05d66ad4b90db66250094e734c9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 6 May 2017 12:36:45 -0400 Subject: [PATCH] fix highscore glitch --- ShiftOS.WinForms/Applications/Pong.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs index ae70aff..433e05f 100644 --- a/ShiftOS.WinForms/Applications/Pong.cs +++ b/ShiftOS.WinForms/Applications/Pong.cs @@ -981,6 +981,10 @@ namespace ShiftOS.WinForms.Applications var hs = unite.GetPongHighscores(); foreach (var score in hs.Highscores) { + if(this.ParentForm.Visible == false) + { + Thread.CurrentThread.Abort(); + } string username = unite.GetDisplayNameId(score.UserId); this.Invoke(new Action(() => { @@ -994,8 +998,15 @@ namespace ShiftOS.WinForms.Applications } catch { - Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time."); - this.Invoke(new Action(pnlgamestats.BringToFront)); + try + { + if (this.ParentForm.Visible == true) + { + Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time."); + this.Invoke(new Action(pnlgamestats.BringToFront)); + } + } + catch { } //JUST. ABORT. THE. FUCKING. THREAD. return; } });