(bcb06cc5c) Unstable v0.9.9.0
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Networking;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Barotrauma.Networking;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -118,6 +119,10 @@ namespace Barotrauma
|
||||
|
||||
for (int i = 0; i < subDirs.Length; i++)
|
||||
{
|
||||
if (i == subDirs.Length - 1 && string.IsNullOrEmpty(subDirs[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
string enumPath = string.IsNullOrEmpty(filename) ? "./" : filename;
|
||||
List<string> filePaths = Directory.GetFileSystemEntries(enumPath).Select(s => Path.GetFileName(s)).ToList();
|
||||
if (filePaths.Any(s => s.Equals(subDirs[i], StringComparison.Ordinal)))
|
||||
@@ -147,7 +152,7 @@ namespace Barotrauma
|
||||
|
||||
public static string RemoveInvalidFileNameChars(string fileName)
|
||||
{
|
||||
var invalidChars = Path.GetInvalidFileNameChars();
|
||||
var invalidChars = Path.GetInvalidFileNameChars().Concat(new char[] {':', ';'});
|
||||
foreach (char invalidChar in invalidChars)
|
||||
{
|
||||
fileName = fileName.Replace(invalidChar.ToString(), "");
|
||||
@@ -571,5 +576,26 @@ namespace Barotrauma
|
||||
#endif
|
||||
return path;
|
||||
}
|
||||
|
||||
public static float GetEasing(TransitionMode easing, float t)
|
||||
{
|
||||
return easing switch
|
||||
{
|
||||
TransitionMode.Smooth => MathUtils.SmoothStep(t),
|
||||
TransitionMode.Smoother => MathUtils.SmootherStep(t),
|
||||
TransitionMode.EaseIn => MathUtils.EaseIn(t),
|
||||
TransitionMode.EaseOut => MathUtils.EaseOut(t),
|
||||
TransitionMode.Exponential => t * t,
|
||||
TransitionMode.Linear => t,
|
||||
_ => t,
|
||||
};
|
||||
}
|
||||
|
||||
public static Rectangle GetWorldBounds(Point center, Point size)
|
||||
{
|
||||
Point halfSize = size.Divide(2);
|
||||
Point topLeft = new Point(center.X - halfSize.X, center.Y + halfSize.Y);
|
||||
return new Rectangle(topLeft, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user