diff --git a/SrcMod/Shell/Mod.cs b/SrcMod/Shell/Mod.cs index b4472d5..d6da543 100644 --- a/SrcMod/Shell/Mod.cs +++ b/SrcMod/Shell/Mod.cs @@ -3,10 +3,12 @@ public class Mod { public string Name { get; set; } + public string RootDirectory { get; set; } private Mod() { Name = string.Empty; + RootDirectory = string.Empty; } public static Mod? ReadDirectory(string dir) @@ -15,7 +17,8 @@ public class Mod Mod mod = new() { - Name = dir.Split("\\").Last() + Name = dir.Split("\\").Last(), + RootDirectory = dir }; return mod; diff --git a/SrcMod/Shell/Shell.cs b/SrcMod/Shell/Shell.cs index acb78fe..ef5f7b0 100644 --- a/SrcMod/Shell/Shell.cs +++ b/SrcMod/Shell/Shell.cs @@ -139,9 +139,18 @@ public class Shell public string ReadLine() { - Write($"\n{WorkingDirectory}", ConsoleColor.DarkGreen, false); - if (ActiveGame is not null) Write($" {ActiveGame}", ConsoleColor.DarkYellow, false); - if (ActiveMod is not null) Write($" {ActiveMod}", ConsoleColor.Magenta, false); + Write("\n", newLine: false); + if (ActiveMod is not null) Write($"{ActiveMod} ", ConsoleColor.Magenta, false); + + if (ActiveMod is not null) + { + string directory = Path.GetRelativePath(ActiveMod.RootDirectory, WorkingDirectory); + if (directory == ".") directory = string.Empty; + Write($"~\\{directory}", ConsoleColor.DarkGreen, false); + } + else Write($"{WorkingDirectory}", ConsoleColor.DarkGreen, false); + + if (ActiveGame is not null) Write($" ({ActiveGame})", ConsoleColor.DarkYellow, false); Write(null); Write($" {Name}", ConsoleColor.DarkCyan, false);