From a7957e22bc444aa00e08386e9a93ae3d346d699a Mon Sep 17 00:00:00 2001 From: axellse Date: Sun, 18 Feb 2024 22:19:53 +0100 Subject: [PATCH] remove legacy getcolor & setcolor --- TerminalPilot/.vs/TerminalPilot/v17/.suo | Bin 114688 -> 112640 bytes TerminalPilot/Classes/ConfigManager.cs | 55 +---------------------- TerminalPilot/Parser/Parser.cs | 4 +- 3 files changed, 3 insertions(+), 56 deletions(-) diff --git a/TerminalPilot/.vs/TerminalPilot/v17/.suo b/TerminalPilot/.vs/TerminalPilot/v17/.suo index 6470b108ffd14cfe7f9fb247e957ded5e8ad489f..c838d1dd0c7ef8f22e414a3ee3f766d4469daaab 100644 GIT binary patch delta 2186 zcmdUve@v8h9LJx}_Z|)okssb61WM45_!WVXBV>f7W$I#?ZAc zERQm@9WfDX0QZAPo^f|xLM_xoU^9@T8$8an+Zv7JDa1QK8dzb}LQ6CwZvn|+^=F`q zz&oG=bb>Ch4|Ibb;09i{D~fMlG5Q-@dcti9tz$udd5H2bUBB%4%@pVvY3cv<0YA@KQnpSBvP0tWFp-x>}P@E@fKNA&U1`tqer) zt%GS=#RygVn{xYT`E%&i3-*J93nOlx-}BJNJkHxQykSKS-3ML-no$=XXWnBzBMF`T z0P;cbdRTo3`VBA)#=`33(1EaA&Y>fJ8_4@073WE3JVjC0fOf)djVHS-{^fJ+;ibG5sP(_z2jxG~kCQdQYmmy6{)@rWcJk%^F0h|k-JFMzR0I?z1&5oBYcf0H;_5d zM290ZX9nG?O|(#jubG&3GL~}qrENxW@Tr=<*2y54)7 zx-HtweyY^ETk#K$HdChF{WA5MxP7!jukg_XY4%ns)5}iKS@NACcC%rSCQN~0T4mPk K{gnLc1N{rT(@li{ delta 1855 zcmd6lU2GIp6vy}6nNGXwZr$21VEeJwZKc>?Da}d{HY;u##ZXy82(0vh#wg0BZb?hD zR@jg#jTq9|tDUNd_KKq@k#0vj3D!{Xr3nSUh!0XpF+TX<0}m<@mGytyU2PhSzK}TC z-~P`zbI-YR|1-(US~8hGu%@)k;czJ6S|*c$%*NH}sE;{k*2T^oZ~unwwYr%?bc8>x zJmdKUOM-s6(BbfLQpS}+vVj$=O0jcJbC3TaiK1)mPh|DR?GgJ)hc=xT8-O5IX@%4 zmK)CZTGn%3%UE9Udd_M+TE3wG$@Og3P`{qd`KX7%jkH;~8GfT>0cHgnrWH}hL?aW6 zRMDymzb3p)Y+*)Cn&MV`)k`E|8c)ApWo+!H25WuOSl(z!K$VRoLacJ`$bbK@z_X8o z*$S_$@_7cbnGPMqn~n};3$H+51+Rfa;B{~qyaC<>!{99-M;(E_4UT5>+=lNVKaQb` zM-W)^ZhnaPBX9yYYd=OHUvmlcB#_+`&{N6gZ^1=yP2av>)UnjAF6y_scO4+n!g7vP7~w&38&@q_YIQ76kyx*eHm+vIo?a?3 z5^1WMv-lxR-|Y4Luf4k+C%rM=r3xcfBtA~kz^7&n}H~Yi5^XKFtLw`7gW*D#6iE9RK*|@Q%nq%iAk3@_m}_pV$Y9}v7(=>Z+A5gG>Kkp6k0dMm^GV@hz!Ph!ALP70c`v$!JKLJO(hQI&- diff --git a/TerminalPilot/Classes/ConfigManager.cs b/TerminalPilot/Classes/ConfigManager.cs index 648c505..ed01b9a 100644 --- a/TerminalPilot/Classes/ConfigManager.cs +++ b/TerminalPilot/Classes/ConfigManager.cs @@ -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; diff --git a/TerminalPilot/Parser/Parser.cs b/TerminalPilot/Parser/Parser.cs index dfc0afd..6577430 100644 --- a/TerminalPilot/Parser/Parser.cs +++ b/TerminalPilot/Parser/Parser.cs @@ -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); } @@ -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);