Don't use Platform.ResolvePath when constructing hardcoded paths.

This commit is contained in:
Paul Chote
2020-11-20 17:39:06 +00:00
committed by abcdefg30
parent 1dd5b113c7
commit de7a84e8ed
10 changed files with 20 additions and 26 deletions

View File

@@ -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;