public static void AutoswitchSettings() { Console.Clear(); Console.WriteLine("Please press on your inventory F-key"); Settings.Instance.InventFKey = (Keys)Console.ReadKey().Key; Console.WriteLine("\nYour inventory F-key is: " + Settings.Instance.InventFKey); Console.WriteLine(); Settings.Instance.InventorySlots = CLI.GetInventory(); if (Settings.Instance.InventorySlots.Count > 0) { Console.WriteLine("Successfully saved inventory data"); } Console.WriteLine(); int autoSwitches = int.MaxValue; int currentCounter = 0; retry: Console.WriteLine("How many autoswitches do you want?"); try { autoSwitches = int.Parse(Console.ReadLine()); } catch (Exception) { Console.WriteLine("Invalid number"); goto retry; } while (autoSwitches != currentCounter) { Console.Clear(); var autoSwitchItems = GetAutoSwitchItems(); Console.WriteLine("Please press on your desired autoswitch key"); var autoSwitchKey = (Keys)Console.ReadKey().Key; Console.WriteLine("\nYour autoswitch hotkey is: " + autoSwitchKey); if (Settings.Instance.ActiveAutoSwitchHotkeys == null) { Settings.Instance.ActiveAutoSwitchHotkeys = new Dictionary <Keys, List <int> >(); } if (Settings.Instance.ActiveAutoSwitchHotkeys.ContainsKey(autoSwitchKey)) { Settings.Instance.ActiveAutoSwitchHotkeys.Remove(autoSwitchKey); Console.WriteLine("Existing hotkey was found, overwriting."); } Settings.Instance.ActiveAutoSwitchHotkeys.Add(autoSwitchKey, autoSwitchItems); currentCounter++; } Console.WriteLine("Successfully setup autoswitcher"); Console.WriteLine("Press any key to return to main menu"); Console.ReadKey(); }
public static void EditSettings() { resetSettings: Console.Clear(); CLI.RenderSettings(Settings.Instance); Console.WriteLine("Enter a setting to change"); var KeyToSwitch = (Keys)Console.ReadKey().Key; if (KeyToSwitch == Keys.D1 || KeyToSwitch == Keys.NumPad1) { Console.Clear(); Console.WriteLine("Mouse speed(lower = faster): "); var succParse = int.TryParse(Console.ReadLine(), out var newSpeed); if (succParse) { Settings.Instance.Speed = newSpeed; } else { Console.WriteLine("invalid value"); } } else if (KeyToSwitch == Keys.D2 || KeyToSwitch == Keys.NumPad2) { Settings.Instance.ReturnToOldPos = !Settings.Instance.ReturnToOldPos; } else if (KeyToSwitch == Keys.D3 || KeyToSwitch == Keys.NumPad3) { return; } else { Console.WriteLine("Please enter a valid value"); } goto resetSettings; }