fix stupid default support dir. if there's something we can't identify reliably, it's going to be a *nix
This commit is contained in:
@@ -15,29 +15,18 @@ using OpenRA.FileFormats;
|
|||||||
|
|
||||||
namespace OpenRA
|
namespace OpenRA
|
||||||
{
|
{
|
||||||
public enum PlatformType
|
public enum PlatformType { Unknown, Windows, OSX, Linux }
|
||||||
{
|
|
||||||
Unknown,
|
|
||||||
Windows,
|
|
||||||
OSX,
|
|
||||||
Linux
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Platform
|
public static class Platform
|
||||||
{
|
{
|
||||||
public static PlatformType CurrentPlatform
|
public static PlatformType CurrentPlatform { get { return currentPlatform.Value; } }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return currentPlatform.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Lazy<PlatformType> currentPlatform = new Lazy<PlatformType>(GetCurrentPlatform);
|
static Lazy<PlatformType> currentPlatform = new Lazy<PlatformType>(GetCurrentPlatform);
|
||||||
|
|
||||||
static PlatformType GetCurrentPlatform()
|
static PlatformType GetCurrentPlatform()
|
||||||
{
|
{
|
||||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT) return PlatformType.Windows;
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||||
|
return PlatformType.Windows;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -60,17 +49,19 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
string dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
var dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||||
|
|
||||||
switch (CurrentPlatform)
|
switch (CurrentPlatform)
|
||||||
{
|
{
|
||||||
|
case PlatformType.Windows:
|
||||||
|
dir += Path.DirectorySeparatorChar + "OpenRA";
|
||||||
|
break;
|
||||||
case PlatformType.OSX:
|
case PlatformType.OSX:
|
||||||
dir += "/Library/Application Support/OpenRA";
|
dir += "/Library/Application Support/OpenRA";
|
||||||
break;
|
break;
|
||||||
case PlatformType.Linux:
|
case PlatformType.Linux:
|
||||||
dir += "/.openra";
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
dir += Path.DirectorySeparatorChar + "OpenRA";
|
dir += "/.openra";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user