SupportDir supports absolute or relative paths; default to ~/OpenRA
This commit is contained in:
@@ -647,12 +647,12 @@ namespace OpenRA
|
|||||||
public static string SupportDir
|
public static string SupportDir
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
// Unless the user has specified otherwise, put support files in a subdirectory of the game install
|
var dir = Settings.SupportDir;
|
||||||
if (Settings.SupportDir == null)
|
|
||||||
return Environment.CurrentDirectory + Path.DirectorySeparatorChar + "Support" + Path.DirectorySeparatorChar;
|
|
||||||
|
|
||||||
// Custom paths are relative to the home directory (My Documents under windows)
|
// Expand paths relative to the personal directory
|
||||||
return Environment.GetFolderPath(Environment.SpecialFolder.Personal) + Path.DirectorySeparatorChar + Settings.SupportDir + Path.DirectorySeparatorChar;
|
if (dir.ElementAt(0) == '~')
|
||||||
|
dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + dir.Substring(1);
|
||||||
|
return dir + Path.DirectorySeparatorChar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,14 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using OpenRA.FileFormats.Graphics;
|
using OpenRA.FileFormats.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
namespace OpenRA.GameRules
|
namespace OpenRA.GameRules
|
||||||
{
|
{
|
||||||
public class UserSettings
|
public class UserSettings
|
||||||
{
|
{
|
||||||
public readonly string SupportDir = null;
|
public readonly string SupportDir = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
|
||||||
|
+ Path.DirectorySeparatorChar + "OpenRA" + Path.DirectorySeparatorChar;
|
||||||
// Debug settings
|
// Debug settings
|
||||||
public bool UnitDebug = false;
|
public bool UnitDebug = false;
|
||||||
public bool PathDebug = true;
|
public bool PathDebug = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user