Reformatted command prompt header and added relative paths.
This commit is contained in:
parent
92b22d6749
commit
7854a576a7
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user