Load assets using absolute paths. Fixes #6717.

This commit is contained in:
Paul Chote
2014-10-09 08:36:24 +13:00
parent 0d0b8c1e22
commit 4f44cc1969
35 changed files with 491 additions and 458 deletions

View File

@@ -52,9 +52,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var cancelButton = panel.Get<ButtonWidget>("CANCEL_BUTTON");
var mirrorsFile = new string[] { Platform.SupportDir, "Content", Game.modData.Manifest.Mod.Id, "mirrors.txt" }.Aggregate(Path.Combine);
var mirrorsFile = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id, "mirrors.txt");
var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
var dest = new string[] { Platform.SupportDir, "Content", Game.modData.Manifest.Mod.Id }.Aggregate(Path.Combine);
var dest = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id);
Action<DownloadProgressChangedEventArgs> onDownloadProgress = i =>
{

View File

@@ -69,7 +69,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
insertDiskContainer.IsVisible = () => false;
installingContainer.IsVisible = () => true;
var dest = new string[] { Platform.SupportDir, "Content", Game.modData.Manifest.Mod.Id }.Aggregate(Path.Combine);
var dest = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id);
var copyFiles = Game.modData.Manifest.ContentInstaller.CopyFilesFromCD;
var packageToExtract = Game.modData.Manifest.ContentInstaller.PackageToExtractFromCD.Split(':');

View File

@@ -149,7 +149,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
newsStatus = newsPanel.Get<LabelWidget>("NEWS_STATUS");
SetNewsStatus("Loading news");
var cacheFile = Path.Combine(Platform.SupportDir, "news.yaml");
var cacheFile = Platform.ResolvePath("^", "news.yaml");
var currentNews = ParseNews(cacheFile);
if (currentNews != null)
DisplayNews(currentNews);

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var yaml = new MiniYaml(null, Game.modData.Manifest.Missions.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergeLiberal)).ToDictionary();
var missionMapPaths = yaml["Missions"].Nodes.Select(n => Path.GetFullPath(n.Key));
var missionMapPaths = yaml["Missions"].Nodes.Select(n => Platform.ResolvePath(n.Key));
var maps = Game.modData.MapCache
.Where(p => p.Status == MapStatus.Available && missionMapPaths.Contains(Path.GetFullPath(p.Map.Path)))

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var template = panel.Get<ScrollItemWidget>("REPLAY_TEMPLATE");
var mod = Game.modData.Manifest.Mod;
var dir = new[] { Platform.SupportDir, "Replays", mod.Id, mod.Version }.Aggregate(Path.Combine);
var dir = Platform.ResolvePath("^", "Replays", mod.Id, mod.Version);
replayList.RemoveChildren();
if (Directory.Exists(dir))