sequenceEditor is mod-aware now.

This commit is contained in:
Chris Forbes
2010-02-07 17:19:34 +13:00
parent b1fca54e7e
commit 911fb6aa9b
3 changed files with 39 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using IjwFramework.Collections;
using System;
namespace OpenRa.FileFormats
{
@@ -64,6 +65,23 @@ namespace OpenRa.FileFormats
}
}
public static void MountTemporaryEx(string name)
{
name = name.ToLowerInvariant();
var optional = name.StartsWith("~");
if (optional) name = name.Substring(1);
var a = name.EndsWith(".mix")
? (Action)(() => FileSystem.MountTemporary(new Package(name)))
: () => FileSystem.MountTemporary(new Folder(name));
if (optional)
try { a(); }
catch { }
else
a();
}
public static void UnmountTemporaryPackages()
{
mountedFolders.RemoveAll(f => temporaryMounts.Contains(f));