Don't use Platform.ResolvePath when constructing hardcoded paths.
This commit is contained in:
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
.ToArray();
|
||||
|
||||
// Load the renderer assembly so we can check its dependencies
|
||||
Assembly.LoadFile(Platform.ResolvePath(Path.Combine(".", "OpenRA.Platforms.Default.dll")));
|
||||
Assembly.LoadFile(Path.Combine(Platform.GameDir, "OpenRA.Platforms.Default.dll"));
|
||||
|
||||
var missing = new List<string>();
|
||||
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var newTemplate = panel.Get<ScrollItemWidget>("NEW_TEMPLATE");
|
||||
|
||||
var mod = modData.Manifest;
|
||||
baseSavePath = Platform.ResolvePath(Platform.SupportDirPrefix, "Saves", mod.Id, mod.Metadata.Version);
|
||||
baseSavePath = Path.Combine(Platform.SupportDir, "Saves", mod.Id, mod.Metadata.Version);
|
||||
|
||||
// Avoid filename conflicts when creating new saves
|
||||
if (isSavePanel)
|
||||
@@ -304,8 +304,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
void Save(World world)
|
||||
{
|
||||
var filename = saveTextField.Text + ".orasav";
|
||||
var testPath = Platform.ResolvePath(
|
||||
Platform.SupportDirPrefix,
|
||||
var testPath = Path.Combine(
|
||||
Platform.SupportDir,
|
||||
"Saves",
|
||||
modData.Manifest.Id,
|
||||
modData.Manifest.Metadata.Version,
|
||||
@@ -351,7 +351,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
public static bool IsLoadPanelEnabled(Manifest mod)
|
||||
{
|
||||
var baseSavePath = Platform.ResolvePath(Platform.SupportDirPrefix, "Saves", mod.Id, mod.Metadata.Version);
|
||||
var baseSavePath = Path.Combine(Platform.SupportDir, "Saves", mod.Id, mod.Metadata.Version);
|
||||
if (!Directory.Exists(baseSavePath))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
if (newsBG != null && Game.Settings.Game.FetchNews)
|
||||
{
|
||||
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, webServices.GameNewsFileName);
|
||||
var cacheFile = Path.Combine(Platform.SupportDir, webServices.GameNewsFileName);
|
||||
var currentNews = ParseNews(cacheFile);
|
||||
if (currentNews != null)
|
||||
DisplayNews(currentNews);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var template = panel.Get<ScrollItemWidget>("REPLAY_TEMPLATE");
|
||||
|
||||
var mod = modData.Manifest;
|
||||
var dir = Platform.ResolvePath(Platform.SupportDirPrefix, "Replays", mod.Id, mod.Metadata.Version);
|
||||
var dir = Path.Combine(Platform.SupportDir, "Replays", mod.Id, mod.Metadata.Version);
|
||||
|
||||
if (Directory.Exists(dir))
|
||||
ThreadPool.QueueUserWorkItem(_ => LoadReplays(dir, template));
|
||||
|
||||
Reference in New Issue
Block a user