Pausing all sounds when switching to editor screen, temp save folder is cleared before saving (fixes unnecessary files being included in saves)
This commit is contained in:
@@ -314,6 +314,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
SoundPlayer.OverrideMusicType = "none";
|
SoundPlayer.OverrideMusicType = "none";
|
||||||
|
for (int i = 0; i < Sounds.SoundManager.DefaultSourceCount; i++)
|
||||||
|
{
|
||||||
|
Sounds.SoundManager.Pause(i);
|
||||||
|
}
|
||||||
|
|
||||||
cam.UpdateTransform();
|
cam.UpdateTransform();
|
||||||
}
|
}
|
||||||
@@ -333,6 +337,10 @@ namespace Barotrauma
|
|||||||
if (wiringMode) ToggleWiringMode();
|
if (wiringMode) ToggleWiringMode();
|
||||||
|
|
||||||
SoundPlayer.OverrideMusicType = null;
|
SoundPlayer.OverrideMusicType = null;
|
||||||
|
for (int i = 0; i < Sounds.SoundManager.DefaultSourceCount; i++)
|
||||||
|
{
|
||||||
|
Sounds.SoundManager.Resume(i);
|
||||||
|
}
|
||||||
|
|
||||||
if (dummyCharacter != null)
|
if (dummyCharacter != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,17 @@ namespace Barotrauma
|
|||||||
|
|
||||||
string tempPath = Path.Combine(SaveFolder, "temp");
|
string tempPath = Path.Combine(SaveFolder, "temp");
|
||||||
|
|
||||||
|
DirectoryInfo dir = new DirectoryInfo(tempPath);
|
||||||
|
|
||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ClearFolder(tempPath);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -274,5 +284,22 @@ namespace Barotrauma
|
|||||||
using (GZipStream zipStream = new GZipStream(inFile, CompressionMode.Decompress, true))
|
using (GZipStream zipStream = new GZipStream(inFile, CompressionMode.Decompress, true))
|
||||||
while (DecompressFile(sDir, zipStream, progress)) ;
|
while (DecompressFile(sDir, zipStream, progress)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ClearFolder(string FolderName)
|
||||||
|
{
|
||||||
|
DirectoryInfo dir = new DirectoryInfo(FolderName);
|
||||||
|
|
||||||
|
foreach (FileInfo fi in dir.GetFiles())
|
||||||
|
{
|
||||||
|
fi.IsReadOnly = false;
|
||||||
|
fi.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (DirectoryInfo di in dir.GetDirectories())
|
||||||
|
{
|
||||||
|
ClearFolder(di.FullName);
|
||||||
|
di.Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user