Browse Source

Add a sound effect for when screenshots are taken

Bepis 7 years ago
parent
commit
fa03489f6d
2 changed files with 7 additions and 0 deletions
  1. 4 0
      Plugins/Screencap/Screencap.csproj
  2. 3 0
      Plugins/Screencap/ScreenshotManager.cs

+ 4 - 0
Plugins/Screencap/Screencap.csproj

@@ -30,6 +30,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Assembly-CSharp">
+      <HintPath>..\..\lib\Assembly-CSharp.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />

+ 3 - 0
Plugins/Screencap/ScreenshotManager.cs

@@ -1,5 +1,6 @@
 using BepInEx;
 using BepInEx.Common;
+using Illusion.Game;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -42,6 +43,7 @@ namespace Screencap
         void TakeScreenshot(string filename)
         {
             UnityEngine.Application.CaptureScreenshot(filename);
+            Illusion.Game.Utils.Sound.Play(SystemSE.photo);
             Console.WriteLine($"Screenshot saved to {filename}");
         }
 
@@ -51,6 +53,7 @@ namespace Screencap
             var tex = RenderCamera(Camera.main);
             File.WriteAllBytes(filename, tex.EncodeToPNG());
             Destroy(tex);
+            Illusion.Game.Utils.Sound.Play(SystemSE.photo);
             Console.WriteLine($"Character screenshot saved to {filename}");
         }