Skip to content

Commit

Permalink
Generic commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
CarbonNeuron committed Jan 25, 2021
1 parent f9d2b77 commit 614b50d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions AUCapture-WPF/AUCapture-WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<None Remove="Resources\Pets\7.png" />
<None Remove="Resources\Pets\8.png" />
<None Remove="Resources\Pets\9.png" />
<None Remove="SplashScreens\SplashScreenDouche.png" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -254,6 +255,7 @@
<Resource Include="Resources\TestHats\48-1.png" />
<Resource Include="Resources\TestHats\49-1.png" />
<Resource Include="SplashScreens\SplashScreenChristmas.png" />
<Resource Include="SplashScreens\SplashScreenDouche.png" />
<Resource Include="SplashScreens\SplashScreenNormal.png" />
<Resource Include="SplashScreens\SplashScreenPop.png" />
</ItemGroup>
Expand Down
46 changes: 28 additions & 18 deletions AUCapture-WPF/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ public void OnTokenHandler(object sender, StartToken token)
socket.Connect(token.Host, token.ConnectCode);
}

public void PlaySound(string URL)
{
try
{
var req = System.Net.WebRequest.Create(URL);
using (Stream stream = req.GetResponse().GetResponseStream())
{
SoundPlayer myNewSound = new SoundPlayer(stream);
myNewSound.Load();
myNewSound.Play();
}
}
catch (Exception errrr)
{
Console.WriteLine("Minor error");
}
}

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Expand Down Expand Up @@ -63,8 +81,9 @@ protected override void OnStartup(StartupEventArgs e)
throw new ArgumentOutOfRangeException();
}
var r = new Random();
var goingToPop = r.Next(101) < 5;
if (!goingToPop)
var goingToPop = r.Next(101) <= 3;
var goingToDouche = r.Next(101) == 1;
if (!goingToPop && !goingToDouche)
{
if (DateTime.Now.Month == 12)
{
Expand All @@ -76,24 +95,15 @@ protected override void OnStartup(StartupEventArgs e)
}
//Console.WriteLine(string.Join(", ",Assembly.GetExecutingAssembly().GetManifestResourceNames())); //Gets all the embedded resources
}
else
else if(goingToPop)
{
new SplashScreen(Assembly.GetExecutingAssembly(), "SplashScreens\\SplashScreenPop.png").Show(true);
try
{
var req = System.Net.WebRequest.Create(
"https://github.com/denverquane/amonguscapture/raw/master/AUCapture-WPF/SplashScreens/popcat.wav");
using (Stream stream = req.GetResponse().GetResponseStream())
{
SoundPlayer myNewSound = new SoundPlayer(stream);
myNewSound.Load();
myNewSound.Play();
}
}
catch (Exception errrr)
{
Console.WriteLine("Minor error");
}
PlaySound("https://github.com/denverquane/amonguscapture/raw/master/AUCapture-WPF/SplashScreens/popcat.wav");
}
else
{
new SplashScreen(Assembly.GetExecutingAssembly(), "SplashScreens\\SplashScreenDouche.png").Show(true);
PlaySound("https://github.com/automuteus/amonguscapture/raw/master/AUCapture-WPF/SplashScreens/douchebag.wav");
}

var mainWindow = new MainWindow();
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 614b50d

Please sign in to comment.