Skip to content

Commit

Permalink
remove legacy getcolor & setcolor
Browse files Browse the repository at this point in the history
  • Loading branch information
axellse committed Feb 18, 2024
1 parent 3d448f2 commit a7957e2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 56 deletions.
Binary file modified TerminalPilot/.vs/TerminalPilot/v17/.suo
Binary file not shown.
55 changes: 1 addition & 54 deletions TerminalPilot/Classes/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,10 @@ public class ConfigManager
{

//color palletes
public static Color GetColor(ColorSchemeColors color)
{
string configcolor = default;
if (color == ColorSchemeColors.Standard)
{
configcolor = (string?)Properties.Settings.Default["StandardTextColor"];
} else if (color == ColorSchemeColors.Background)
{
configcolor = (string?)Properties.Settings.Default["BackgroundColor"];
}
else if (color == ColorSchemeColors.Special1)
{
configcolor = (string?)Properties.Settings.Default["SpecialColor1"];
}
else if (color == ColorSchemeColors.Special2)
{
configcolor = (string?)Properties.Settings.Default["SpecialColor2"];
}
else if (color == ColorSchemeColors.Special3)
{
configcolor = (string?)Properties.Settings.Default["SpecialColor3"];
}
return Color.FromArgb(0, Int32.Parse(configcolor.Split(',')[0]), Int32.Parse(configcolor.Split(',')[1]), Int32.Parse(configcolor.Split(',')[2]));
}
public static void SetColor(ColorSchemeColors color, Color finalcolor)
{
string colortoset = finalcolor.R.ToString() + "," + finalcolor.G.ToString() + "," + finalcolor.B.ToString() + ",";
if (color == ColorSchemeColors.Standard)
{
Properties.Settings.Default["StandardTextColor"] = colortoset;
}
else if (color == ColorSchemeColors.Background)
{
Properties.Settings.Default["BackgroundColor"] = colortoset;
}
else if (color == ColorSchemeColors.Special1)
{
Properties.Settings.Default["SpecialColor1"] = colortoset;
}
else if (color == ColorSchemeColors.Special2)
{
Properties.Settings.Default["SpecialColor2"] = colortoset;
}
else if (color == ColorSchemeColors.Special3)
{
Properties.Settings.Default["SpecialColor3"] = colortoset;
}
}


//startup

public static void StartUp()
{
SetColor(ColorSchemeColors.Standard, Color.White);
SetColor(ColorSchemeColors.Special1, Color.Aqua);
SetColor(ColorSchemeColors.Special2, Color.Purple);
}
public static void SetShell(string shell, string shellargument)
{
Properties.Settings.Default["Shell"] = shell;
Expand Down
4 changes: 2 additions & 2 deletions TerminalPilot/Parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void messagetip(string message)
Console.CursorLeft = 0;
Console.CursorTop = Console.WindowTop + Console.WindowHeight - 2;
_tempflag_messagetipline = Console.CursorTop;
Console.WriteLine(message.Pastel(ConfigManager.GetColor(ColorSchemeColors.Special1)));
Console.WriteLine(message.Pastel(Palletes.GetCurrentPallete(PalleteType.Small1)));
Console.SetCursorPosition(oldcursorleft, oldcursortop);

}
Expand Down Expand Up @@ -106,7 +106,7 @@ void messagetip(string message)
instance.Workingdirectory = new DirectoryInfo(_tempflag_pathbeforedireditor);
_tempflag_pathbeforedireditor = "";
instance.InDirectoryEditor = false;
Console.Write("Exited directory editor without making any changes".Pastel(ConfigManager.GetColor(ColorSchemeColors.Special1)));
Console.Write("Exited directory editor without making any changes".Pastel(Palletes.GetCurrentPallete(PalleteType.Large)));
}
Console.WriteLine();
Interpreter.InterpreteCommand(_tempflag_commandwinput, instance);
Expand Down

0 comments on commit a7957e2

Please sign in to comment.