Skip to content
Browse files

Made it so ShowOverlay actually does something...

  • Loading branch information...
1 parent e18e364 commit 64acc6a883fdc19cb9f523e1026ef0be899f1b81 @ascendedguard committed Jul 2, 2012
Showing with 19 additions and 10 deletions.
  1. +19 −10 TwitchCommercialSC2/MainWindow.xaml.cs
View
29 TwitchCommercialSC2/MainWindow.xaml.cs
@@ -398,14 +398,16 @@ private void PlayCommercials(string replay)
var commercialTime = commercials * 30;
- this.Dispatcher.BeginInvoke(
- (Action)delegate
- {
- var overlay = new CommercialTimerOverlay(delay, commercialTime);
- overlay.Owner = this;
- overlay.Show();
- });
-
+ if (this.settings.ShowOverlay)
+ {
+ this.Dispatcher.BeginInvoke(
+ (Action)delegate
+ {
+ var overlay = new CommercialTimerOverlay(delay, commercialTime);
+ overlay.Owner = this;
+ overlay.Show();
+ });
+ }
// Sleep the thread for the delay period, then starts playing commercials.
Thread.Sleep(delay * 1000);
@@ -457,7 +459,11 @@ private void PlayCommercialClicked(object sender, RoutedEventArgs e)
private void PlayACommercial()
{
this.twitchApi.PlayCommercial();
- this.ShowOverlay(0, 30);
+
+ if (this.settings.ShowOverlay)
+ {
+ this.ShowOverlay(0, 30);
+ }
}
private void ShowOverlay(int delay, int commercialSeconds)
@@ -500,7 +506,10 @@ private void PlayADelayedCommercial()
TaskCreationOptions.None,
TaskScheduler.Default);
- this.ShowOverlay(delay, 30);
+ if (this.settings.ShowOverlay)
+ {
+ this.ShowOverlay(delay, 30);
+ }
}
private void OpenWikiClicked(object sender, RoutedEventArgs e)

0 comments on commit 64acc6a

Please sign in to comment.
Something went wrong with that request. Please try again.