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 class Mod
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string RootDirectory { get; set; }
|
||||||
|
|
||||||
private Mod()
|
private Mod()
|
||||||
{
|
{
|
||||||
Name = string.Empty;
|
Name = string.Empty;
|
||||||
|
RootDirectory = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mod? ReadDirectory(string dir)
|
public static Mod? ReadDirectory(string dir)
|
||||||
@ -15,7 +17,8 @@ public class Mod
|
|||||||
|
|
||||||
Mod mod = new()
|
Mod mod = new()
|
||||||
{
|
{
|
||||||
Name = dir.Split("\\").Last()
|
Name = dir.Split("\\").Last(),
|
||||||
|
RootDirectory = dir
|
||||||
};
|
};
|
||||||
|
|
||||||
return mod;
|
return mod;
|
||||||
|
|||||||
@ -139,9 +139,18 @@ public class Shell
|
|||||||
|
|
||||||
public string ReadLine()
|
public string ReadLine()
|
||||||
{
|
{
|
||||||
Write($"\n{WorkingDirectory}", ConsoleColor.DarkGreen, false);
|
Write("\n", newLine: false);
|
||||||
if (ActiveGame is not null) Write($" {ActiveGame}", ConsoleColor.DarkYellow, false);
|
|
||||||
if (ActiveMod is not null) Write($"{ActiveMod} ", ConsoleColor.Magenta, 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(null);
|
||||||
|
|
||||||
Write($" {Name}", ConsoleColor.DarkCyan, false);
|
Write($" {Name}", ConsoleColor.DarkCyan, false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user