Fixed path irregularities and added option to specify an explicit id

This commit is contained in:
wincent
2022-01-31 17:30:59 +01:00
parent a65272e3c5
commit e2b3030ef5
3 changed files with 14 additions and 6 deletions

View File

@@ -10,6 +10,9 @@ namespace InfectedRose.Interface
{
[JsonPropertyName("id")]
public string Id { get; set; } = "";
[JsonPropertyName("explicit-id")]
public int? ExplicitId { get; set; }
[JsonPropertyName("old-ids")]
public string[]? OldIds { get; set; }

View File

@@ -171,7 +171,14 @@ namespace InfectedRose.Interface
return true;
}
if (mod.ExplicitId.HasValue)
{
key = mod.ExplicitId.Value;
return true;
}
if (mod.OldIds == null)
{
key = 0;
@@ -185,7 +192,7 @@ namespace InfectedRose.Interface
return true;
}
key = 0;
return false;
@@ -261,8 +268,8 @@ namespace InfectedRose.Interface
// Get the relative path from root to asset
var finalRelative = Path.GetRelativePath(root, final);
return finalRelative.Replace("/", "\\");
return finalRelative;
}
public static int AddIcon(string file)

View File

@@ -667,11 +667,9 @@ namespace InfectedRose.Interface
if (Directory.Exists(ModContext.Configuration.Copy))
{
Directory.Delete(ModContext.Configuration.Copy, true);
Directory.CreateDirectory(ModContext.Configuration.Copy);
}
CopyFilesRecursively(ModContext.Root, ModContext.Configuration.Copy);
File.CreateSymbolicLink(ModContext.Configuration.Copy, ModContext.Root);
}
origin = Console.GetCursorPosition();