Allow the ra/cnc package dir to be overridden at launch-time.
This commit is contained in:
@@ -19,6 +19,7 @@ namespace OpenRA.FileFormats
|
|||||||
public static class FileSystem
|
public static class FileSystem
|
||||||
{
|
{
|
||||||
static List<IFolder> mountedFolders = new List<IFolder>();
|
static List<IFolder> mountedFolders = new List<IFolder>();
|
||||||
|
public static string SpecialPackageRoot = "";
|
||||||
|
|
||||||
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
||||||
|
|
||||||
@@ -73,7 +74,11 @@ namespace OpenRA.FileFormats
|
|||||||
{
|
{
|
||||||
var optional = name.StartsWith("~");
|
var optional = name.StartsWith("~");
|
||||||
if (optional) name = name.Substring(1);
|
if (optional) name = name.Substring(1);
|
||||||
|
|
||||||
|
// paths starting with $ are relative to SpecialPackageRoot
|
||||||
|
if (name.StartsWith("$"))
|
||||||
|
name = SpecialPackageRoot+name.Substring(1);
|
||||||
|
|
||||||
var a = (Action)(() => FileSystem.MountInner(OpenPackage(name)));
|
var a = (Action)(() => FileSystem.MountInner(OpenPackage(name)));
|
||||||
|
|
||||||
if (optional)
|
if (optional)
|
||||||
|
|||||||
@@ -219,6 +219,8 @@ namespace OpenRA
|
|||||||
+ Path.DirectorySeparatorChar + "OpenRA";
|
+ Path.DirectorySeparatorChar + "OpenRA";
|
||||||
|
|
||||||
SupportDir = args.GetValue("SupportDir", defaultSupport);
|
SupportDir = args.GetValue("SupportDir", defaultSupport);
|
||||||
|
FileSystem.SpecialPackageRoot = args.GetValue("SpecialPackageRoot", "");
|
||||||
|
|
||||||
Settings = new Settings(SupportDir + "settings.yaml", args);
|
Settings = new Settings(SupportDir + "settings.yaml", args);
|
||||||
|
|
||||||
Settings.Save();
|
Settings.Save();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Folders:
|
|||||||
mods/cnc
|
mods/cnc
|
||||||
mods/cnc/bits
|
mods/cnc/bits
|
||||||
mods/cnc/uibits
|
mods/cnc/uibits
|
||||||
mods/cnc/packages
|
$mods/cnc/packages
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
overrides.mix
|
overrides.mix
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Folders:
|
|||||||
mods/ra
|
mods/ra
|
||||||
mods/ra/bits
|
mods/ra/bits
|
||||||
mods/ra/uibits
|
mods/ra/uibits
|
||||||
mods/ra/packages
|
$mods/ra/packages
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
~main.mix
|
~main.mix
|
||||||
|
|||||||
Reference in New Issue
Block a user