(e31a38ae1) Fixed spritebatch not being disposed when saving submarine preview images, don't reload all subs when saving a sub
This commit is contained in:
@@ -1102,6 +1102,21 @@ namespace Barotrauma
|
||||
savedSubmarines.Add(sub);
|
||||
}
|
||||
|
||||
|
||||
public static void RefreshSavedSub(string filePath)
|
||||
{
|
||||
string fullPath = Path.GetFullPath(filePath);
|
||||
for (int i = savedSubmarines.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (Path.GetFullPath(savedSubmarines[i].filePath) == fullPath)
|
||||
{
|
||||
savedSubmarines[i].Dispose();
|
||||
savedSubmarines.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
savedSubmarines.Add(new Submarine(filePath));
|
||||
}
|
||||
|
||||
public static void RefreshSavedSubs()
|
||||
{
|
||||
for (int i = savedSubmarines.Count - 1; i>= 0; i--)
|
||||
|
||||
Reference in New Issue
Block a user